Proposal Coordinate Region

Summary

Proposal owner:

Regina Henschel

Proposal short name:

Chart position excluding labels

Rationale

Use cases:

Allow exact position of coordinate system of the chart, independent from e.g. size of numbers.
See https://bz.apache.org/ooo/show_bug.cgi?id=100778

This feature is included in ApacheOpenOffice and LibreOffice in private namespace. It was implemented in OpenOffice.org April 2011.

Alternatives considered:

No, this kind of positioning is approved.

Requested changes to the ODF Standard

This proposal is based on the text in https://wiki.openoffice.org/wiki/Chart2/ChartPositioningExludingLabels , which was written when implementing this feature in OpenOffice.org.

Text changes/additions in description part of the standard

11.?? <chart:coordinate-region>

The attributes of the <chart:coordinate-region> element specify together a positioning rectangle.

For charts with a two-dimensional Cartesian coordinate system, the used intervals on the axes span a rectangular coordinate-region. Axis labels, tick marks, axis titles and data labels are not considered in determining the coordinate-region. The coordinate system is scaled so that the coordinate-region matches width and height of the positioning rectangle. The entire chart is located, so that the coordinate-region matches the positioning rectangle.

Charts of the predefined classes chart:radar, chart:filled-radar, chart:circle and chart:ring do not have a Cartesian coordinate system. For such charts the smallest bounding circle is considered, ignoring all axis labels, tick marks, axis titles and data labels. The rectangular bounding box of this circle is the coordinate-region. Where single data points have a chart:pie-offset greater zero those offset shall not contribute to an expansion of the coordinate-region; thus a pulled out pie segment is allowed to protrude from the coordinate-region. A chart:pie-offset at the series element in contrast shall contribute to the coordinate region.

Circle or ring or the polar coordinate system of radar-charts respectively is uniformly scaled, so that the coordinate-region has maximal size, but does not exceed the size of the positioning rectangle. The entire chart is located, so that the coordinate-region is centered in the positioning rectangle. Producers should specify a square positioning rectangle for charts of these classes.

The behavior for the three-dimensional charts is described in section 11.5

The behavior is implementation-defined for charts of non-predefined chart classes, which have no Cartesian coordinate system.

The generated gray text would be:

The <chart:coordinate-region> element is usable with the following element: <chart:plot-area> 11.4.

The <chart:coordinate-region> element has the following attributes: svg:height 19.539.x, svg:width 19.571.x, svg:x 19.573.x and svg:y 19.577.x.


The first paragraph is the already existing text, the others are added.

11.5 3D Plot Area

The plot area may be displayed as a 3D scene as specified in section 10.5.2. All 3D attributes that can be applied to the <dr3d:scene> element can be applied to the <chart:plot-area> element. This includes the dr3d:transform attribute that specifies the rotation of the three-dimensional plot area. 10.5.2 The <chart:plot-area> element may contain a <dr3d:light> element as specified in section 10.5.3.

The svg:x, svg:y, svg:width and svg:height attributes specify together a positioning rectangle that serves as viewport for the projection of the scene. Consumers shall use uniform scaling, so that the projection has maximal size but does not exceed the size of the positioning rectangle. The projection of the scene is centered inside the positioning rectangle.

If the <chart:plot-area> element contains a <chart:coordinate-region> element, the position and size values of the <chart:coordinate-region> element are used instead of those from the <chart:plot-area> to determine the positioning rectangle.

For three-dimensional charts of classes chart:circle and chart:ring the content is extruded. The bounding box as described in 11.?? is extruded the same way and used instead of the entire scene for to position and scale the projection.

For charts with a three-dimensional Cartesian coordinate system, the used intervals on the axes generate a cuboid. This is used instead of the entire scene for to position and scale the projection.

For other three-dimensional charts the behavior is implementation-defined.


19.539.2 <chart:plot-area>
The svg:height attribute defines the height of the plot-area including axis labels.


19.539.?? <chart:coordinate-region>
The svg:height attribute defines the height of a positioning rectangle, see 11.??.

The generated gray text would be:

The svg:height attribute is usable with the following element: <chart:coordinate-region> 11.??.

The svg:height attribute has the data type length 18.3.18.


19.571.3 <chart:plot-area>
The svg:width attribute defines the width of a plot-area including axis labels.


19.571.?? <chart:coordinate-region>
The svg:width attribute defines the width of a positioning rectangle, see 11.??.

The generated gray text would be:

The svg:width attribute is usable with the following element: <chart:coordinate-region> 11.??.

The svg:width attribute has the data type length 18.3.18.


19.573.?? <chart:coordinate-region>
The svg:x attribute specifies the horizontal distance of the upper left corner of the <chart:coordinate-region> element from the upper left corner of the <chart:chart> element.

The generated gray text would be:

The svg:x attribute is usable with the following element: <chart:coordinate-region> 11.??.

The svg:x attribute has the data type coordinate 18.3.10.


19.577.?? <chart:coordinate-region>
The svg:y attribute specifies the vertical distance of the upper left corner of the <chart:coordinate-region> element from the upper left corner of the <chart:chart> element.

The generated gray text would be:

The svg:y attribute is usable with the following element: <chart:plot-area> 11.??.

The svg:y attribute has the data type coordinate 18.3.10.


In section 11.4 <chart:plot-area> add the following paragraphs.

If an element <chart:coordinate-region> is present, the attributes svg:x, svg:y, svg:width and svg:height at the element <chart:plot-area> shall be ignored.

If the attributes chart:auto-position and chart:auto-size within a chart style applied to the chart:plot-area have the value true, all positioning attributes including those within child element <chart:coordinate-region> shall be ignored.

The list of child elements would be changed to

The <chart:plot-area> element has the following child elements: <chart:axis> 11.8, <chart:coordinate-region> 11.x, <chart:floor> 11.7, <chart:series> 11.11, <chart:stock-gain-marker> 11.19, <chart:stock-loss-marker> 11.20, <chart:stock-range-line> 11.21, <chart:wall> 11.6 and <dr3d:light> 10.5.3.

Schema changes/additions

Add the new optional element <chart:coordinate-region> to <chart:plot-area>

<define name="chart-plot-area">
    <element name="chart:plot-area">
        <ref name="chart-plot-area-attlist"/>
        <optional>
            <ref name="chart-coordinate-region"/>
        </optional>
        <zeroOrMore>
            <ref name="dr3d-light"/>
        </zeroOrMore>
        <zeroOrMore>
            <ref name="chart-axis"/>
        </zeroOrMore>
        <zeroOrMore>
            <ref name="chart-series"/>
        </zeroOrMore>
        <optional>
            <ref name="chart-stock-gain-marker"/>
        </optional>
        <optional>
            <ref name="chart-stock-loss-marker"/>
        </optional>
        <optional>
            <ref name="chart-stock-range-line"/>
        </optional>
        <optional>
            <ref name="chart-wall"/>
        </optional>
        <optional>
            <ref name="chart-floor"/>
        </optional>
    </element>
  </define>

Add the define for the new element <chart:coordinate-region> and its attributes

<define name="chart-coordinate-region">
    <element name="chart:coordinate-region">
        <ref name="chart-coordinate-region-attlist"/>
        <empty/>
    </element>
  </define>
  <define name="chart-coordinate-region-attlist" combine="interleave">
    <ref name="common-draw-position-attlist"/>
    <ref name="common-draw-size-attlist"/>
  </define>

Impacts

Conformance:

No impact, the new element is optional.

Backwards compatibility:

Producers might write the position and size attributes of the <chart:plot-area> in addition, so that older consumers, which do not know the new element, show the same position and size.

Accessibility impact:

No impact.

Workflow (to be filled in by TC Chairs)

Category: CategoryNewProposal

Date Proposal initially made:

Dates Proposal discussed on TC calls:

Date vote is requested:

Date vote is held:

Results of vote:

ProposalCoordinateRegion (last edited 2017-08-30 13:31:18 by regina.henschel)