Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Mon Jun 03, 2019 11:42 am

Hey,

exists out there a way to generate a chart with null values.
an example what i m searching for is in the attachments.

thx

Thomas
Attachments
2019-06-03_13h37_07.png
2019-06-03_13h37_07.png (35.48 KiB) Viewed 1037 times

Semjasa
 
Posts: 36
Joined: Wed Dec 19, 2018 11:50 am

Tue Jun 04, 2019 1:59 am

Hello,

Thanks for your message.
Do you mean that you want to set some empty values for charts? If yes, please refer to the following code snippet to set the empty value for "Label2". If there is any misunderstanding, please provide more information about your requirement, then we will guide you accordingly.
Code: Select all
......
 serie.EnteredDirectlyValues = new object[] { 10, "", 30 };
 serie.EnteredDirectlyCategoryLabels = new object[] { "Label1", "Label2", "Label3" };
......

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1261
Joined: Wed Apr 25, 2018 3:20 am

Tue Jun 11, 2019 2:18 am

Hello,

Greetings from E-iceblue.
Did my solution help you? Your feedback will be greatly appreciated.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1261
Joined: Wed Apr 25, 2018 3:20 am

Mon Jul 01, 2019 6:52 am

Thanks Yes it was very helpful!

but in this case i have an other problem when i draw a linechart with an null value at the very first position this do not work with string.Empty. for the excel function with connect nulls (#N/A) it will work but only when the first position are contains an value

is there a way to fix this problem?

Thanks Thomas
Attachments
2019-07-01_08h51_18.png
2019-07-01_08h51_18.png (12.41 KiB) Viewed 962 times

Semjasa
 
Posts: 36
Joined: Wed Dec 19, 2018 11:50 am

Mon Jul 01, 2019 7:55 am

Hello Thomas,

Thanks for your feedback.
As for the new reported issue, I simulated your case, tested with the following sample code and encountered an error like the attached screenshot when opening the generated Excel file. This issue has been submitted to our Dev team for further investigating and fixing. We will let you know if there is any update. Meanwhile, did you get the same error as mine? If there is any difference, please also share the detail with us, so that our Dev team could investigate it accurately. Thanks in advance.
Code: Select all
Workbook workbook = new Workbook();
Worksheet sheet = workbook.Worksheets[0];
Chart chart = sheet.Charts.Add(ExcelChartType.LineMarkersStacked);
var serie = chart.Series.Add();
serie.EnteredDirectlyValues = new object[] { "", 20, 30 };
serie.EnteredDirectlyCategoryLabels = new object[] { "Label1", "Label2", "Label3" };
workbook.SaveToFile("result.xlsx", ExcelVersion.Version2013);

Sincerely,
Lisa
E-iceblue support team
Attachments
error.zip
(32.92 KiB) Downloaded 176 times
User avatar

Lisa.Li
 
Posts: 1261
Joined: Wed Apr 25, 2018 3:20 am

Thu Jul 11, 2019 11:39 am

Hello,

Thanks for your patient waiting.
Glad to tell you that we just released the Spire.XLS Pack Version:9.7 which has fixed the error issue when drawing a chart with an null value at the very first position. Welcome to download it from the following links and test.
Website:https://www.e-iceblue.com/Download/download-excel-for-net-now.html
Nuget: https://www.nuget.org/packages/Spire.XLS/

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1261
Joined: Wed Apr 25, 2018 3:20 am

Mon Jul 29, 2019 7:32 am

Thank You, Nice to work with your Product

Semjasa
 
Posts: 36
Joined: Wed Dec 19, 2018 11:50 am

Mon Jul 29, 2019 8:00 am

Hello,

Glad to hear that! If you encounter any issue related to our products in the future, just feel free to contact us.
Wish you all the best!

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1261
Joined: Wed Apr 25, 2018 3:20 am

Return to Spire.XLS