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

Free Support Forum - aspose.com

Charts - SecondValueAxis Title

Hello,

I am trying to create a column chart with two value axis on it, this works well but when I try to add a title to the second value axis I get an 'Object reference not set to instance of an object' error.

See sample code:

ChartEx ch = sld.Shapes.AddChart(Aspose.Slides.Pptx.Charts.ChartTypeEx.Line, 30, 100, 330, 220);


ChartDataCellFactory fact = ch.ChartData.ChartDataCellFactory;
ch.ChartData.Series.Clear();
ch.ChartData.Categories.Clear();


int[] series1Data = new int[] { 1, 1, 1, 1 };
int[] series2Data = new int[] { 2, 2, 2, 2 };
string[] categoryLabels = new string[] { "A", "B", "C", "D" };


ChartSeriesEx series1 = ch.ChartData.Series[ch.ChartData.Series.Add(fact.GetCell(0, 0, 1, "series 1"), ChartTypeEx.ClusteredColumn)];
for (int i = 0; i < series1Data.Length; i++)
series1.Values.Add(fact.GetCell(0, (i + 1), 1, series1Data[i]));


ChartSeriesEx series2 = ch.ChartData.Series[ch.ChartData.Series.Add(fact.GetCell(0, 0, 2, "series 2"), ChartTypeEx.Line)];
for (int i = 0; i < series2Data.Length; i++)
series2.Values.Add(fact.GetCell(0, (i + 1), 2, series2Data[i]));


for (int i = 0; i < categoryLabels.Length; i++)
ch.ChartData.Categories.Add(fact.GetCell(0, (i + 1), 0, categoryLabels[i]));


ch.SecondValueAxis.IsVisible = true;
series2.PlotOnSecondAxis = true;
ch.ValueAxis.HasTitle = true;
ch.ValueAxis.TextProperties.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FontHeight = 10;
ch.ValueAxis.Title.Text.Text = "series 1";
ch.ValueAxis.Title.Text.Paragraphs[0].Portions[0].PortionFormat.FontHeight = 8;

// --- CODE THAT PRODUCES ERROR ---
ch.SecondValueAxis.HasTitle = true;
ch.SecondValueAxis.TextProperties.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FontHeight = 10;
ch.SecondValueAxis.Title.Text.Text = "series 2";
ch.SecondValueAxis.Title.Text.Paragraphs[0].Portions[0].PortionFormat.FontHeight = 8;
// --- END ---

ch.CategoryAxis.TextProperties.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FontHeight = 8;

Hi Neil,


I have worked with the sample code shared and have been able to reproduce the issue specified. An issue with ID SLIDESNET-34192 has been created in our issue tracking system to further 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.

We are sorry for your inconvenience,

Hi,

Has this issue been resolved yet?

Thanks,

Neil

Hi Neil,

I am afraid, your reported issue is still not resolved. However, I have requested the development team to share the details and ETA regarding the resolution of the issue and as soon as that information is shared by them, I will update you via this forum thread.

Thanks & Regards,

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


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
(3)