Hi Jeremy,
thanks for your input, but the graph’s still empty.
Code:
[code]Sub Open()
'declare vars
Dim maandArray() As String
Dim valueArray() as String
Dim scoreArray() as String
Dim graphArray() as String
dim rs as recordset
'fill arrays
maandArray = Array(“jan”,“feb”,“mar”,“apr”,“mei”,“jun”,“jul”,“aug”,“sep”,“okt”, “nov”,“dec”)
scoreArray = Array(“0”,“0”,“0”,“0”,“0”,“0”,“0”,“0”,“0”,“0”,“0”,“0”)
'scoreArray corresponds with maandarray
'create recordset
rs = app.db.SQLSelect(“select * from LOG”)
while not rs.eof
'fill temporary array with date strings
'split on “-”
dim anArray() as String
anArray = Split(rs.field(“Entry”).StringValue, “-”)
'store the second string (the month) in the temporary array
valueArray.append(anArray(1))
rs.movenext
wend
'scan the values into a dictionary
'count the values of each month
dim dict As new Dictionary
dim s As String
for i As integer = 0 to valueArray.Ubound
s = valueArray(i)
dict.Value(s) = dict.Lookup(s, 0) + 1
next
'add the month values to the corresponding month
dim keys() as variant = dict.Keys
for i as integer = 0 to keys.Ubound
scoreArray(Val(keys(i))-1) = dict.value(keys(i))
next
graphArray.append(“Date, Score” + EndOfLine)
for i as integer = 0 to maandArray.Ubound
graphArray.append(maandArray(i) + “,” + scoreArray(i) + EndOfLine)
next
ChartView1.Type = ChartView.TypeColumn
ChartView1.Freeze = True
ChartView1.LoadFromCSV(Join(GraphArray,EndOfLine))
ChartView1.setTransparency(10)
ChartView1.LegendPosition = ChartView.Position.Right
ChartView1.Freeze = False
ChartView1.StartAnimation(True, ChartAnimate.kEaseOutBounce)
ChartView1.Redisplay
End Sub
[/code]