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 788447 - axes labels are exported as <chart:domain> for class:surface
axes labels are exported as <chart:domain> for class:surface
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: import/export OOo / OASIS
1.12.x
Other Windows
: Normal normal
: ---
Assigned To: Andreas J. Guelzow
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2017-10-02 19:21 UTC by Regina Henschel
Modified: 2017-10-14 06:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
file with the data from the bug description (2.81 KB, application/x-gnumeric)
2017-10-02 19:40 UTC, Regina Henschel
Details
sample gnumeric file (2.73 KB, application/x-gnumeric)
2017-10-02 19:48 UTC, Andreas J. Guelzow
Details
ODF file with the srcondset of data (34.61 KB, application/vnd.oasis.opendocument.spreadsheet)
2017-10-13 00:49 UTC, Andreas J. Guelzow
Details

Description Regina Henschel 2017-10-02 19:21:10 UTC
Make a surface chart, left button, from the data e.g. in A1:F6

    	One	Two	Three	Four	Five
Jan	0	-1	-4	-5	-9
Feb	12	8	-4	-8	-24
Mar	20	15	0	-5	-25
Apr	42	35	14	7	-21
May	90	80	50	40	0

The reference for the labels for the x-axis and for the y-axis are in a <chart:domain> element.
But in the specification [1], section 19.15.1, page 338, you find the text
"In both cases two <chart:domain> elements may be used to specify the y-values and x-values to be used (19.593.5). In this case the jth value of the table:cell-range-address attribute of the first <chart:domain> element specifies the y-values used for the values in the jth row of the cell range given by the chart:values-cell-range-address attribute of the <chart:series> element and the ith value of the table:cell-range-address attribute of the second <chart:domain> element specifies the x-values used for the values in the ith column."

So it is expected, that these elements refer to numbers. But in this case there are strings.

I expect, that the labels are in the <chart:categories> element of the <chart:axis> element with attribute chart:dimension="x" and chart:dimension="y" respectively. That would correspond to labeling category-axis in other chart types.

[1]http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.odt
Comment 1 Morten Welinder 2017-10-02 19:36:43 UTC
It would be helpful with a sample file in .gnumeric format to ensure
that we are looking at the same thing.
Comment 2 Regina Henschel 2017-10-02 19:40:18 UTC
Created attachment 360800 [details]
file with the data from the bug description

Newer version is not available for Windows.
Comment 3 Andreas J. Guelzow 2017-10-02 19:48:07 UTC
It is not clear to me that using <chart:domain> is wrong. The ODF description generically uses the term "values" which also covers string values.

The description of the first type of surface graphic does not mention the <chart:categories> element, that element is only referred to in the description of the second type of surface plot.
Comment 4 Andreas J. Guelzow 2017-10-02 19:48:45 UTC
Created attachment 360801 [details]
sample gnumeric file
Comment 5 Regina Henschel 2017-10-02 20:51:16 UTC
Look at the text
   "If chart:three-dimensional="true" a surface chart is displayed in a right-handed three-dimensional Cartesian coordinate system with horizontal x-axis (from left to right), a perspective y-axis running from the front to the right rear and a vertical z-axis (prior to any 3D scene transformation)."
in section 19.15.1 and the text
   "The table:cell-range-address attribute of the first <chart:domain> element specifies the y-coordinate values and the table:cell-range-address attribute of the second <chart:domain> element specifies the x-coordinate values for surface charts"
from section 19.593.5.
For me "x-coordinate value" in a "three-dimensional Cartesian coordinate system" is a number and not a string.

I have described the problem here so that you can discuss it before it is on the ODF TC agenda.
Comment 6 Andreas J. Guelzow 2017-10-03 06:04:11 UTC
Regina,
let us look at the whole picture:

      <chart:chart svg:width="406.00000000000006pt" svg:height="230pt" xlink:type="simple" xlink:href=".." chart:class="chart:surface" chart:style-name="plotstyle">
        <chart:plot-area chart:style-name="GOG--1" gnm:is-position-manual="false">
          <chart:axis chart:dimension="z" gnm:id="1" chart:name="Z-Axis-1" chart:style-name="GOG-3">
            <chart:categories table:cell-range-address="$'Sheet1'.$B$1:.$F$1"/>
          </chart:axis>
          <chart:axis chart:dimension="y" gnm:id="1" chart:name="Y-Axis-1" chart:style-name="GOG-2">
            <chart:categories table:cell-range-address="$'Sheet1'.$B$1:.$F$1"/>
          </chart:axis>
          <chart:axis chart:dimension="x" gnm:id="1" chart:name="X-Axis-1" chart:style-name="GOG-1">
            <chart:categories table:cell-range-address="$'Sheet1'.$B$1:.$F$1"/>
          </chart:axis>
          <chart:series chart:values-cell-range-address="$'Sheet1'.$B$2:.$F$6" chart:style-name="GOG-4">
            <chart:domain table:cell-range-address="$'Sheet1'.$A$2:.$A$6"/>
            <chart:domain table:cell-range-address="$'Sheet1'.$B$1:.$F$1"/>
          </chart:series>
        </chart:plot-area>
      </chart:chart>
<chart:categories
So the categories shown on the axes are determined by the <chart:categories> elements if the <chart:axis> element expects that, which I believe is true for the x and y axes here.

The <chart:series> element contains two <chart:domain> elements which describe the values of the x and y axes if appropriate.

You seem to argue that the representation of the chart should depend on whether the  table:cell-range-address="$'Sheet1'.$A$2:.$A$6" and table:cell-range-address="$'Sheet1'.$B$1:.$F$1" contain numbers or strings. I would argue that it is preferable if the representation of the chart would be independent of the content of those regions, since in that way the values that happen to exist in the sheet influence the results but not the representation of the formulas and objects.

Perhaps it would be useful if you could provide which representation you would prefer.
Comment 7 Andreas J. Guelzow 2017-10-03 06:06:47 UTC
On closer lokk I see that the table:cell-range-address of the x axis should be "$'Sheet1'.$A$2:.$A$6". That is obviously a bug.
Comment 8 Regina Henschel 2017-10-03 09:53:21 UTC
Andreas, I would prefer
<chart:chart svg:width="406.00000000000006pt" svg:height="230pt" xlink:type="simple" xlink:href=".." chart:class="chart:surface" chart:style-name="plotstyle">
    <chart:plot-area chart:style-name="GOG--1" gnm:is-position-manual="false">
        <chart:axis chart:dimension="z" gnm:id="1" chart:name="Z-Axis-1" chart:style-name="GOG-3">
        </chart:axis>
        <chart:axis chart:dimension="y" gnm:id="1" chart:name="Y-Axis-1" chart:style-name="GOG-2">
            <chart:categories table:cell-range-address="$'Sheet1'.$A$2:.$A$6"/>
        </chart:axis>
        <chart:axis chart:dimension="x" gnm:id="1" chart:name="X-Axis-1" chart:style-name="GOG-1">
            <chart:categories table:cell-range-address="$'Sheet1'.$B$1:.$F$1"/>
        </chart:axis>
        <chart:series chart:values-cell-range-address="$'Sheet1'.$B$2:.$F$6" chart:style-name="GOG-4">
        </chart:series>
    </chart:plot-area>
</chart:chart>

When there exists no <chart:domain> element, then the first paragraph of the spec applies. That is a description for a surface having category-x-axis and category-y-axis. The case where <chart:domain> element exists is the case having value-axes in x- and y-direction.

The distinction is similar to the distinction between chart:line with a category-x-axis and chart:scatter with a value-x-axis. In case of category x-axis the coordinates are 1.0, 2.0, ... In case of value x-axis the x-coordinates are taken from a <chart:domain> element. For chart:surface it is the same, only one dimension more.

In case chart:line it is said explicitly, that the <chart:categories> child element of the <chart:axis> can be used for axis labels. In case chart:surface a statement about axis labels is missing. I prefer to use a similar solution as in chart:line to be consistent. Therefore I put the axis labels into the <chart:categories> elements.

A <chart:categories> element makes no sense for the z-axis, because it is a value-axis and a such has not 'categories'. Therefore I omit it for z.
Comment 9 Andreas J. Guelzow 2017-10-13 00:48:58 UTC
Regina, I don't think what you are suggesting works reasonably. Suppose we have the following data:
	                               One	Two	Three	Four	Five
=if(mod(day(today()),2),"Jan",1)        0	-1	-4	-5	-9
=if(mod(day(today()),2),"Feb",2)	12	8	-4	-8	-24
=if(mod(day(today()),2),"Mar",3)	20	15	0	-5	-25
=if(mod(day(today()),2),"April",15)	42	35	14	7	-21
=if(mod(day(today()),2),"May",16)	90	80	50	40	0

If I understand you correctly, then you suggest that on an even day we save the chart using a chart:domain and on an odd day we do not use chart:domain. It does not seem sensible to change the way we save the table just because the date is different.
Comment 10 Andreas J. Guelzow 2017-10-13 00:49:58 UTC
Created attachment 361471 [details]
ODF file with the srcondset of data
Comment 11 Andreas J. Guelzow 2017-10-13 02:37:02 UTC
The export now looks like:

    <office:chart>
      <chart:chart svg:width="273pt" svg:height="156pt" xlink:type="simple" xlink:href=".." chart:class="chart:surface" chart:style-name="plotstyle">
        <chart:plot-area chart:style-name="GOG--3" gnm:is-position-manual="false">
          <chart:axis chart:dimension="z" gnm:id="1" chart:name="Z-Axis-1" chart:style-name="GOG-8"/>
          <chart:axis chart:dimension="y" gnm:id="1" chart:name="Y-Axis-1" chart:style-name="GOG-7">
            <chart:categories table:cell-range-address="$'Sheet1'.$A$2:.$A$6"/>
          </chart:axis>
          <chart:axis chart:dimension="x" gnm:id="1" chart:name="X-Axis-1" chart:style-name="GOG-6">
            <chart:categories table:cell-range-address="$'Sheet1'.$B$1:.$F$1"/>
          </chart:axis>
          <chart:series chart:values-cell-range-address="$'Sheet1'.$B$2:.$F$6" chart:style-name="GOG-9">
            <chart:domain table:cell-range-address="$'Sheet1'.$A$2:.$A$6"/>
            <chart:domain table:cell-range-address="$'Sheet1'.$B$1:.$F$1"/>
          </chart:series>
        </chart:plot-area>
      </chart:chart>
    </office:chart>
Comment 12 Andreas J. Guelzow 2017-10-14 06:22:10 UTC
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.