GNOME Bugzilla – Bug 788728
[ODS] Roundtrip problem for contour graph
Last modified: 2017-10-11 15:20:08 UTC
Created attachment 361201 [details] Example contour plot Open the attached file. It contains an example contour plot. Save it to OpenDocument Format .ods. Open the saved .ods file. The chart is totally wrong. Main problem: On saving Gnumeric correctly writes first the <chart:domain> element for y-axis and second for x-axis. But on opening Gnumeric expects it the other way round. Minor problems: Gnumeric writes attribute chart:axis-position="start", but in original file it intersects in 0, so it has to be chart:axis-position="0", both for x-axis and y-axis. Because of this error the axes are at wrong position. Gnumeric does not preserve the fill colors. In ODF colors for the individual major intervals of the (pseudo-)z-axis can be saved as properties of <chart:data-point> elements in the <chart:series> element. But such elements are missing.
Clearly the chart doesn't come back right. The problem might be in either the writer or the reader. Or both.
localc reads it as column plot from the ods we save. XL2013 doesn't load any graph.
And the graph looks clipped somehow. I don't understand how this happens.
It is read problem. If you go into the .ods file and exchange the ranges of the two <chart:domain> elements manually, then the chart is correct besides the listed 'Minor problems'. The order first y-axis, then x-axis is the correct order according 19.15.1 in the spec.
The interpretation of the series inside the chart:domain for contour plots has been fixed. Since Gnumeric does not support the specification of random colours for the colour axis, the "<chart:data-point> elements in the <chart:series> element" is overkill. Since I am not aware of anybody else who supports contour plots in ODF at the moment, I am not to concerned with interoperability.
I don't see the chart:axis-position issue, the applicable styles have: gnm:axis-position-expression="0" chart:axis-position="0" It would likely be nice to preserve the existence of the Color-Scale and the value of the color-map-name for the roundtrip into Gnumeric. I am leaving this bug open for that.
Mildly off-topic: we don't roundtrip for xlsx either. We seem to write it, but not read it.
We are now writing the z-axis for contour plots and round trip the color map in extended ODF.
Looks good. For the record, I still see a difference in the legend area. The original shows the colours on a scale, the roundtrip file show textual intervals for each colour.
Yes, that is the color scale I mentioned in comment 6.
I have moved comment #7 into bug #788807. This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.
FWIW, XL2013 complains when loading our generated ods file: "The reference is not valid. References for titles, values, sizes or data labels must be a single cell, row or column."
Sure, XL does not support 2D ranges as we do, the issue was the same with xls format, of course, and import is even worse, since the data might not be inside a rectangle. I made some tests years ago, probably with XL2k, and could make contour plots in excel with an arbitrary collection of column and row vectors. That's why there are special plot types for contour and surface plots import from excel.
For surface and contour plots ODF provides two ways of specifying the data. A sensible way and a non-sensible way in which the data is divided into slices. We are exporting in the sensible way and Excel fails loading it. That is an Excel problem. ODF 1.3 clearly specifies that method and so Excel should be able to load it. We are now importing the excel versions by using the union of slices, since I did not realize we had special plot types for contour and surface plot import from excel. In fact Excel exports contour plots to ODF as surface plots (i.e. with three-dimensional=true) but then sets the viewing direction from above so does it looks like a contour plot.