Free Support Forum -

HowTo set "number of categories between tick-mark labels"

Can this be done now ?

Below is old posts from 2004 I found..

QUESTION : I have a chart in an excel template that I fill with data. In excel there is an option called "number of categories between tick-mark labels", that I want to set within the code to show all entries of my data. Is there a way to do this?

The option in excel is format axis -> number of categories between tick-mark labels.

REPLY: Aspose.Cells doesn't support to change old chart in template files. If you create chart at run time, please try to use chart.CategoryAxis.AxisBetweenCategories property.

RESPONSE: thanks for your quick feedback. don't know if you got my problem. but in the meantime I found out, that one of the new versions considers the option I can adjust in excel. I will test it. But thanks anyway for the detailed answer.


Thanks for considering Aspose.

Aspose.Cells now supports to manipulate designer charts. Please try the latest version and utilize the following sample code:

Workbook workbook = new Workbook();
//Get the second worksheet which contains chart.
Worksheet sheet = workbook.Worksheets[1];
Chart chart = sheet.Charts[0];
//Set properties of categoryaxis.
chart.CategoryAxis.TickLabelSpacing = 2;
Thank you.