Free Support Forum - aspose.com

Issue in manually updating the chart data in MSO chart

Hi,

I am updating a chart by below code.

But the issue I am getting is, if the user wants to update the chart data manually in the updated presentation file, e.g., updating any data, add/remove/edit the series or category, it is not reflecting in the chart.

Kindly help me.

//Instantiate PresentationEx class that represents PPTX file
PresentationEx pres = new PresentationEx(“D:\AsposeChart.pptx”);

//Access first slide
SlideEx sld = pres.Slides[0];

// Add chart with default data
ChartEx chart = (ChartEx)sld.Shapes[0];

//Setting the index of chart data sheet
int defaultWorksheetIndex = 0;

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

//DataTable dt = GetDataTable(chart.Type.ToString());

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

//Now updating series data
fact.GetCell(defaultWorksheetIndex, 0, 1, “New_Series1”);//modifying series name
series.Values[0].Value = 0.90;
series.Values[1].Value = 0.123;
series.Values[2].Value = 0.44;

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

//Now updating series data
fact.GetCell(defaultWorksheetIndex, 0, 2, “New_Series2”);//modifying series name
series.Values[0].Value = 0.23;
series.Values[1].Value = 0.67;
series.Values[2].Value = 0.99;

//Now, Adding a new series
chart.ChartData.Series.Add(fact.GetCell(defaultWorksheetIndex, 0, 3, “Series 3”), chart.Type);

//Take 3rd chart series
series = chart.ChartData.Series[2];

//Now populating series data
series.Values.Add(fact.GetCell(defaultWorksheetIndex, 1, 3, 0.20));
series.Values.Add(fact.GetCell(defaultWorksheetIndex, 2, 3, 0.50));
series.Values.Add(fact.GetCell(defaultWorksheetIndex, 3, 3, 0.30));

chart.Type = ChartTypeEx.ClusteredCylinder;

// Save presentation with chart
pres.Write(@“D:\AsposeChartMoodified.pptx”);

Thanks,
Laxmikanta

Hi Laxmikanta,


Please try using Aspose.Slides for .NET 6.9.0 on your end. The mentioned issue has been resolved in it.

Many Thanks,

Hi Mudassir,

By using the Aspose.Slides for .NET 6.9.0, the chart is getting updating after the data change. But how to add a new series or category to the chart manually. How to re-size the chart data range? I am not getting the range of the updated chart.

Thanks,
Laxmikanta

Hi Laxmikanta,


I have verified addition of new series and categories using PowerPoint 2010 in Aspose.Slides generated/edited chart and it works fine. Actually,this requirement is out side scope of Aspose.Slides support and you may search over the internet for any video tutorial or web link to see how to modify chart data in PowerPoint. I have found some links that may help you. Please use them and if there is any issue related to Aspose.Slides, you are always more than welcome for this.

http://office.microsoft.com/en-001/powerpoint-help/change-the-data-in-an-existing-chart-HA010338374.aspx
http://www.youtube.com/watch?v=7fkPfrxJc8I

Many Thanks,

Hi Mudassir,

I am elaborating the issue.

Step 1:
By Microsoft Office 2010, if we create a MSO chart and right click and edit data we can see a excel sheet where “To resize chart data range, drag lower right corner of range.” is written below of chart data and a blue line is selecting the chart data range, so we can drag lower right corner of range.

But after modifying the chart by Aspose, that blue line, which should select the chart data range is missing. If so what is the meaning of writing “To resize chart data range, drag lower right corner of range.”

Step 2:
By Microsoft Office 2010, if we create a MSO chart and right click and edit data we can see a excel sheet. In the excel sheet we can add data next to the selected data range(marking by the blue line), the data range automatically added.

This feature I am not getting after updating the chart by Aspose. If so what is the meaning of writing "To resize chart data range, drag lower right corner of range."

For more detail look at the attached image.

Thanks,
Laxmikanta

Hi Laxmikanta,


I have observed your requirement and agree that drag and resize chart feature gets missing in updated chart. I have created an issue with ID SLIDESNET-33853 in our issue tracking system to further investigate and provide the feature support. For the time being, I have shared the alternate approach that you can use for adding new categories and series or even updating existing ones. Hopefully, this will help for you.

We will share the further information with you as soon as the feature will be available.

We are sorry for your inconvenience,

Hi,

Any updates in SLIDESNET-33853 ???

Hi Laxmikanta,


I have verified from our issue tracking system and regret too share that the issue has not yet been scheduled. However, I have requested our development team to kindly schedule the issue if there is allocation available in Active issues queue list for Aspose.Slides forum related issues.

Many Thanks,

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


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