Free Support Forum - aspose.com

How to set the font styles to the TickLabels of the ValueAxis or CategoryAxis in MSO Chart

Hi,

How to set the font styles to the TickLabels of the ValueAxis or the CategoryAxis in MSO Chart?

Like in case of OLE chart we are writing the below code:
chart.Legend.Area.Formatting = FormattingType.Custom;
chart.Legend.Font.Size = 11;
chart.Legend.Area.FillFormat.Type = Aspose.Cells.Drawing.FillType.None;
chart.SeriesAxis.Area.Formatting = FormattingType.Custom;
chart.CategoryAxis.Area.Formatting = FormattingType.Custom;
chart.SeriesAxis.TickLabels.Font.Size = 11;
chart.CategoryAxis.TickLabels.Font.Size = 11;
chart.ValueAxis.Area.Formatting = FormattingType.Custom;
chart.ValueAxis.TickLabels.Font.Size = 11;
chart.ValueAxis.Area.Formatting = FormattingType.Custom;
chart.ValueAxis.Title.Font.Size = 14;

Thanks,
Laxmikanta

Hi Laxmikanta,


Please use the following code snippet for changing the font related properties for chart value axis tick labels. Please share, if I may help you further in this regard.

public static void MangeVerticalAxis()
{
PresentationEx pres = new PresentationEx();
SlideEx slide = pres.Slides[0];
ChartEx chart = slide.Shapes.AddChart(ChartTypeEx.ClusteredColumn, 50, 50, 500, 400);
TextFrameEx txt2 = chart.ValueAxis.TextProperties;

txt2.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FontBold = NullableBool.True;
txt2.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FontHeight = 20;
txt2.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FontItalic = NullableBool.True;
txt2.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FillFormat.FillType = FillTypeEx.Solid; ;
txt2.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FillFormat.SolidFillColor.Color = Color.Blue;

pres.Write(“D:\Aspose Data\AxisValue.pptx”);

}

Many Thanks,