QtXlsxWriter icon indicating copy to clipboard operation
QtXlsxWriter copied to clipboard

Generating line chart creates errors

Open WebmasterToTheFuture opened this issue 8 years ago • 2 comments

Hello, I'm trying to generate a line chart with the latest source code. But 2 errors occur (I don't know if one produces the other).

The first is that whenever I generate a line chart and open the excel file after the program closes, I get this message: "Excel found unreadable content in data.xls. Do you want to recover the contents of this workbook?" This only happens when I create a chart. Otherwise, everything is fine.

The second is that when I recover the workbook (noting what happened above), the line chart's axes are skewed. The values that should be on the categorical x-axis have instead been added as an additional series. The lines on the graph are extremely thick, so thick in fact that you can barely see a distinction in the data. The values added onto the categorical x-axis are not from my data. I've manually done the exact same procedure in Excel and I've gotten the correct result. I've tried these functions in my program:

QXlsx::CellRange graphRange(topLeftCellReference, bottomRightCellReference); QXlsx::Chart * lineGraph = ExcelData.insertChart(3, 3, QSize(1200, 600)); lineGraph->setChartType(QXlsx::Chart::CT_Line); lineGraph->addSeries(graphRange); //and alternatively lineGraph->addSeries(QXlsx::CellRange("A6:B3000")); //my values go this high and much farther

And I get the same result. I'm using Qt Creator with Qt 5.5.1 and the VC++ 2010 compiler. I'm using the latest master build and added the pri file as an include. I have not modified the QtXlsx source in any way.

I would appreciate it if any of the contributors could help me out with this. Thanks.

WebmasterToTheFuture avatar Aug 01 '16 19:08 WebmasterToTheFuture

are you resove the question, i am want to know also.

FFHPU avatar May 15 '18 04:05 FFHPU

i have come across the same problem,and i see the data insiade he file chart1.xml may not correct that lead the problem

seaCheng avatar Dec 09 '20 09:12 seaCheng