ColumnLabel Property Example

The example adds three column labels to the z axis of a chart. To try the example, draw an MSChart control on a form. Paste the code into the Form object's code module, and run the project. Click the form to see the labels.

Option Explicit
Option Base 1

Private Sub Form_Click()
   With MSChart1
      .chartType = VtChChartType3dLine
   
      .Plot.Axis(VtChAxisIdZ).Labels(1).VtFont.Size = 24
      .DataGrid.ColumnLabel(1, 1) = "Label Z1"
      .DataGrid.ColumnLabel(2, 1) = "Label Z2"
      .DataGrid.ColumnLabel(3, 1) = "Label Z3"
   End With
End Sub

Private Sub Form_Load()
   ' The first series contains labels for the X axis.
   Dim arrData(4, 1 To 4)
   arrData(1, 1) = "Jan"
   arrData(2, 1) = "Feb"
   arrData(3, 1) = "Mar"
   arrData(4, 1) = "Apr"
   
   arrData(1, 2) = 8
   arrData(2, 2) = 4
   arrData(3, 2) = 0.3
   arrData(4, 2) = 3
   
   arrData(1, 3) = 0.2
   arrData(2, 3) = 3
   arrData(3, 3) = 6.3
   arrData(4, 3) = 2
   
   arrData(1, 4) = 5
   arrData(2, 4) = 7
   arrData(3, 4) = 2
   arrData(4, 4) = 9
   MSChart1.ChartData = arrData
End Sub