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

Free Support Forum - aspose.com

Custom names for Y-axis in Bar Chart


We are generated the Bar Charts using Aspose.Cells component and here I have attached one of the sample chart. I have two questions on attached chart image. Could you please provide your suggestions/feasibility of those?

  • When generating the graph, the data bounded values are 10,25, 50, 75 and 100. But the chart’s Y-axis showing values from 10 to 100 (10,20,30,40, etc.). Is there anyway we can fix the chart’s Y-axis values with only 10, 25, 50, 75 and 100?
  • I want to show the Y-axis values as Strings instead of Integers. Like, 10 should show as 10(A), 20 should show as 20(B), 30 should show as 30©, 40 should show as 40(D), etc.

Please tell me the possibility of these two on Bar Chart generating!



1) I think you may try to set Axis options for the Category Axis or ValueAxis, e.g
Sample code:

chart.CategoryAxis/ValueAxis.MinValue = 1;
chart.CategoryAxis/ValueAxis.MaxValue = 100;
chart.CategoryAxis/ValueAxis.MajorUnit = 25;
2) Well, the valueaxis or category axis tick labels are rendered based on your source data range, so you got to change the source data range (based on worksheet cells or constant values etc.) for the data series or category data of the chart.

If you still could not evaluate, kindly create your sample desired chart in MS Excel manually, save the file and post us here, we will check it on how to do it via Aspose.Cells APIs.

Thank you.