Spire.Presentation is a professional PowerPoint® compatible library that enables developers to create, read, write, modify, convert and Print PowerPoint documents. Get free and professional technical support for Spire.Presentation for .NET, Java, Android, C++, Python.
Mon May 04, 2020 4:23 pm
Hi all,
I have a PowerPoint with various charts, using it as template.
I can successfully replace data from a Line Chart. Now I need to do the same with a Waterfall Chart.
I know that currently this type of chart is not supported: I've tried to cast the IShape object as IChart but an InvalidCastException was thrown.
So, can I extend IChart for trying to access to 'chart.Categories' and 'chart.Series'? Is there any way to do this?
Thank you
-
Gsergi2020
-
- Posts: 3
- Joined: Mon Apr 27, 2020 12:34 pm
Tue May 05, 2020 2:38 am
Hello,
Thanks for your inquiry.
Yes, our Spire.Presentation doesn't support Waterfall Chart yet. In fact, our product currently handls it as a SlidePicture object. Sorry there is no way to access to 'chart.Categories' and 'chart.Series' of the Waterfall Chart. However, we are considering supporting this type of chart in future upgrades. If there is any good news, we will inform you asap.
Sincerely,
Rachel
E-iceblue support team
-
rachel.lei
-
- Posts: 1571
- Joined: Tue Jul 09, 2019 2:22 am
Tue May 05, 2020 6:18 am
Thank you Rachel for your quick answer.
I think that supporting Waterfall Chart can be a plus for your library. It will simplify my work.
-
Gsergi2020
-
- Posts: 3
- Joined: Mon Apr 27, 2020 12:34 pm
Tue May 05, 2020 7:38 am
Hello,
Thanks for your reply.
Ok, once there is any update regarding support for Waterfall Chart, I will let you know immediately.
Have a nice day!
Sincerely,
Rachel
E-iceblue support team
-
rachel.lei
-
- Posts: 1571
- Joined: Tue Jul 09, 2019 2:22 am
Tue May 12, 2020 9:41 am
Hello,
Hope you are doing well.
Now our Dev team is investigating the new feature that supports waterfall charts. In order to ensure that this feature can work perfectly for you, I want to confirm with you whether you have other needs besides modifying the data of the waterfall chart, such as creating waterfall chart and converting waterfall chart to images, etc.
Looking forward to your response.
Sincerely,
Rachel
E-iceblue support team
-
rachel.lei
-
- Posts: 1571
- Joined: Tue Jul 09, 2019 2:22 am
Mon May 25, 2020 10:16 am
Hi Rachel,
our current needs is to replace data of an existing waterfall chart and, in secondly of importance, to create new waterfall chart from zero.
-
Gsergi2020
-
- Posts: 3
- Joined: Mon Apr 27, 2020 12:34 pm
Tue May 26, 2020 1:19 am
Hello,
Thanks for your response.
I will forward this information to our Dev team. Once there is any good news, we will notify you ASAP.
Sincerely,
Rachel
E-iceblue support team
-
rachel.lei
-
- Posts: 1571
- Joined: Tue Jul 09, 2019 2:22 am
Fri Jan 21, 2022 9:24 am
Hello,
Thanks for your patience!
Glad to inform you that we just released Spire.Presentation Pack Version:7.1 which supports creating and reading waterfall charts.
Please download the fix version from the following links and the following code to test.
Website link:
https://www.e-iceblue.com/Download/download-presentation-for-net-now.htmlNuget link:
https://www.nuget.org/packages/Spire.Presentation/7.1.0- Code: Select all
Presentation ppt = new Presentation();
IChart chart = ppt.Slides[0].Shapes.AppendChart(ChartType.WaterFall, new RectangleF(50, 50, 500, 400), false);
chart.ChartData[0, 1].Text = "Series 1";
string[] categories = { "Category 1", "Category 2", "Category 3", "Category 4", "Category 5", "Category 6", "Category 7" };
for (int i = 0; i < categories.Length; i++)
{
chart.ChartData[i + 1, 0].Text = categories[i];
}
double[] values = { 100, 20, 50, -40, 130, -60, 70 };
for (int i = 0; i < values.Length; i++)
{
chart.ChartData[i + 1, 1].NumberValue = values[i];
}
chart.Series.SeriesLabel = chart.ChartData[0, 1, 0, 1];
chart.Categories.CategoryLabels = chart.ChartData[1, 0, categories.Length, 0];
chart.Series[0].Values = chart.ChartData[1, 1, values.Length, 1];
ChartDataPoint chartDataPoint = new ChartDataPoint(chart.Series[0]);
chartDataPoint.Index = 2;
chartDataPoint.SetAsTotal = true;
chart.Series[0].DataPoints.Add(chartDataPoint);
ChartDataPoint chartDataPoint2 = new ChartDataPoint(chart.Series[0]);
chartDataPoint2.Index = 5;
chartDataPoint2.SetAsTotal = true;
chart.Series[0].DataPoints.Add(chartDataPoint2);
chart.Series[0].ShowConnectorLines = true;
chart.Series[0].DataLabels.LabelValueVisible = true;
chart.ChartLegend.Position = ChartLegendPositionType.Right;
chart.ChartTitle.TextProperties.Text = "WaterFall";
ppt.SaveToFile(outputFile, FileFormat.PPT);
ppt.Dispose();
Sincerely,
Marcia
E-iceblue support team
-
Marcia.Zhou
-
- Posts: 858
- Joined: Wed Nov 04, 2020 2:29 am