Anybody know how edit text in X-Axis and Y-Axis in a chart whith ADO recordset.
Basically, when change data
Thank
Felipe
Printable View
Anybody know how edit text in X-Axis and Y-Axis in a chart whith ADO recordset.
Basically, when change data
Thank
Felipe
Chris, I need edit the row/column label
Thank
fdelpuerto, I posted the code that I wrote sometimes ago in my reporting application. You juz need to look at the syntax that containt the .ColumnLabel and .RowLabel will do :)
regards,VB Code:
'Get the X-Axis component. Graph_SQL = "SELECT Avg_Call, F_Description FROM REPORT;" Set R_GraphRs = GraphDb.OpenRecordset(Graph_SQL, dbOpenSnapshot) R_GraphRs.MoveLast R_GraphRs.MoveFirst 'Generate the default Graph... With MSChart1 .chartType = 1 .ColumnCount = R_GraphRs.RecordCount .RowCount = 1 .ColumnLabelCount = .ColumnCount .RowLabelCount = .RowCount For column = 1 To .ColumnCount 'Check 4 UserAbort DoEvents If UserAbort% = 1 Then GoTo Process_Abort For row = 1 To .RowCount 'Check 4 UserAbort DoEvents If UserAbort% = 1 Then GoTo Process_Abort .column = column .row = row .Data = R_GraphRs!Avg_Call 'Save the respective data into the column label... .ColumnLabel = R_GraphRs!F_Description .RowLabel = " " Next row R_GraphRs.MoveNext Next column 'Close the recordset R_GraphRs.Close Set R_GraphRs = Nothing ' Use the chart as the backdrop of the legend. Select Case G_Mode Case "1000" 'Daily .TitleText = Get_GraphTitle("Daily Top 5 Fault Analysis Graph", frmRptMain.txtStartDate.Text) Case "0100" 'Weekly .TitleText = Get_GraphTitle("Weekly Top 5 Fault Analysis Graph", frmRptMain.txtStartDate.Text & "-" & frmRptMain.txtEndDate.Text) Case "0010" 'Monthly .TitleText = Get_GraphTitle("Monthly Top 5 Fault Analysis Graph", frmRptMain.cboMonth.Text & " of " & Trim(frmRptMain.cboYear.Text)) Case "0001" 'Yearly .TitleText = Get_GraphTitle("Yearly Top 5 Fault Analysis Graph", "Year " & frmRptMain.cboYear.Text) End Select .Plot.Axis(VtChAxisIdY, 1).AxisTitle = "No. Of Fault" .Plot.Axis(VtChAxisIdX, 1).AxisTitle = "" .Plot.Axis(VtChAxisIdZ, 1).AxisTitle = "Fault" End With