We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Axis tick label spacing

Using latest version.


The tick label spacing method doesn’t seem to do anything:

public static void main(String[] args) throws Exception {
final Presentation pres = new Presentation();
final IChart c = pres.getSlides()
.get_Item(0)
.getShapes()
.addChart(
ChartType.ClusteredColumn,
0, 0, 720, 540);
c.getAxes().getHorizontalAxis().setTickLabelSpacing(2);
pres.save(“D:/test.pptx”, SaveFormat.Pptx);
Desktop.getDesktop().open(new File(“D:/test.pptx”));
}

In this example it does not change from 1 to 2 (output attached).

I have another example where the automatic value is 2 but I want it to be 1.

In both cases calling setTickLabelSpacing() doesn’t seem to do anything. Any advice?

Thanks.

Hi Shaun,


Thank you for your growing interest in Aspose.Slides.

I have observed your comments and worked with the code shared by you. I have made necessary changes in your code and I request you to please try using following sample code on your end to serve the purpose.

final Presentation pres = new Presentation();
final IChart c = pres.getSlides()
.get_Item(0)
.getShapes()
.addChart(
ChartType.ClusteredColumn,
0, 0, 720, 540);
c.getAxes().getHorizontalAxis().isAutomaticTickLabelSpacing(false);
c.getAxes().getHorizontalAxis().setTickLabelSpacing(2);
pres.save(“D://test.pptx”, SaveFormat.Pptx);
Desktop.getDesktop().open(new File(“D:/test.pptx”));

I hope this will be helpful. Please share if I may help you further in this regard.

Best Regards,

That worked. Thanks!

Hi Shaun,


Thank you for sharing your valuable feedback.

We are glad to know that things have started working on your end. Please feel free to contact us if we could be of any help to you.

Best Regards,