How to set font for chart value and category axis

Hi,

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.

Thanks,
Wei

Hi,


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:
e.g
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.