After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 670692 - Stacked charts are not correctly imported from ODF
Stacked charts are not correctly imported from ODF
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: import/export OOo / OASIS
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Andreas J. Guelzow
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2012-02-23 15:23 UTC by Jean Bréfort
Modified: 2012-02-23 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (1.19 KB, patch)
2012-02-23 15:23 UTC, Jean Bréfort
needs-work Details | Review
proposed patch (2.21 KB, patch)
2012-02-23 17:59 UTC, Andreas J. Guelzow
committed Details | Review

Description Jean Bréfort 2012-02-23 15:23:27 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.
Comment 1 Andreas J. Guelzow 2012-02-23 17:19:34 UTC
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.
Comment 2 Andreas J. Guelzow 2012-02-23 17:30:12 UTC
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.
Comment 3 Andreas J. Guelzow 2012-02-23 17:31:51 UTC
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 4 Andreas J. Guelzow 2012-02-23 17:32:12 UTC
Comment on attachment 208283 [details] [review]
Proposed patch

see previous comments
Comment 5 Andreas J. Guelzow 2012-02-23 17:52:38 UTC
Note that ODF allows for chart:percentage=true with chart:stacked=false. Neither LO nor Gnumeric seem to support that at this time.
Comment 6 Andreas J. Guelzow 2012-02-23 17:59:31 UTC
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.
Comment 7 Andreas J. Guelzow 2012-02-23 18:40:14 UTC
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.