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.

Tue Nov 12, 2024 10:57 pm

Hi,
I am trying to reproduce something similar to what powerpoint does when specifying mixed data type (string and int or double in the same chart data) but what I obtain is a corrupted output.

Is there anyway I can achieve this?

Code to reproduce linked here https://we.tl/t-7y3pjUFPlw

Expected result in attachment picture

Thanks,
Andrea

andreacalvi
 
Posts: 28
Joined: Tue Jul 11, 2023 11:02 am

Wed Nov 13, 2024 10:03 am

Hi,

Thank you for bringing this issue to our attention.
I have logged this issue in our bug tracking system with reference number SPIREPPT-2663. Once our dev team fix this issue, we wiil update you ASAP! Sorry for any inconvenience caused.

Sincerely,
Doris
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 460
Joined: Mon Nov 07, 2022 8:10 am

Fri Jan 24, 2025 6:37 pm

Hi, when will this be fixed. It's a critical ticket for us.

boosted_d16
 
Posts: 50
Joined: Wed Apr 19, 2023 11:41 am

Sun Jan 26, 2025 10:05 am

Hi,

Sorry, the development team made adjustments to this issue before, but unfortunately, it failed the test. I've urged the developers to modify it again.

Sincerely,
Doris
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 460
Joined: Mon Nov 07, 2022 8:10 am

Tue Mar 18, 2025 6:42 pm

When will this be resolved? its been over 4 months.

Hardly any bugs are being resolved recently.

boosted_d16
 
Posts: 50
Joined: Wed Apr 19, 2023 11:41 am

Thu Mar 20, 2025 1:24 am

Hi,

I'm very sorry, but this issue is quite complex. The developers made adjustments that caused additional impacts, so they are still investigating solutions. I have escalated this problem to the highest priority. I will urge the development team to resolve it as soon as possible and keep you updated promptly with any progress.

Sincerely,
Doris
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 460
Joined: Mon Nov 07, 2022 8:10 am

Thu Mar 20, 2025 8:06 am

Hello,

The development team has adjusted this issue again. The issue is about to enter the testing phase. If the testing goes smoothly, we will release the official version.
If you're in urgent need, we can compile a temporary version for your temporary use. Please let us know if you require this.

Sincerely,
Doris
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 460
Joined: Mon Nov 07, 2022 8:10 am

Fri Mar 21, 2025 9:54 am

Sorry I can't use an untested version. But this functionality is critical. If you can push this asap that would be great. If you cannot be resolved then please let me know so I can use another product.

boosted_d16
 
Posts: 50
Joined: Wed Apr 19, 2023 11:41 am

Mon Mar 24, 2025 10:09 am

Hi,

Sorry, there are still some aspects of the new version that need adjustment, so we're unable to release the official version for now. If everything goes smoothly, we expect to release the official version next month. Below is a screenshot of the output file after the development adjustments for your reference.

Sincerely,
Doris
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 460
Joined: Mon Nov 07, 2022 8:10 am

Fri Apr 11, 2025 9:17 am

Hi,

Thank you for your patience.
Glad to inform you we have released Spire.Presentation 10.4.2, which contains the fix of issue SPIREPPT-2663. Please download from the following link to test. If there's any issue, welcome to feedback.

https://www.nuget.org/packages/Spire.Presentation/10.4.2
https://www.nuget.org/packages/Spire.Presentationfor.NETStandard/10.4.2

Sincerely,
Doris
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 460
Joined: Mon Nov 07, 2022 8:10 am

Tue May 06, 2025 5:38 pm

In the code below, these two values are coerced into `0` instead of persisting as "a" in the chart's datarange.

Code: Select all
chart.ChartData[1, 1].Value = "a";
chart.ChartData[4, 2].Value = "a";


I'm guessing its because the slide is being cloned?

input:
test.zip


Full snippet:

Code: Select all
using Spire.Presentation.Charts;
using Spire.Presentation;

Presentation ppt = new Presentation();
ppt.LoadFromFile(@"test.pptx");

var finalPpt = new Presentation();
finalPpt.Slides.RemoveAt(0);
var generatedSlide = ppt.Slides[0];
var chart = generatedSlide.Shapes.ToArray().FirstOrDefault(s => s.Id == 4) as IChart;

chart.ChartData[1, 0].Value = 5;
chart.ChartData[2, 0].Value = "";
chart.ChartData[3, 0].Value = "C3";
chart.ChartData[4, 0].Value = null;
chart.ChartData[5, 0].Value = "C5";
chart.ChartData[6, 0].Value = "C6";

chart.ChartData[0, 1].Value = null;
chart.ChartData[0, 2].Value = "S2";
chart.ChartData[0, 3].Value = "S3";

chart.ChartData[1, 1].Value = "a";
chart.ChartData[1, 2].Value = 0.29;
chart.ChartData[1, 3].Value = 0.23;

chart.ChartData[2, 1].Value = null;
chart.ChartData[2, 3].Value = 0.23;

chart.ChartData[3, 1].Value = "";
chart.ChartData[3, 2].Value = 0.07;
chart.ChartData[3, 3].Value = null;

chart.ChartData[4, 1].Value = null;
chart.ChartData[4, 2].Value = "a";
chart.ChartData[4, 3].Value = 0.21;

chart.ChartData[5, 1].Value = 0.5;
chart.ChartData[5, 2].Value = 0.31;
chart.ChartData[5, 3].Value = "a";

chart.ChartData[6, 1].Value = "a";
chart.ChartData[6, 2].Value = 0.45;
chart.ChartData[6, 3].Value = 0.46;

//chart.Categories.CategoryLabels = chart.ChartData[1, 0, 6, 0];

finalPpt.Slides.Append(generatedSlide);

finalPpt.SaveToFile(@"C:\temp\out.pptx", FileFormat.Pptx2013);

beyeb38077
 
Posts: 14
Joined: Mon Apr 07, 2025 2:45 pm

Wed May 07, 2025 4:00 am

Hello,

Thanks for your inquiry.
To help us investigate your question more accurately, please write back and tell us what effect you want to achieve. Some screenshots will help. Can this effect be achieved in Microsoft PowerPoint? Looking forward to your reply.

Sincerely,
Tommy
E-iceblue support team
User avatar

Tommy.Tang
 
Posts: 85
Joined: Mon Apr 21, 2025 7:05 am

Thu May 08, 2025 10:17 am

current behaviour:
strings (see cell 1,1 and 4,2) are being converted to `0`, the "a" does not persist
Screenshot 2025-05-08 112232.png


expected output:
all values, strings, numeric, nulls should be respected and persist
Screenshot 2025-05-08 111207.png


it looks like if you append a slide then this problem occurs.

beyeb38077
 
Posts: 14
Joined: Mon Apr 07, 2025 2:45 pm

Fri May 09, 2025 9:26 am

Hello,

Thanks for your feedback.
Sorry, our Spire.Presentation does not support setting non-numerical data in the chart yet.However, we have added it to our update list with the tikcet SPIREPPT-2871. Our development team will further investigate whether it can be implemented. If there is any progress, we will inform you as soon as possible.

Sincerely,
Tommy
E-iceblue support team
User avatar

Tommy.Tang
 
Posts: 85
Joined: Mon Apr 21, 2025 7:05 am

Fri May 09, 2025 5:09 pm

The charts do support non-numeric. This is what this ticket solved, it was fixed in SPIREPPT-2663 in version 10.4.2. If I have misunderstood then please let me know.

It seems, there is a bug, the issue (converting non-numeric to numeric) only occurs if you append a slide. If you don't append a slide and work directly on the chart then it works fine.

Try the code below which does not append a slide, you will see it works.

Code: Select all

//Load template presentation
using Spire.Presentation.Charts;
using Spire.Presentation;

Presentation templatePresentation = new Presentation();
templatePresentation.LoadFromFile("C:\path.pptx");


//Get first slide from template presentation
var slide = templatePresentation.Slides[0];

//Get Chart                       
IChart chart = slide.Shapes.ToArray().FirstOrDefault(x => x.Name == "Chart 3") as IChart;


chart.ChartData[1, 0].Value = null;
chart.ChartData[2, 0].Value = "car 2";
chart.ChartData[3, 0].Value = 578;
chart.ChartData[4, 0].Value = "car 4";
chart.ChartData[5, 0].Value = "";

chart.ChartData[0, 1].Value = "aba";
chart.ChartData[0, 2].Value = 50;
chart.ChartData[0, 3].Value = "jhfuhgf";
chart.ChartData[0, 4].Value = 50;

chart.ChartData[1, 1].Value = null;
chart.ChartData[2, 1].Value = "a";
chart.ChartData[3, 1].Value = 40;
chart.ChartData[4, 1].Value = 69;
chart.ChartData[5, 1].Value = "b";

chart.ChartData[1, 2].Value = 55;
chart.ChartData[2, 2].Value = "jkgkhg";
chart.ChartData[3, 2].Value = null;
chart.ChartData[4, 2].Value = "";
chart.ChartData[5, 2].Value = 14;

chart.ChartData[1, 3].Value = 20;
chart.ChartData[2, 3].Value = "hgjhg";
chart.ChartData[3, 3].Value = 40;
chart.ChartData[4, 3].Value = "";
chart.ChartData[5, 3].Value = null;

chart.ChartData[1, 4].Value = "3574687";
chart.ChartData[2, 4].Value = null;
chart.ChartData[3, 4].Value = 20;
chart.ChartData[4, 4].Value = 20;
chart.ChartData[5, 4].Value = "";


//Save and launch to view the PPTX document.
templatePresentation.SaveToFile(path)

beyeb38077
 
Posts: 14
Joined: Mon Apr 07, 2025 2:45 pm

Return to Spire.Presentation

cron