public interface AxisCollection :
Public Interface AxisCollection
Inherits ISimpleCollection(Of Axis),
The AxisCollection is generated automatically when creating a chart and depends on the chart type. Most charts have two primary axes: the category axis (X-axis) and the value axis (Y-axis). 3-D charts also have the depth (or series) axis along which the series names are displayed. The bubble and scatter charts have two value axis, while the pie and doughnut charts have no axes at all.
To access a collection of primary axes, use the ChartObject.PrimaryAxes property. You can get an individual axis defined by the Axis object by its index in the collection. The category axis is the first item in the axis collection with the index 0, the value axis is the second item with the index 1, and the series axis (if it is presented) is the third item with the index 2.
A chart may also have a collection of secondary axes accessible via the ChartObject.SecondaryAxes property. This collection includes two items: the secondary category axis with the index 0 and the secondary value axis with index 1. To display secondary axes for a specific series, set the Series.AxisGroup property to the AxisGroup.Secondary value.
Dim worksheet As Worksheet = workbook.Worksheets("chartTask3")
workbook.Worksheets.ActiveWorksheet = worksheet
' Create a chart and specify its location.
Dim chart As Chart = worksheet.Charts.Add(ChartType.ColumnClustered, worksheet("B3:C5"))
chart.TopLeftCell = worksheet.Cells("H2")
chart.BottomRightCell = worksheet.Cells("N14")
' Format the axis labels.
Dim axis As Axis = chart.PrimaryAxes(1)
axis.NumberFormat.FormatCode = "0%"
axis.NumberFormat.IsSourceLinked = False
' Hide the legend.
chart.Legend.Visible = False
Worksheet worksheet = workbook.Worksheets["chartTask3"];
workbook.Worksheets.ActiveWorksheet = worksheet;
// Create a chart and specify its location.
Chart chart = worksheet.Charts.Add(ChartType.ColumnClustered, worksheet["B3:C5"]);
chart.TopLeftCell = worksheet.Cells["H2"];
chart.BottomRightCell = worksheet.Cells["N14"];
// Format the axis labels.
Axis axis = chart.PrimaryAxes;
axis.NumberFormat.FormatCode = "0%";
axis.NumberFormat.IsSourceLinked = false;
// Hide the legend.
chart.Legend.Visible = false;