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

Free Support Forum - aspose.com

Set the axis line color doesn't work

Hi,

Since I have 2 axis, I would like to set the color of the axis line, but it doesn't work
The following code produces red gridline but the axis line stays black


ch.ValueAxis.MajorGridLines.FillFormat.FillType = FillTypeEx.Solid;

ch.ValueAxis.MajorGridLines.FillFormat.SolidFillColor.Color = Color.Red;

ch.ValueAxis.AxisLine.FillFormat.FillType = FillTypeEx.Solid;

ch.ValueAxis.AxisLine.FillFormat.SolidFillColor.Color = Color.Red;

Regards,
Moshe

Hi Moshe,


I have observed the requirements shared by you. Please use the sample code shared below that will enable you to format different chart entities including major and minor axis of value and category axis. Please share, if I may help you further in this regard.

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

chart.ValueAxis.MajorGridLines.FillFormat.FillType = FillTypeEx.Solid;
chart.ValueAxis.MajorGridLines.FillFormat.SolidFillColor.Color = Color.Blue;
chart.ValueAxis.MajorGridLines.Width = 5;

chart.ValueAxis.MinorGridLines.FillFormat.FillType = FillTypeEx.Solid;
chart.ValueAxis.MinorGridLines.FillFormat.SolidFillColor.Color = Color.Red;
chart.ValueAxis.MinorGridLines.Width = 5;

chart.CategoryAxis.MajorGridLines.FillFormat.FillType = FillTypeEx.Solid;
chart.CategoryAxis.MajorGridLines.FillFormat.SolidFillColor.Color = Color.Green;
chart.CategoryAxis.MajorGridLines.Width = 3;

chart.CategoryAxis.MinorGridLines.FillFormat.FillType = FillTypeEx.Solid;
chart.CategoryAxis.MinorGridLines.FillFormat.SolidFillColor.Color = Color.Yellow;
chart.CategoryAxis.MinorGridLines.Width = 3;



TextFrameEx txt = chart.CategoryAxis.TextProperties;

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

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;


TextFrameEx txt3 = chart.Legend.TextProperties;
txt3.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FontBold = NullableBool.True;
txt3.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FontHeight = 20;
txt3.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FontItalic = NullableBool.True;
txt3.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FillFormat.FillType = FillTypeEx.Solid; ;
txt3.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FillFormat.SolidFillColor.Color = Color.Blue;
pres.Write(“D:\Aspose Data\AxisValue.pptx”);

}

Many Thanks,

Your example sets the color for everything beside what I was asking for.
I would like to set the color of the vertical axis line (see arrow in attachment)
It seems that this should do it :

chart.ValueAxis.AxisLine.FillFormat.SolidFillColor.Color = Color.Red;

Regards,
Moshe

Hi Moshe,


I have worked over the feature requested and like to share that it seems to be an issue in Aspose.Slides while setting the axis line format. An issue with ID SLIDESNET-33755 has been created in our issue tracking system to furhter investigate and resolve the issue. This thread has been linked with the issue so that you may be automatically notified once the issue will be resolved.

The following code snippet in my opinion should work.

chart.ValueAxis.AxisLine.Width=10;
chart.ValueAxis.AxisLine.FillFormat.FillType = FillTypeEx.Solid;
chart.ValueAxis.AxisLine.FillFormat.SolidFillColor.Color = Color.Red;


We are sorry for your inconvenience,

Hi Moshe,


Please try using the following sample code to serve the purpose. Please share if I may help you further in this regard.

chart.ValueAxis.Format.Line.FillFormat.FillType = FillTypeEx.Solid;
chart.ValueAxis.Format.Line.FillFormat.SolidFillColor.Color = Color.Blue;
chart.ValueAxis.Format.Line.Width = 10;

Many Thanks,

The issues you have found earlier (filed as SLIDESNET-33755) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.