salve Ragazzi
ho un problema con un grafico che sto cercando di fare per una statistiche annuale della moneta
il grafico che ho trovato su internet e funziona bene per mettere nel mio spazio di aruba é questo:
http://www.brasileitalia.info/grafico.asp
ecco dove ho trovato questo grafico
http://www.stigc.dk/projects/pureAsp....asp?example=4
ma ha un difetto
il difetto é se metto mille record vieni tutti in quella stessa pagina.
ho bisogno che mostrasse in quelle grafico massimo 10 record
non di più, che sia gli ultimi record che sono messe nella tabella
mi avete capito
ecco qui in codice del database
[QUOTE<%
Dim strConnection, myConn, rs
dim x
x="x"
'Gets data form the database
Set obj = Server.CreateObject("ADODB.Connection")
obj.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("mdb-database/db.mdb")
Set rs = obj.Execute("SELECT date, reais, dolar FROM log ORDER BY date")
Dim objGraph
Set objGraph = New PureAspGraph
'For CicloNews = 1 To 7
'Adds data
Call objGraph.setDataFromRecordset(rs, 0, 1) '0 is index of the text, 1 is index of the data
rs.moveFirst
Call objGraph.addDataFromRecordset(rs, 2) '2 is index of the data
'Next
'End If
Call objGraph.addLabel("Reais")
Call objGraph.addLabel("Dollare")
Call objGraph.setType(1)
Call objGraph.setBarWidth(5)
Call objGraph.print()
%>[/QUOTE]
ecco qui la parte della classe del grafico dove penso che si possa cambiare per risolvere questo difetto
Grazie Mille ragazziFunction addDataFromRecordset(rs, index)
Dim i
Do While Not rs.Eof
arrValues(lngValueSetCount,i)=rs(index)
rs.movenext
i=i+1
Loop
lngValueSetCount = lngValueSetCount + 1
'No need to flip text..
if lngValueSetCount>4 Then
blnFlipText = False
End if
End Function
'Sets the data from a ADODB recordset.
'rs: ADODB.recordset
'f: index of item texts
'd: index of item values
Function setDataFromRecordset(rs, f, d)
Dim i
Do While Not rs.Eof
Redim Preserve arrItems(i)
Redim Preserve arrValues(groupingCount-1, i)
arrItems(i)=rs(f)
arrValues(lngValueSetCount , i)=rs(d)
i=i+1
rs.movenext
Loop
lngValueSetCount = lngValueSetCount + 1
End Function
'Sets the data from 2 arrays.
'x: Array of item texts
'y: Array of item values
Function addData(x)
Dim i
For i=0 To ubound(x)
arrValues(lngValueSetCount, i)= x(i)
Next
lngValueSetCount = lngValueSetCount + 1
'No need to flip text..
if lngValueSetCount>4 Then
blnFlipText = False
End if
End Function

Rispondi quotando
