Generating a simple line chart from Data not working
Hello im trying to generate a chart on the excel data that i attached. Its an error in the excel file when i try to add it. Is it because the cells arent formatted as numbers? not sure why this wouldnt work.
Here is the code.
final ChartCollection charts = ChartCollection(sheet);
// Add the chart.
final Chart chart1 = charts.add();
// Set Chart Type.
chart1.chartType = ExcelChartType.line;
// Set data range in the worksheet.
chart1.dataRange = sheet.getRangeByName('A7:C16');
chart1.isSeriesInRows = false;
// set charts to worksheet.
sheet.charts = charts;
Attachment: Sample_cf38ea2.zip
Hi Jesse,
We are unable to reproduce the issue on our end. We have shared the sample tried at our end. Please modify the sample to reproduce the issue and share us along with the package version that you are using. It will help us to proceed further.
Regards,
Mohamed Yusuf Khan.
Attachment: Sample_(5)_f99dd4f1.zip
Right i think its because you are using the SetNumber for all the values. Unfortunately it would affect the speed of my program to have to do that. Instead im using the importList to throw all of the data into the excel sheet, not the setnumber. Can you please change your chart creation function to detect numbers and values automatically instead of them having to be set specifcally with the set number function. This means as of right now nobody can create any charts with the data from the importList function, that should be fixed. Thank you
-Jesse
Hi Jesse,
We are facing a file corruption issue in the Excel document when adding a table to the worksheet. Please confirm whether you are facing the same issue at your end. If it is a different issue, please modify the attached sample to reproduce the issue and share it along with output Excel documents to proceed further.
Regards,
Mohan.
Attachment: flutter_application_1_a43efb3b.zip
This is the problem i having... that you now are experiencing as well. If you comment out the chart creation the excel file opens fine. The chart is what is corrupting the file. Comment this out, and it will work. You have some debugging to do on your side with chart creation
/*// Create an instances of chart collection.
final ChartCollection charts = ChartCollection(sheet);
// Add the chart.
final Chart chart = charts.add();
// Set Chart Type.
chart.chartType = ExcelChartType.line;
// Set data range in the worksheet.
chart.dataRange = sheet.getRangeByName('A7:C17');
chart.isSeriesInRows = false;
// set charts to worksheet
sheet.charts = charts;*/
Hi Jesse,
We have logged a defect report for this issue as "Excel file is corrupted while creating the Excel document with both chart and table" and the fix will be included in our 2023 Volume 4 release.
You can track the bug status through the below feedback link.
Regards,
Mohan.
Thanks! When is volume 4 getting released?
Hi Jesse,
The 2023 Volume 4 release will be rolled out by the Mid of December 2023.
Regards,
Mohan.
- 7 Replies
- 3 Participants
-
JE Jesse
- Oct 11, 2023 03:56 PM UTC
- Nov 2, 2023 03:14 PM UTC