Ver Mensaje Individual
  #5 (permalink)  
Antiguo 01/02/2007, 15:04
Avatar de dobled
dobled
 
Fecha de Ingreso: enero-2002
Ubicación: Rancagua - Chile
Mensajes: 1.328
Antigüedad: 23 años, 2 meses
Puntos: 2
Re: Problema con arreglo

pero por su puesto mi amigo

Código:
<style>
.textovertical {writing-mode: tb-rl; font-family:Arial, Helvetica, sans-serif; font-size:11px}
.titulos{	font-family:Arial, Helvetica, sans-serif;
		font-size:18px;
}
.vertical {writing-mode: tb-rl; filter: flipv fliph; font-family:Arial, Helvetica, sans-serif; font-size:20px}
H2 {font-family:Arial, Helvetica, sans-serif; font-size:24px}
</style> 
<!--#include file="conexion_inc.asp" -->
<%
	conexion = ConectarSQL()
	Set  dataChart = Query("SELECT * FROM vista_feedback_graf_area WHERE anomes = '200612' ORDER By subarea", conexion)
	
	do while not dataChart.Eof
	If arrA = "" Then
	arrA = dataChart("subarea")
	else
	arrA = arrA&","& dataChart("subarea")
	end If
	dataChart.movenext
	loop
	Cierra(dataChart)



	'response.write (""&arrA&"<BR>")
	
	conexion = ConectarSQL()
	Set  dataChartb = Query("SELECT * FROM vista_feedback_graf_area WHERE anomes = '200612' ORDER By subarea", conexion)
	
	do while not dataChartb.Eof
	If arrB = "" Then
	arrB = dataChartb("numxarea")
	else
	arrB = arrB &","& dataChartb("numxarea")
	end If
	dataChartb.movenext
	loop
	Cierra(dataChartb)
	'response.write arrB

response.write arrB

%>
<%
Sub ShowChart(ByRef aValues, ByRef aLabels, ByRef strTitle, ByRef strXAxisLabel, ByRef strYAxisLabel)

	Const GRAPH_WIDTH  = 450  
	Const GRAPH_HEIGHT = 250 
	Const GRAPH_BORDER = 5    
	Const GRAPH_SPACER = 2    


	Const TABLE_BORDER = 0


	Dim I
	Dim iMaxValue
	Dim iBarWidth
	Dim iBarHeight

	' Saca el valor maximo del arreglo
	iMaxValue = 0
	For I = 0 To UBound(aValues)
		If iMaxValue < aValues(I) Then iMaxValue = aValues(I)
	Next 'I
	'Response.Write iMaxValue ' Debugging 


	iBarWidth = (GRAPH_WIDTH \ (UBound(aValues) + 1)) - GRAPH_SPACER
	'Response.Write iBarWidth ' Debugging 


%>
	<TABLE BORDER="<%= TABLE_BORDER %>" CELLSPACING="0" CELLPADDING="0">
		<TR>
			<TD COLSPAN="3" ALIGN="center"><H2><%= strTitle %></H2></TD>
		</TR>
		<TR>
			<TD align="center" class="vertical"><B><%= strYAxisLabel %></B></TD>
			<TD VALIGN="top">
				<TABLE BORDER="<%= TABLE_BORDER %>" CELLSPACING="0" CELLPADDING="0">
					<TR>
						<TD ROWSPAN="2"><IMG SRC="./images/spacer.gif" BORDER="0" WIDTH="1" HEIGHT="<%= GRAPH_HEIGHT %>"></TD>
						<TD VALIGN="top" ALIGN="right" style="font-family:Arial, Helvetica, sans-serif; font-size:12px;"><%= iMaxValue %>&nbsp;</TD>
					</TR>
					<TR>
						<TD VALIGN="bottom" ALIGN="right" style="font-family:Arial, Helvetica, sans-serif; font-size:12px;">0&nbsp;</TD>
					</TR>
				</TABLE>
			</TD>
			<TD>
				<TABLE BORDER="<%= TABLE_BORDER %>" CELLSPACING="0" CELLPADDING="0">
					<TR>
						<TD VALIGN="bottom"><IMG SRC="./images/spacer_black.gif" BORDER="0" WIDTH="<%= GRAPH_BORDER %>" HEIGHT="<%= GRAPH_HEIGHT %>"></TD>
					<%
					
					For I = 0 To UBound(aValues)
						iBarHeight = Int((aValues(I) / iMaxValue) * GRAPH_HEIGHT)

						
						If iBarHeight = 0 Then iBarHeight = 1
					%>
						<TD VALIGN="bottom"><IMG SRC="./images/spacer.gif" BORDER="0" WIDTH="<%= GRAPH_SPACER %>" HEIGHT="1"></TD>
						<TD VALIGN="bottom"><IMG SRC="./images/spacer_red.gif" BORDER="0" WIDTH="<%= iBarWidth %>" HEIGHT="<%= iBarHeight %>" ALT="<%= aValues(I) %>"></TD>
					<%
					Next 'I
					%>
					</TR>
					
					<TR>
						<TD COLSPAN="<%= (2 * (UBound(aValues) + 1)) + 1 %>"><IMG SRC="./images/spacer_black.gif" BORDER="0" WIDTH="<%= GRAPH_BORDER + ((UBound(aValues) + 1) * (iBarWidth + GRAPH_SPACER)) %>" HEIGHT="<%= GRAPH_BORDER %>"></TD>
					</TR>
				
				<% If IsArray(aLabels) Then %>
					<TR>
						<TD></TD>
					<% For I = 0 To UBound(aValues)  %>
						<TD></TD>
						<TD ALIGN="center" VALIGN="top"><FONT SIZE="1" class="textovertical">&nbsp;<%= aLabels(I) %></FONT></TD>
					<% Next 'I %>
					</TR>
				<% End If %>
				</TABLE>
			</TD>
		</TR>
		<TR>
			<TD COLSPAN="2"></TD>
			<TD ALIGN="center"><B><%= strXAxisLabel %></B></TD>
		</TR>
	</TABLE>
	<%
End Sub
%>
<%
ShowChart Split(arrB,","), Array("Corrugadora", "P2", "P3", "P4", "P5", "P6", "P7", "P8", "P9", "P10", "P11", "P8", "P9", "P10", "P11"), "Feedback por Maquina /Area", "Area", "Cantidad de Feedback"
'ShowChart Split(arrB,","), Split(arrA,","), "Título del Gráfico", "Areas", "Y"

%>
puedes reemplazar los valores y ponerlos a mano o conectenlos a cualquier bd para que te funcione el grafico.

Saludos
__________________
Usa títulos específicos y con sentido
En las listas de correo o en los grupos de noticias, la cabecera del mensaje es tu oportunidad de oro para atraer la atención de expertos cualificados en aproximadamente 50 caracteres o menos. No los desperdicies en balbuceos como "Por favor ayúdame" (de "POR FAVOR AYÚDAME!!!" ya ni hablamos). No intentes impresionarnos con lo profundo de tu angustia; mejor usa ese preciado espacio para una descripción lo más concisa posible del problema.

Última edición por dobled; 01/02/2007 a las 15:11