On Monday 02 April 2007, Lars Oppermann wrote:
> Dear TC members,
>
> I am forwarding the attached roposal created by the OpenOffice.org-Chart
> development team concerning automatic data label positions in charts for
> inclusion into OpenDocument 1.2...
Very nice document, full of explanatory pictures ;)
In KDChart we have a few more possibilities for label positions: north-west,
north-east, south-east and south-west. Could those be added to this attribute?
In fact the way it works in KDChart is:
1. find the position point (center, north, north-west, north-east, east, etc. : 9 points)
2. align to that point (right-alignment, left-alignment, center alignment, and the same vertically: top, bottom, vcenter)
3. add a horiz/vert gap (distance between the point and the label)
On top of that, there are two sets of position/alignment information: one for positive
values and one for negative values.
This allows to model what you called "north" as "north for positive and north for negative",
and what you called "outside" as "north for positive and south(+bottom alignment) for negative".
Separating the position/alignment information for positive and negative seems like a more flexible
design since it allows more combinations than just those in your proposal.
My proposal is therefore to split this attribute into four attributes ;)
* chart:label-position-positive-values: (center, north, north-west, north-east, east, etc. 9 points in all, plus auto)
* chart:label-alignment-positive-values: { left, right, or hcenter } + { top, bottom or vcenter }
* chart:label-position-negative-values: (center, north, north-west, north-east, east, etc. 9 points in all, plus auto)
* chart:label-alignment-negative-values: { left, right, or hcenter } + { top, bottom or vcenter }
(I didn't look it up; do we have something for h+v alignment already in ODF?)
Or maybe two attributes, horizontal alignment and vertical alignment.
For each value you suggest for label-auto-position, here's what the above 4 attributes would say, instead:
near-origin: south position with hcenter+top alignment, and north position with hcenter+bottom alignment
center: center position with hcenter+vcenter alignment
(maybe we can remove "positive-" from the first two attribute names, and say that the apply
to both positive and negative values if *-negative-values isn't specified? I don't mind.).
north: north position with hcenter+top alignment
south: south position with hcenter+top alignement
west: west position with left+vcenter alignment
east: east position with right+vcenter alignment
inside: north position with hcenter+bottom alignment, south position with hcenter+top alignment
outside: north position with hcenter+top alignment, south position with hcenter+bottom alignment
Ah what about the pie charts? We would have to say that "north is towards the outside"
and "south is towards the center", for instance. Or the other way round, as long as it's defined.
I realize that a general-purpose charting engine like KDChart (http://www.kdab.net/kdchart, which koffice uses)
aims for much more flexibility than a charting functionality in an office suite (the koffice component certainly
doesn't give the user all the above flexibility). However it seems that the best solution is to give the full
flexibility in the XML, so that it can be used by everone, and still provide to the office suite user only a few
combinations. The underlying charting engine can either support all combinations or be limited to
those that the user can choose, but at least the document format allows for more cases later without
50 combinations being expressed in a single attribute.
--
David Faure, faure@kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).