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.

Fri Apr 05, 2019 12:01 pm

when i try to save a current sheet to svg the sheet contians a 3dpie chart
Code: Select all
        currentSheet.ToSVGStream(
                                fs,
                                chart.TopRow,
                                chart.LeftColumn,
                                chart.BottomRow,
                                chart.RightColumn);
                            fs.Flush();
                            fs.Close();


i get the following error:
{System.InvalidOperationException: Queue empty.
at System.Collections.Generic.Queue`1.ThrowForEmptyQueue()
at System.Collections.Generic.Queue`1.Dequeue()
at Spire.Xls.Core.Spreadsheet.XlsWorksheet.ToSVGStream(Stream stream, Int32 firstRow, Int32 firstColumn, Int32 lastRow, Int32 lastColumn)
at POC.Converter.BLL.RtfConverter.ExcelToSvg(Stream memoryStream, String filename) in C:\Users\G01357\source\repos\POC.Converter\POC.Converter.BLL\RtfConverter.cs:line 40
at POC.Converter.API.Controller.CopyPasteController.PasteHtml(IFormFile files) in C:\Users\G01357\source\repos\POC.Converter\POC.Converter.API\Controller\CopyPasteController.cs:line 39}

do any know a solution to this problem? and further on, whats the scope of adding more chart types? as we are using Waterfall charts also.

dffeddersen
 
Posts: 2
Joined: Fri Apr 05, 2019 11:57 am

Mon Apr 08, 2019 7:44 am

Hello,

Thanks for your inquiry.
When converting a sheet which contains a 3DPie chart to SVG, I indeed reproduced the error you encountered. I have posted this issue to our Dev team for further investigating and fixing, we will let you know if there is any update. Sorry for the inconvenience caused.
Besides, you can check the enum of ExcelChartType to get the scope of adding chart types. However, our Spire.XLS doesn’t support directly adding waterfall chart type at present. But you could achieve the same effect as waterfall chart by creating ColumnStacked chart. Below is the sample code for your reference. If this is not what you want, please provide your expected .xlsx file with us, then we will look into it and guide you accordingly.
Code: Select all
//Load Workbook
Workbook workbook = new Workbook();
workbook.LoadFromFile(@"sample.xlsx");
Worksheet sheet = workbook.Worksheets[0];
//Add Chart and Set Chart Data Range
Chart chart = sheet.Charts.Add(ExcelChartType.ColumnStacked);
chart.DataRange = sheet.Range["A1:C4"];
chart.SeriesDataFromRange = false;
//Chart Position
chart.LeftColumn = 5;
chart.TopRow = 3;
chart.RightColumn = 15;
chart.BottomRow = 20;
//Chart Title
chart.ChartTitle = "Parts Sales";
//Chart Axes
chart.PrimaryCategoryAxis.Title = "Parts";
chart.PrimaryCategoryAxis.Font.Color = Color.Blue;
chart.PrimaryValueAxis.HasMajorGridLines = false;
//Chart Legend
chart.Legend.Position = LegendPositionType.Right;
//set the fill of series[0] to none
chart.Series[0].Format.Fill.FillType = ShapeFillType.NoFill;
//show data labels
chart.Series[1].DataPoints.DefaultDataPoint.DataLabels.HasValue = true;
//Save
workbook.SaveToFile("result.xlsx", ExcelVersion.Version2013);

Sincerely,
Lisa
E-iceblue support team
User avatar

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

Mon Apr 08, 2019 8:43 am

Hi Lisa.

Thank you very much for the reply, and you notice the error.

Regarding chart - can you elaborate on if there's any scope of adding new charts?
We're using a lot of different charts in our company - so i think we would encounter that a lot of chart isnt supported.


Best Regards
Daniel F

dffeddersen
 
Posts: 2
Joined: Fri Apr 05, 2019 11:57 am

Mon Apr 08, 2019 11:01 am

Hello,

Generally, our Spire.XLS supports all common chart types, except for some new chart types which are supported in higher Excel versions, such as the waterfall chart type supported in MS Excel 2016. However, we always improve our product to support more new features and make it flawless. Just list them to us if there is any unsupported chart types when using our product. We will add it as a new feature into our upgrade list. But I'm afraid it can't be achieved in a short time, because these are related to many complicated modules. Hope you can understand.

Sincerely,
Lisa
E-iceblue support team
User avatar

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

Mon May 13, 2019 11:02 am

Hello,

Glad to inform you that the issue of converting a sheet which contains a 3DPie chart to SVG has been fixed in Spire.XLS Pack(Hotfix) Version:9.5.4. Please download it from the following links.
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: 1271
Joined: Wed Apr 25, 2018 3:20 am

Wed May 15, 2019 7:57 am

Hello,

Greetings from E-iceblue.
Did the hotfix version work for you? Thanks in advance for your feedback and time.

Sincerely,
Lisa
E-iceblue support team
User avatar

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

Return to Spire.XLS