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

Free Support Forum - aspose.com

How to set font for chart value and category axis


I was wondering whether I am able to set font for the chart axises, I couldn’t find the font property from Aspose.Cells.Chart.ValueAxis.



Please see the following code snippets on how to set font attributes for tick labels and title for value axis/ category axis for your reference:
Sample code:

//Set Properties of CategoryAxis labels.
chart.ValueAxis.TickLabels.Font.Size = 8;
chart.ValueAxis.TickLabels.Font.Name = “Arial”;

//Set Properties of categoryaxis title
chart.CategoryAxis.Title.Text = “Project”;

chart.CategoryAxis.Title.Font.Color = Color.Black;

chart.CategoryAxis.Title.Font.IsBold = true;

chart.CategoryAxis.Title.Font.Size = 10;

Hope, this helps a bit.

Thank you.