private Sub Chart_Source As ChartData
Dim Data As ChartData
Dim RS As ResultSet
Data.Months = Functions.Get_MonthNames
Data.Amounts = Array As Float(0,0,0,0,0,0,0,0,0,0,0,0)
Data.Liters = Array As Float(0,0,0,0,0,0,0,0,0,0,0,0)
RS = Functions.SQLConn.ExecQuery("SELECT strftime('%m',Date) as Month, Sum(Amount), Sum(Liters) FROM Refuelings WHERE VehicleId = " & PageParams(0) & _
" AND strftime('%Y',Date) = '" & RefuelingsYear & "' GROUP BY Month ORDER BY Month DESC")
For i = 0 To (RS.RowCount-1)
RS.Position = i
Data.Amounts(RS.GetInt("Month")-1) = RS.GetDouble("Amounts").As(Float)
Data.Liters(RS.GetInt("Month")-1) = RS.GetDouble("Liters").As(Float)
Next
Set_PageHeader
Return Data
End Sub