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)

@Amjad_Sahi

can you please help me with this

@vbAspose,

Thanks for the screenshot.

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

...........
Chart chart1 = worksheet.getCharts().get(0);
chart1.calculate();
for (int k = 0; k < chart1.getValueAxis().getAxisLabels().size(); k++)
{
	System.out.println(chart1.getValueAxis().getAxisLabels().get(k));
} 
.......

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

Hope, this helps a bit.

@Amjad_Sahi

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

@vbAspose,

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.