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

Free Support Forum - aspose.com

Slides chart markerfill property

Hello,


I am contacting you to let you know that the MarkerFill under the ChartSeriesEx object is null and is not able to set the marker fill type and color. My company needs this ability. Is there a work around that I can use to do this with Aspose.Net or is this something that should be implemented very soon? For your testing purposes I am using Microsoft Visual Studios 2008 Version 3.5 with SP1 and C# .Net. Also I am using the latest Aspose.Slides.

Thank you for your quick response,

Dustin

Hi Dustin,


Thanks for your interest in Aspose.Slides.

I have tried to understand the issue shared by you but unfortunately unable to completely understand the requirements shared. It will be really appreciable if you may please share the sample project code along with issue elaboration.

Many Thanks,

Here is the sample code:


PresentationEx pres = new PresentationEx();

SlideEx slide = pres.Slides[0];

//Creating the default chart
ChartEx chart = slide.Shapes.AddChart(ChartTypeEx.ScatterWithSmoothLines, 0, 0, 400, 400);

//Getting the default chart data worksheet index
int defaultWorksheetIndex = 0;

//Accessing the chart data worksheet
ChartDataCellFactory fact = chart.ChartData.ChartDataCellFactory;

//Delete demo series
chart.ChartData.Series.Clear();

//add new series
chart.ChartData.Series.Add(fact.GetCell(defaultWorksheetIndex, 1, 1, “Series 1”), chart.Type);
chart.ChartData.Series.Add(fact.GetCell(defaultWorksheetIndex, 1, 3, “Series 2”), chart.Type);

// Take first chart series
ChartSeriesEx series = chart.ChartData.Series[0];

// add new point (1:3) there.
series.XValues.Add(fact.GetCell(defaultWorksheetIndex, 2, 1, 1));
series.YValues.Add(fact.GetCell(defaultWorksheetIndex, 2, 2, 3));

// add new point (2:10)
series.XValues.Add(fact.GetCell(defaultWorksheetIndex, 3, 1, 2));
series.YValues.Add(fact.GetCell(defaultWorksheetIndex, 3, 2, 10));

//Edit the type of series
series.Type = ChartTypeEx.ScatterWithStraightLinesAndMarkers;

//Changing the chart series marker
series.MarkerFill.Fill.FillType = FillTypeEx.Solid;
series.MarkerFill.Fill.SolidFillColor.Color = Color.Chocolate;
series.MarkerSize = 10;
series.MarkerSymbol = MarkerStyleTypeEx.Star;

//Take second chart series
series = chart.ChartData.Series[1];

// add new point (5:2) there.
series.XValues.Add(fact.GetCell(defaultWorksheetIndex, 2, 3, 5));
series.YValues.Add(fact.GetCell(defaultWorksheetIndex, 2, 4, 2));

// add new point (3:1)
series.XValues.Add(fact.GetCell(defaultWorksheetIndex, 3, 3, 3));
series.YValues.Add(fact.GetCell(defaultWorksheetIndex, 3, 4, 1));

// Add new point (2:2)
series.XValues.Add(fact.GetCell(defaultWorksheetIndex, 4, 3, 2));
series.YValues.Add(fact.GetCell(defaultWorksheetIndex, 4, 4, 2));

// Add new point (5:1)
series.XValues.Add(fact.GetCell(defaultWorksheetIndex, 5, 3, 5));
series.YValues.Add(fact.GetCell(defaultWorksheetIndex, 5, 4, 1));

//Changing the chart series marker
series.MarkerFill.Fill.FillType = FillTypeEx.Solid;
series.MarkerFill.Fill.SolidFillColor.Color = Color.Blue;
series.MarkerSize = 10;
series.MarkerSymbol = MarkerStyleTypeEx.Circle;

pres.Write(“AsposeSeriesChart.pptx”);

The error is at this line: series.MarkerFill.Fill.FillType = FillTypeEx.Solid;

It is a NullReferenceException and states: Object reference not set to an instance of an object.

Thank you,

Dustin

Hi Dustin,


I have worked with the code snippet shared by you and have been able to observe the issue specified. The issue arise when you try to access the series MarkFill property as it returns null. An issue with ID 32403 has been created in our issue tracking system to further investigate and resolve the issue. We will share further information with you as soon as the issue is resolved. Meanwhile, you may rely on the default values set for the chart series markers.

We are sorry for your inconvenience,

Is there any update on this?

Hi Dustin,


I have discussed the issue with our development team and we are very hopeful to provide the fix for this issue in Aspose.slides for .NET 5.9.0, which is scheduled for delivery during last week of January, 2012.

Many Thanks,

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


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