GNOME Bugzilla – Bug 502968
line graph looses color in excel export
Last modified: 2007-12-12 14:40:50 UTC
Please describe the problem: After saving an xls export and reopening either in Excel or Gnumeric, the line graphs line style turns to empty (no line) and error bars disappear. Symbol colors are preserved. Steps to reproduce: 1. Create a line graph with error bars; 2. Save the spreadsheet as xls (MS Excel 97/2000/XP); 3. Restart Gnumeric and open the file. Actual results: The lines and error bars disappear. Expected results: The formatting should be preserved. Does this happen every time? Yes. Other information:
Th lines do not disappear for me. But I confirm the error bar issue.
Created attachment 100742 [details] [review] fixes the issue. Excel did open correctly my test file. Anyway there was a confusion between dash_type and pattern in the line style. By the way, what the pattern field is for? It might probably be removed.
Created attachment 100745 [details] sample gnumeric file with straight line This is a more limited dataset from the original file where I found the issue
Here you can find a xls file created by saving the preceding attachment as xls: http://www.bestsharing.com/files/KeTBJqy378501/graph%20issue.xls.html This is what happened when I saved the previous gnumeric file as xls: The error bars vanished, and the lines changed from straight to dotted. It seems the line pattern changes randomly (!).
The attached patch fixes that. We have two fields in line format for the same thing, and there was a confusion between the two when exporting to xls. Thanks for reporting.
Created attachment 100747 [details] [review] a more comprehensive fix This one completely drops the pattern field in line format (goffice itself never uses it). Please review.
Looks good, although the lookups in dash_map perhaps should be guarded against bogus values.
Created attachment 100825 [details] [review] takes into account all possible (and even impossible) patterns Needs review. Previous one was dangerous with patterns greater than 5, as Morten said.
Looks good to me, visually, but please use >=G_N_ELEMENTS(dash_map) over >5. Apart from that, commit!
Fixed in svn. Thanks for reporting.