Results 1 to 3 of 3

Thread: how edit X and Y axis text (MSchart)

  1. #1
    fdelpuerto
    Guest

    Question how edit X and Y axis text (MSchart)

    Anybody know how edit text in X-Axis and Y-Axis in a chart whith ADO recordset.

    Basically, when change data

    Thank

    Felipe

  2. #2
    fdelpuerto
    Guest

    row/column label

    Chris, I need edit the row/column label

    Thank

  3. #3
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    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

    VB Code:
    1. 'Get the X-Axis component.
    2.     Graph_SQL = "SELECT Avg_Call, F_Description FROM REPORT;"
    3.     Set R_GraphRs = GraphDb.OpenRecordset(Graph_SQL, dbOpenSnapshot)
    4.     R_GraphRs.MoveLast
    5.     R_GraphRs.MoveFirst
    6.    
    7.     'Generate the default Graph...
    8.     With MSChart1
    9.         .chartType = 1
    10.         .ColumnCount = R_GraphRs.RecordCount
    11.         .RowCount = 1
    12.         .ColumnLabelCount = .ColumnCount
    13.         .RowLabelCount = .RowCount
    14.         For column = 1 To .ColumnCount
    15.             'Check 4 UserAbort
    16.             DoEvents
    17.             If UserAbort% = 1 Then GoTo Process_Abort
    18.            
    19.             For row = 1 To .RowCount
    20.                 'Check 4 UserAbort
    21.                 DoEvents
    22.                 If UserAbort% = 1 Then GoTo Process_Abort
    23.            
    24.                 .column = column
    25.                 .row = row
    26.                 .Data = R_GraphRs!Avg_Call
    27.                
    28.                 'Save the respective data into the column label...
    29.                 .ColumnLabel = R_GraphRs!F_Description
    30.                 .RowLabel = " "
    31.             Next row
    32.             R_GraphRs.MoveNext
    33.         Next column
    34.        
    35.         'Close the recordset
    36.         R_GraphRs.Close
    37.         Set R_GraphRs = Nothing
    38.        
    39.         ' Use the chart as the backdrop of the legend.
    40.         Select Case G_Mode
    41.         Case "1000" 'Daily
    42.             .TitleText = Get_GraphTitle("Daily Top 5 Fault Analysis Graph", frmRptMain.txtStartDate.Text)
    43.         Case "0100" 'Weekly
    44.             .TitleText = Get_GraphTitle("Weekly Top 5 Fault Analysis Graph", frmRptMain.txtStartDate.Text & "-" & frmRptMain.txtEndDate.Text)
    45.         Case "0010" 'Monthly
    46.             .TitleText = Get_GraphTitle("Monthly Top 5 Fault Analysis Graph", frmRptMain.cboMonth.Text & " of " & Trim(frmRptMain.cboYear.Text))
    47.         Case "0001" 'Yearly
    48.             .TitleText = Get_GraphTitle("Yearly Top 5 Fault Analysis Graph", "Year " & frmRptMain.cboYear.Text)
    49.         End Select
    50.         .Plot.Axis(VtChAxisIdY, 1).AxisTitle = "No. Of Fault"
    51.         .Plot.Axis(VtChAxisIdX, 1).AxisTitle = ""
    52.         .Plot.Axis(VtChAxisIdZ, 1).AxisTitle = "Fault"
    53.        
    54.     End With
    regards,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width