Determine which Axis exists in the Chart

Determine which Axis exists in the Chart

The following screenshot shows a chart that has only the Primary Category and Value Axis. It does not have any Secondary Category and Value Axis.

todo:image_alt_text

The following sample code demonstrates the use of Chart.hasAxis(int axisType, boolean isPrimary) to determine if the sample chart has Primary and Secondary Category and Value Axis. The console output of the code has been shown below which displays true for Primary Category and Value Axis and false for Secondary Category and Value Axis.

Java code to determine which axis exist in the chart

Console output generated by the sample code

Here is the Console Output of the above Sample Code.

Has Primary Category Axis: true

Has Secondary Category Axis: false

Has Primary Value Axis: true

Has Secondary Value Axis: false