Closed LeoPollock closed 2 years ago
This is probably an issue:
lxw_chart_options options2;
The lxw_chart_options struct should be initialized or else it will contain a lot of junk data. Something like this should work depending on your compiler:
lxw_chart_options options2 = {0};
If that isn't the issue then please add some more of the stack trace/debug log and also what compiler and environment you are using.
Wow, thanks for the fast response. That was it, just had to initialize the struct. Thanks a lot. I will close the issue.
Hi. First, thanks for the amazing library. It really helped me a lot. I am having some trouble when generating a line chart in Debug Mode. The sheet I am building varies in size from the data I have. Basically, I have two columns, one with the date(dd/mm/yy) and the other with the hour(hh:mm:ss), which I use as the category axis. Then I have three columns of floats that I use which one as a series. I set the interval tick and unit by a factor of 17 because the number of lines can be large(let's say from 100 to 1000). When generating the sheet with the chart with no options(
worksheet_insert_chart(worksheet, CELL("A1"), chart);
), the code works. The problem is: when I put a lxw_chart_options object to resize the chart in the sheet, the debug throws an exception because an access violation inlxw_strdup()
(instrlen(str)
), called onobject_props->description = lxw_strdup(user_options->description);
inlxw_error worksheet_insert_chart_opt()
. In release mode, the code works just fine, the chart has the size that I want. I tried to add the description, dynamically allocate lxw_chart_options, with no success.Obs.: In another part of the code, I use a similar function to generate a column chart(with less data, should I mention), and it works with
lxw_error worksheet_insert_chart_opt()
.Here is my code: