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 or 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 axes. The console output of the code is shown below, which displays true for the primary category and value axes and false for the secondary category and value axes.

Java code to determine which axes 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