How to fetch primary and secondary axes label in charts?

I want to get primary and secondary axes from chart. Is there any way I can fetch it?
I have attached a chart image for reference.
img.JPG (19.0 KB)


can you please help me with this


Thanks for the screenshot.

See the following sample code to get axis’s labels from a chart:
Sample code:

Chart chart1 = worksheet.getCharts().get(0);
for (int k = 0; k < chart1.getValueAxis().getAxisLabels().size(); k++)

Also, to get axis labels from secondary axis, you may try to use, e.g., chart1.getSecondValueAxis().getAxisLabels()

Hope, this helps a bit.


Thanks for the sample code and I am able to fetch the axis lables.
Thank You


Good to know that the suggested code segment works for your needs. Feel free to write us back if you have further queries or comments.