-
Type:
New Feature
-
Status: Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: ODF-Next
-
Component/s: Chart, Part 3 (Schema) [1.2: 1]
-
Labels:None
-
Proposal:Hide
19.15 chart:axis-type
The chart:axis-type attribute specifies if the axis values are interpreted as text, dates, or automatically by the consumer.
If an axis type is set to “date” or has been set to “auto” and interpreted by the consumer to contain dates, the axis will rendered with the dates scaled across the axis and the data points placed at the corresponding date on the axis.
If the attribute is missing, the default value is "auto".
11.10 chart:date-scale
The <chart:date-scale> element specifies how an axis that contains date values is formatted.
19.15 chart:base-time-unit
The chart:base-time-unit attribute specifies the smallest time unit that is displayed on the date axis.
If the attribute is missing, the resolution is chosen automatically by the consumer.
19.24 chart:major-interval-unit
The chart:major-interval-unit attribute specifies the unit of the major interval on a date axis.
The unit shall be the same as the chart:base-time-unit or greater.
19.24 chart:major-interval-value
The chart:major-interval-value attribute specifies the distance between two major interval marks on a date axis.
The major interval for a linear scaled axis is simply the distance between two major interval marks.
The major interval for logarithmic scales defines the distance in orders of magnitude between two major interval tick marks: let x1 and x2 be consecutive major tick marks, then the value of the attribute is the same as log(x2)-log(x1).
If the attribute is missing, the distance between major tick marks is chosen automatically by the consumer.
19.24 chart:minor-interval-value
The chart:minor-interval-value attribute specifies the number of minor intervals per major interval on a date axis.
If the attribute is missing, the distance between minor tick marks is chosen automatically by the consumer.
The value shall not be greater than the chart:major-interval-value.
19.24 chart:minor-interval-unit
The chart:minor-interval-unit attribute specifies the unit of the minor interval on a date axis.
The unit shall be the same as the chart:base-time-unit or greater.
--- Documents/odf/tc/OpenDocument-schema-v1.3-wd06-with-fixes.rng 2018-06-25 13:31:52.506732295 +0200 +++ Documents/odf/tc/2119-schema-v2.rng 2018-06-26 16:37:20.510991568 +0200 @@ -433,18 +433,41 @@ <rng:define name="character"> <rng:data type="string"> <rng:param name="length">1</rng:param> </rng:data> </rng:define> <rng:define name="chart-axis"> <rng:element name="chart:axis"> <rng:ref name="chart-axis-attlist"/> <rng:optional> + <rng:choice> + <rng:group> + <rng:attribute name="chart:axis-type"> + <rng:value>auto</rng:value> + </rng:attribute> + <rng:optional> + <rng:ref name="chart-date-scale"/> + </rng:optional> + </rng:group> + <rng:group> + <rng:attribute name="chart:axis-type"> + <rng:value>date</rng:value> + </rng:attribute> + <rng:ref name="chart-date-scale"/> + </rng:group> + <rng:group> + <rng:attribute name="chart:axis-type"> + <rng:value>text</rng:value> + </rng:attribute> + </rng:group> + </rng:choice> + </rng:optional> + <rng:optional> <rng:ref name="chart-title"/> </rng:optional> <rng:optional> <rng:ref name="chart-categories"/> </rng:optional> <rng:zeroOrMore> <rng:ref name="chart-grid"/> </rng:zeroOrMore> </rng:element> @@ -584,18 +607,45 @@ <rng:attribute name="chart:style-name"> <rng:ref name="styleNameRef"/> </rng:attribute> </rng:optional> <rng:optional> <rng:ref name="xml-id"/> </rng:optional> </rng:interleave> </rng:define> + <rng:define name="chart-date-scale"> + <rng:element name="chart:date-scale"> + <rng:interleave> + <rng:optional> + <rng:attribute name="chart:base-time-unit"> + <rng:ref name="chart-time-unit"/> + </rng:attribute> + </rng:optional> + <rng:optional> + <rng:attribute name="chart:major-interval-value"> + <rng:ref name="positiveInteger"/> + </rng:attribute> + <rng:attribute name="chart:major-interval-unit"> + <rng:ref name="chart-time-unit"/> + </rng:attribute> + </rng:optional> + <rng:optional> + <rng:attribute name="chart:minor-interval-value"> + <rng:ref name="positiveInteger"/> + </rng:attribute> + <rng:attribute name="chart:minor-interval-unit"> + <rng:ref name="chart-time-unit"/> + </rng:attribute> + </rng:optional> + </rng:interleave> + </rng:element> + </rng:define> <rng:define name="chart-dimension"> <rng:choice> <rng:value>x</rng:value> <rng:value>y</rng:value> <rng:value>z</rng:value> </rng:choice> </rng:define> <rng:define name="chart-domain"> <rng:element name="chart:domain"> @@ -939,18 +989,25 @@ </rng:define> <rng:define name="chart-subtitle"> <rng:element name="chart:subtitle"> <rng:ref name="chart-title-attlist"/> <rng:optional> <rng:ref name="text-p"/> </rng:optional> </rng:element> </rng:define> + <rng:define name="chart-time-unit"> + <rng:choice> + <rng:value>days</rng:value> + <rng:value>months</rng:value> + <rng:value>years</rng:value> + </rng:choice> + </rng:define> <rng:define name="chart-title"> <rng:element name="chart:title"> <rng:ref name="chart-title-attlist"/> <rng:optional> <rng:ref name="text-p"/> </rng:optional> </rng:element> </rng:define> <rng:define name="chart-title-attlist">
Show19.15 chart:axis-type The chart:axis-type attribute specifies if the axis values are interpreted as text, dates, or automatically by the consumer. If an axis type is set to “date” or has been set to “auto” and interpreted by the consumer to contain dates, the axis will rendered with the dates scaled across the axis and the data points placed at the corresponding date on the axis. If the attribute is missing, the default value is "auto". 11.10 chart:date-scale The <chart:date-scale> element specifies how an axis that contains date values is formatted. 19.15 chart:base-time-unit The chart:base-time-unit attribute specifies the smallest time unit that is displayed on the date axis. If the attribute is missing, the resolution is chosen automatically by the consumer. 19.24 chart:major-interval-unit The chart:major-interval-unit attribute specifies the unit of the major interval on a date axis. The unit shall be the same as the chart:base-time-unit or greater. 19.24 chart:major-interval-value The chart:major-interval-value attribute specifies the distance between two major interval marks on a date axis. The major interval for a linear scaled axis is simply the distance between two major interval marks. The major interval for logarithmic scales defines the distance in orders of magnitude between two major interval tick marks: let x1 and x2 be consecutive major tick marks, then the value of the attribute is the same as log(x2)-log(x1). If the attribute is missing, the distance between major tick marks is chosen automatically by the consumer. 19.24 chart:minor-interval-value The chart:minor-interval-value attribute specifies the number of minor intervals per major interval on a date axis. If the attribute is missing, the distance between minor tick marks is chosen automatically by the consumer. The value shall not be greater than the chart:major-interval-value. 19.24 chart:minor-interval-unit The chart:minor-interval-unit attribute specifies the unit of the minor interval on a date axis. The unit shall be the same as the chart:base-time-unit or greater. --- Documents/odf/tc/OpenDocument-schema-v1.3-wd06-with-fixes.rng 2018-06-25 13:31:52.506732295 +0200 +++ Documents/odf/tc/2119-schema-v2.rng 2018-06-26 16:37:20.510991568 +0200 @@ -433,18 +433,41 @@ <rng:define name="character"> <rng:data type="string"> <rng:param name="length">1</rng:param> </rng:data> </rng:define> <rng:define name="chart-axis"> <rng:element name="chart:axis"> <rng:ref name="chart-axis-attlist"/> <rng:optional> + <rng:choice> + <rng:group> + <rng:attribute name="chart:axis-type"> + <rng:value>auto</rng:value> + </rng:attribute> + <rng:optional> + <rng:ref name="chart-date-scale"/> + </rng:optional> + </rng:group> + <rng:group> + <rng:attribute name="chart:axis-type"> + <rng:value>date</rng:value> + </rng:attribute> + <rng:ref name="chart-date-scale"/> + </rng:group> + <rng:group> + <rng:attribute name="chart:axis-type"> + <rng:value>text</rng:value> + </rng:attribute> + </rng:group> + </rng:choice> + </rng:optional> + <rng:optional> <rng:ref name="chart-title"/> </rng:optional> <rng:optional> <rng:ref name="chart-categories"/> </rng:optional> <rng:zeroOrMore> <rng:ref name="chart-grid"/> </rng:zeroOrMore> </rng:element> @@ -584,18 +607,45 @@ <rng:attribute name="chart:style-name"> <rng:ref name="styleNameRef"/> </rng:attribute> </rng:optional> <rng:optional> <rng:ref name="xml-id"/> </rng:optional> </rng:interleave> </rng:define> + <rng:define name="chart-date-scale"> + <rng:element name="chart:date-scale"> + <rng:interleave> + <rng:optional> + <rng:attribute name="chart:base-time-unit"> + <rng:ref name="chart-time-unit"/> + </rng:attribute> + </rng:optional> + <rng:optional> + <rng:attribute name="chart:major-interval-value"> + <rng:ref name="positiveInteger"/> + </rng:attribute> + <rng:attribute name="chart:major-interval-unit"> + <rng:ref name="chart-time-unit"/> + </rng:attribute> + </rng:optional> + <rng:optional> + <rng:attribute name="chart:minor-interval-value"> + <rng:ref name="positiveInteger"/> + </rng:attribute> + <rng:attribute name="chart:minor-interval-unit"> + <rng:ref name="chart-time-unit"/> + </rng:attribute> + </rng:optional> + </rng:interleave> + </rng:element> + </rng:define> <rng:define name="chart-dimension"> <rng:choice> <rng:value>x</rng:value> <rng:value>y</rng:value> <rng:value>z</rng:value> </rng:choice> </rng:define> <rng:define name="chart-domain"> <rng:element name="chart:domain"> @@ -939,18 +989,25 @@ </rng:define> <rng:define name="chart-subtitle"> <rng:element name="chart:subtitle"> <rng:ref name="chart-title-attlist"/> <rng:optional> <rng:ref name="text-p"/> </rng:optional> </rng:element> </rng:define> + <rng:define name="chart-time-unit"> + <rng:choice> + <rng:value>days</rng:value> + <rng:value>months</rng:value> + <rng:value>years</rng:value> + </rng:choice> + </rng:define> <rng:define name="chart-title"> <rng:element name="chart:title"> <rng:ref name="chart-title-attlist"/> <rng:optional> <rng:ref name="text-p"/> </rng:optional> </rng:element> </rng:define> <rng:define name="chart-title-attlist">
i've done a substantive change to the proposed schema here: the LO implementation didn't match the proposed schema wrt. ordering of the element children in <chart:axis> so i've changed it so that the new <chart:date-scale> is before <chart:title>.
I have added an example from LibreOffice 7 using this type of axis in extended namespace.
Excel has a similar axis type.
I do not know the *office implementations, but of course to understand te spec I should not need to know it. What does "The chart:base-time-unit attribute specifies the smallest time unit that is displayed on the date axis. " mean? If I would like to half ticks every half-month what would I set this to? Since "month" is a variable length which month's length is used? etc.
In the LibreOffice example file NonAutomaticDateAxis.ods I moved teh starting date for the axis to 2018-12-31 and I get some unusual ticks. The fourth tick is at 2019-04-03
> What does "The chart:base-time-unit attribute specifies the smallest time unit that is displayed on the date axis. " mean?
Values between this unit are rounded down to this unit.
> If I would like to half ticks every half-month what would I set this to? Since "month" is a variable length which month's length is used?
LibreOffice restricts the base units to "day", "month" and "year" and allows only integer values as interval, so half-month ticks are not possible in LibreOffice. Excel behaves the same.
> In the LibreOffice example file NonAutomaticDateAxis.ods I moved teh starting date for the axis to 2018-12-31 and I get some unusual ticks. The fourth tick is at 2019-04-03
LibreOffice behavior is, to go from 2018-12-31 to 2019-01-31 to 2019-02-31. And as 2019-02-31 does not exist, us 2019-03-03 instead and then continue from there. Excel uses 2019-02-28 and then continues with 2019-03-31, which I think is a better solution for not existing dates.
The current proposal needs some work.
The information about how logarithmic scaling works, which is here part of 19.24 is missing too in ODF 1.2 for a value axis. I have made a proposal in
OFFICE-3936for it.I still think, that logarithmic scale should only be allowed for a value-axis.