Ir para conteúdo
Fórum Script Brasil
  • 0

Gráfico


Maxuel

Pergunta

4 respostass a esta questão

Posts Recomendados

  • 0
Guest - marcelo -

<%

Option Explicit

Dim Conn

Dim RS

Dim SQLStmt

Dim os_dados

Set Conn=Server.CreateObject("ADODB.Connection")

Conn.Open "PROVIDER=MSDASQL;" & _

"DRIVER={Microsoft Access Driver (*.mdb)}; " & _

"DBQ=" & server.mappath("dados.mdb")

Set RS = Server.CreateObject("ADODB.Recordset")

Function sacar_dados(quote)

os_dados = ""

SQLStmt = "SELECT * FROM dados where quote_dados='" & quote & "' ORDER BY datahora_dados"

Set Rs=Conn.Execute(SQLStmt)

While NOT RS.EOF

os_dados = os_dados & RS("valor_dados") & ","

RS.MoveNext

Wend

os_dados = Left(os_dados,Len(os_dados)-1)

RS.Close

sacar_dados = os_dados

End Function

Function sacar_totais(quote)

SQLStmt = "SELECT SUM(valor_dados) AS total FROM dados where quote_dados='" & quote & "'"

Set Rs=Conn.Execute(SQLStmt)

If NOT RS.EOF then

sacar_totais = RS("total")

End If

RS.Close

End Function

response.write "<APPLET code=""com.objectplanet.chart.LineChartApplet"" archive=""chart.jar"" width=250 height=180 VIEWASTEXT>" & VbNewLine

response.write "<param name=""seriesCount"" value=5>" & VbNewLine

response.write "<PARAM name=seriesLabels value=""ASP, JSP, PHP, PERL, CF"">" & VbNewLine

response.write "<param name=""series0_values"" value=""" & sacar_dados("ASP") & """>" & VbNewLine

response.write "<param name=""series1_values"" value=""" & sacar_dados("JSP") & """>" & VbNewLine

response.write "<param name=""series2_values"" value=""" & sacar_dados("PHP") & """>" & VbNewLine

response.write "<param name=""series3_values"" value=""" & sacar_dados("PERL") & """>" & VbNewLine

response.write "<param name=""series4_values"" value=""" & sacar_dados("CF") & """>" & VbNewLine

response.write "<PARAM name=range value=60>" & VbNewLine

response.write "<PARAM name=rangeDecimalCount value=1>" & VbNewLine

response.write "<PARAM name=title value=""Grafico de Linhas"">" & VbNewLine

response.write "<PARAM name=titleOn value=""true"">" & VbNewLine

response.write "<PARAM name=legendOn value=true>" & VbNewLine

response.write "<PARAM name=legendPosition value=right>" & VbNewLine

response.write "<PARAM name=valueLinesOn value=true>" & VbNewLine

response.write "<PARAM name=sampleLabelsOn value=true>" & VbNewLine

response.write "<PARAM name=background value=lightgray>" & VbNewLine

response.write "<PARAM name=foreground value=black>" & VbNewLine

response.write "<PARAM name=chartBackground value=white>" & VbNewLine

response.write "<PARAM name=chartForeground value=black>" & VbNewLine

response.write "<PARAM name=valueLinesColor value=lightgray>" & VbNewLine

response.write "<PARAM name=sampleColors value=""orange, red, magenta, blue, green"">" & VbNewLine

response.write "</applet>" & VbNewLine

response.write "<APPLET code=""com.objectplanet.chart.BarChartApplet"" archive=""chart.jar"" width=250 height=180 VIEWASTEXT>" & VbNewLine

response.write "<param name=sampleCount value=5>" & VbNewLine

response.write "<PARAM name=sampleValues value=""" & sacar_totais("ASP") & ", " & sacar_totais("JSP") & ", " & sacar_totais("PHP") & ", " & sacar_totais("PERL") & ", " & sacar_totais("CF") & """>" & VbNewLine

response.write "<PARAM name=sampleLabels value=""ASP, JSP, PHP, PERL, CF"">" & VbNewLine

response.write "<PARAM name=range value=500>" & VbNewLine

response.write "<PARAM name=title value=""Grafico de Barras 3D"">" & VbNewLine

response.write "<PARAM name=range value=500>" & VbNewLine

response.write "<PARAM name=lowerRange value=0>" & VbNewLine

response.write "<PARAM name=sampleDecimalCount value=1>" & VbNewLine

response.write "<PARAM name=rangeDecimalCount value=1>" & VbNewLine

response.write "<PARAM name=titleOn value=true>" & VbNewLine

response.write "<PARAM name=legendOn value=true>" & VbNewLine

response.write "<PARAM name=legendPosition value=right>" & VbNewLine

response.write "<PARAM name=valueLabelsOn value=true>" & VbNewLine

response.write "<PARAM name=valueLinesOn value=true>" & VbNewLine

response.write "<PARAM name=multiColorOn value=true>" & VbNewLine

response.write "<PARAM name=barLabelsOn value=true>" & VbNewLine

response.write "<PARAM name=barAlignment value=vertical>" & VbNewLine

response.write "<PARAM name=3DModeOn value=true>" & VbNewLine

response.write "<PARAM name=frameOn value=false>" & VbNewLine

response.write "<PARAM name=background value=""200,200,200"">" & VbNewLine

response.write "<PARAM name=foreground value=black>" & VbNewLine

response.write "<PARAM name=chartBackground value=""#ffffff"">" & VbNewLine

response.write "<PARAM name=chartForeground value=black>" & VbNewLine

response.write "<PARAM name=sampleColors value=""red, green, blue, orange, gray"">" & VbNewLine

response.write "</APPLET>" & VbNewLine

response.write "<APPLET code=""com.objectplanet.chart.PieChartApplet"" archive=""chart.jar"" width=250 height=180 VIEWASTEXT>" & VbNewLine

response.write "<param name=sampleCount value=5>" & VbNewLine

response.write "<PARAM name=sampleValues value=""" & sacar_totais("ASP") & ", " & sacar_totais("JSP") & ", " & sacar_totais("PHP") & ", " & sacar_totais("PERL") & ", " & sacar_totais("CF") & """>" & VbNewLine

response.write "<PARAM name=sampleLabels value=""ASP, JSP, PHP, PERL, CF"">" & VbNewLine

response.write "<PARAM name=range value=500>" & VbNewLine

response.write "<PARAM name=title value=""Grafico de Barras 3D"">" & VbNewLine

response.write "<PARAM name=range value=500>" & VbNewLine

response.write "<PARAM name=lowerRange value=0>" & VbNewLine

response.write "<PARAM name=sampleDecimalCount value=1>" & VbNewLine

response.write "<PARAM name=rangeDecimalCount value=1>" & VbNewLine

response.write "<PARAM name=titleOn value=true>" & VbNewLine

response.write "<PARAM name=legendOn value=true>" & VbNewLine

response.write "<PARAM name=legendPosition value=right>" & VbNewLine

response.write "<PARAM name=valueLabelsOn value=true>" & VbNewLine

response.write "<PARAM name=valueLinesOn value=true>" & VbNewLine

response.write "<PARAM name=multiColorOn value=true>" & VbNewLine

response.write "<PARAM name=barLabelsOn value=true>" & VbNewLine

response.write "<PARAM name=barAlignment value=vertical>" & VbNewLine

response.write "<PARAM name=3DModeOn value=true>" & VbNewLine

response.write "<PARAM name=frameOn value=false>" & VbNewLine

response.write "<PARAM name=background value=""200,200,200"">" & VbNewLine

response.write "<PARAM name=foreground value=black>" & VbNewLine

response.write "<PARAM name=chartBackground value=""#ffffff"">" & VbNewLine

response.write "<PARAM name=chartForeground value=black>" & VbNewLine

response.write "<PARAM name=sampleColors value=""red, green, blue, orange, gray"">" & VbNewLine

response.write "</APPLET>" & VbNewLine

%>

banco access

campos tipo

id_dados AutoNumeração

quote_dados Texto

valor_dados numero

datahora_dados Data/Hora

vai criar os tres tipos

Link para o comentário
Compartilhar em outros sites

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,1k
    • Posts
      651,8k
×
×
  • Criar Novo...