Foros del Web » Programando para Internet » ASP Clásico »

Graficos en Asp

Estas en el tema de Graficos en Asp en el foro de ASP Clásico en Foros del Web. Hola amigos necesito un poco de ayuda, tengo que hacer un grafico de barras o pie, para mostrarlo en asp, y no tengo idea, me ...
  #1 (permalink)  
Antiguo 18/11/2002, 11:15
Avatar de vamp_02  
Fecha de Ingreso: febrero-2002
Ubicación: Santiago de Chile
Mensajes: 367
Antigüedad: 23 años, 2 meses
Puntos: 0
Graficos en Asp

Hola amigos necesito un poco de ayuda, tengo que hacer un grafico de barras o pie, para mostrarlo en asp, y no tengo idea, me podrian ayudar

Trabajo con Oracle y Asp
  #2 (permalink)  
Antiguo 18/11/2002, 11:35
 
Fecha de Ingreso: febrero-2002
Ubicación: Navarra
Mensajes: 701
Antigüedad: 23 años, 2 meses
Puntos: 2
Hola, mira este código, no recuerdo de qué pagina lo saqué, haber si te sirve, solo recuerdo que la página era portuguesa o brasileña, no sé

Un saludo

Código:
'Este Script é uma função que cria um gráfico de barras, a partir de arrays. 

<%@ Language=VBScript %> 
<% 

function makechart(title, numarray, labelarray, imagename, maxheight, maxwidth, addvalues) 

'title: Título do Grafico 
'numarray: Uma Array de valores para montar o Gráfico 
'labelarray: Uma Array com os títulos dos valores passados pela Array numarray 
'imagename: Nome da imagem a ser utilizada para construir o gráfico. Utilize um Gif de 1 pixel da cor que você preferir... 
'maxheight: Altura do Gráfico, sem contar os títulos dos valores 
'maxwidth: Largura de cada coluna 
'addvalues: True ou False. Se vc quer que os valores apareçam ou não no gráfico 
'para usar esta função: response.write makechart(parameters) 


dim tablestring 
dim max 
dim tempnumarray 
dim templabelarray 
dim heightarray 
dim tempnum 

if maxheight > 0 and maxwidth > 0 and ubound(labelarray) = ubound(numarray) then 

templabelarray = labelarray 
tempnumarray = numarray 
heightarray = array() 
max = 0 
maxlength = 0 
tablestring = "<TABLE>" & vbCrLf 

for each stuff in tempnumarray 
if stuff > max then max = stuff end if 
next 


tempnum = maxheight/max 

for counter = 0 to ubound(tempnumarray) 
if tempnumarray(counter) = max then 
redim preserve heightarray(counter) 
heightarray(counter) = maxheight 
else 
redim preserve heightarray(counter) 
heightarray(counter) = tempnumarray(counter) * tempnum 
end if 
next 

tablestring = tablestring & "<TR><TH colspan='" & ubound(tempnumarray)+1 & "'>" & title & "</TH></TR>" & _ 
vbCrLf & "<TR>" & vbCrLf 
for counter = 0 to ubound(tempnumarray) 
tablestring = tablestring & vbTab & "<TD valign='bottom' align='center'><img src='" & imagename & "' width='" & maxwidth & "' height='" & _ 
heightarray(counter) & "'>" 
if addvalues then 
tablestring = tablestring & "<BR>" & tempnumarray(counter) 
end if 
tablestring = tablestring & "</TD>" & vbCrLf 
next 

tablestring = tablestring & "</TR>" & vbCrLf 


for each stuff in labelarray 
tablestring = tablestring & vbTab & "<TD align='center'><B>    " & stuff & "    </TD>" & vbCrLf 
next 

tablestring = tablestring & "</TABLE>" & vbCrLf 
makechart = tablestring 
else 
Response.Write "Erro! A altura e a largura devem ser maiores que zero (0), ou o número de títulos não é igual ao número de valores passados..." 
end if 
end function 
%> 


<HTML> 
<HEAD> 
<TITLE>CHART</TITLE> 
</HEAD> 
<BODY> 
<% 
dim stuff 
stuff = Array(200,100,50,74,23.3) 
labelstuff = Array("Campo1","Campo2","fff","ggg","gggg") 
Response.Write makechart("Meu Gráfico", stuff, labelstuff, "chart.gif", 50, 10, true) 
%> 
</BODY> 
</HTML>
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 03:55.