GNOME Bugzilla – Bug 670692
Stacked charts are not correctly imported from ODF
Last modified: 2012-02-23 18:40:14 UTC
Created attachment 208283 [details] [review] Proposed patch To reproduce: create a stacked column chart (might be a percentage chart) in localc, save and load in gnumeric, the overlap-percentage should be 100, but is 0. Actually, it seems that this property is not significant in LO for stacked charts.
This does not look right: - if (btmp) + if (btmp) { style->plot_props = g_slist_prepend (style->plot_props, oo_prop_new_string ("type", "as_percentage")); + style->plot_props = g_slist_prepend (style->plot_props, + oo_prop_new_int ("overlap-percentage", 100)); + } This forces an overlap-percentage when as-percentage is set to be true, whether is is a stacked column chart or not.
In ODF 1.2 part 1, section 20.40 describes chart:overlap and section 20.52 describes chart:stacked. Since ODF 1.2 does not give a default value for chart:overlap I could see us setting the overlap percentage to 100% if chart:stacked is true _and_ no chart:overlap value is given. chart:percentage is described in section 20.42 and is completely unrelated to chart:stacked. So we surely should not force a certain overlap if that is given.
Note that I would really view this as an LO bug. They really should specify an overlap if they want to obtain an overlap of 100%.
Comment on attachment 208283 [details] [review] Proposed patch see previous comments
Note that ODF allows for chart:percentage=true with chart:stacked=false. Neither LO nor Gnumeric seem to support that at this time.
Created attachment 208290 [details] [review] proposed patch This proposed patch only sets the overlap value as a consequence of chart:stacked=true if an overlap value is not separately specified (as one can for example do in Gnumeric). The previous patch's effect would have depended on the order of the attributes, which should not matter. This patch also uses chart:percentage=true as a trigger to set the overlap to 100% provided chart:stacked is not set to false and no chart:overlap value is specified.
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.