in my proj i am using a mschart ....
now what i want is i want to display the graph amount v/s months
I did the graph which shows date v/s amount its working good...
i used the sql query for that.... for month also i wrotequery but its not working properly....
what i need is it should add all the amounts which are entered in the particular dates on that month then it show the graph...
plz if u know that send me the answer
and my code is like this, this is for dates.......
Private Sub cmdGraph_Click()
' Close the record set if open
If rst.State <> adStateClosed Then
Set cmd.ActiveConnection = cnn
cmd.CommandText = "SELECT Table1.TodayDate, Table1.Amount, Table1.Description" _
& " FROM Table1" _
& " Where Table1.TodayDate >= #" & txtFromDate.Text & "#" _
& " And Table1.TodayDate <= #" & txtToDate.Text & "#" _
& " ORDER BY Table1.TodayDate"
rst.CursorLocation = adUseClient
rst.Open cmd, , adOpenStatic, adLockBatchOptimistic
If rst.RecordCount = 0 Then
MsgBox "site does not have any availability data"
' Give the record set to the gird for display
Set grdMonData.Recordset = rst
' C H A R T
' Dynamic 2-dimensional array to store series
' The first index (x) is the total number of series
' The second index will store the Date(1) and its end-to-end time(2).
' x-axis value in the 1st slot (i.e. chrtArray(x,1)
' y-axis value in the 2nd slot (i.e. chrtArray(x,2)
ReDim chrtArray(1 To rst.RecordCount, 1 To 2)
.MSChart1.ShowLegend = True
.MSChart1.ChartType = VtChChartType2dBar
' Chart Title centered on top
.MSChart1.Title.Text = " Expence Details"
' Chart X and Y axis titles
.MSChart1.Plot.Axis(VtChAxisIdX).AxisTitle.Text = "Date"
.MSChart1.Plot.Axis(VtChAxisIdY).AxisTitle.Text = "Amount"
' Chart Foot note
'MSChart1.FootnoteText = "some note"
' Load the array with data
For X = 1 To rst.RecordCount
chrtArray(X, 1) = rst!TodayDate
chrtArray(X, 2) = rst!Amount
' Attach the array of data to MS-CHART
' setup the column lable (the project id)
.MSChart1.ChartData = chrtArray
.MSChart1.ColumnCount = 1
.MSChart1.ColumnLabelCount = 1
.MSChart1.Column = 1