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 Mar 13, 2023 5:15 pm

Problem:
Empty cells in Line chart not rendered correctly until you select "Edit data".

Here's my data, notice the null value
["Charts","Tables","Pictures","Textboxes"],
["January","February","March"],
[2,4,6,10],[2,4,6,10],[2,null,6,10]

pptx template:
c3ac3c1b-edf9-4e8d-aabe-3a19d11d4d14.zip


Before edit data is selected:
before edit data.png


After edit data is selected:
after edit data.png


Expected out:
after edit data.png

majeed_s
 
Posts: 80
Joined: Thu Mar 25, 2021 4:13 pm

Tue Mar 14, 2023 1:16 pm

Hi,

Thanks for your inquiry.
After testing, I did not reproduce your issue. whether the edit data is selected or not, the line is the same. Could you please provide us with the following messages to help us work out a solution for you? Thanks for your assistance.
1) your test code.
2) the version of Excel you are using.

Sincerely,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Mon Mar 20, 2023 9:51 am

Hi,

Here's snipped of code used to assign empty chart values:
Code: Select all
            if (column.IsNull || column.String == string.Empty)
            {
                chart.ChartData[x, y].Value = "";
            }
            else
            {
                chart.ChartData[x, y].NumberValue = correctValue;
            }


Noticed that for the generated presentation, it will initially have blank value with correct line graph with blank. After "Edit Data" value is assigned a space " " value interpreted as 0

boncyrus
 
Posts: 20
Joined: Wed Mar 01, 2023 10:01 am

Tue Mar 21, 2023 7:46 am

Hi,

Thanks for your feedback.
After testing, I reproduced your issue and logged it into our issue tracking system with the ticket number SPIREPPT-2212, our developers will investigate and fix it. Sorry for the inconvenience caused, once the issue is fixed, I will inform you asap.

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Thu Apr 13, 2023 2:24 am

Hi,

Thanks for your patience.
Our development team has investigated the issue and found that assigning a blank value to a chart can result in abnormal display of the chart in the resulting document.

To resolve this, we recommend setting a default value of 0 when the assigned value is empty. Please refer to the following code snippet for reference:
Code: Select all
chart.Series[1].Values[2].Value = "";
chart.DisplayBlanksAs = DisplayBlanksAsType.Zero;

We appreciate you bringing this issue to our attention, and please don't hesitate to reach out if you have any further questions or concerns.

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Thu Apr 13, 2023 7:08 am

Hi,

Upon following instructions to
Code: Select all
chart.DisplayBlanksAs = DisplayBlanksAsType.Zero;

we noticed that the chart draws the line as 0 like this:
chartas0.jpg


Our expectation is chart will be displayed like this:
expectation.jpg

boncyrus
 
Posts: 20
Joined: Wed Mar 01, 2023 10:01 am

Thu Apr 13, 2023 9:11 am

Hi,

Thanks for your feedback.
Sorry that I do not quite understand your need. In your chartas0.jpg, the Benz series, February category, its value is 5, I didn't notice any issues with the line drawn. could you please describe the issue more clearly and share us with your code snippet? This can effectively help us understand your need and work out a solution for you? Thanks for your assistance.

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Mon Apr 17, 2023 6:06 am

Hi, We are expecting that no line will be drawn for Benz even if there is a 5 value for February since all other values are null. This is the same behavior for powerpoint when creating new presentation and adding new line chart. If a series only has 1 value and all other are null, line is not drawn.

boncyrus
 
Posts: 20
Joined: Wed Mar 01, 2023 10:01 am

Mon Apr 17, 2023 9:46 am

Hi,

Thanks for your feedback.
I have noticed this issue and reported it to our developers, they will continue to investigate this issue. Once there are any updates available, I will inform you asap. Thanks for your understanding.

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Wed Jun 07, 2023 10:00 am

Hi,

Thanks for your patience.
We have released Spire.Presentation 8.6.0 hotfix, which has fixed the issue SPIREPPT-2212.
Please note that our Spire.Presentation follows the standard of MS PowerPoint. In PowerPoint, if a cell in a particular series of a chart is set to a blank value, the corresponding line will not be drawn. Please refer to the attached image for an example.
PowerPoint.png

If you would like to achieve the effect shown in the third image, we suggest setting the value to 0. Moreover, since the data in the chart is numerical, we recommend avoiding using empty strings. Additionally, please remove the line of code suggested earlier.

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Return to Spire.Presentation