OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

office message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [office] Chart proposal [legend-position]


Hi David,

David Faure wrote:

>Another proposal for charts: the position of the legend should be extended
>to more than bottom/right/left/top.
>
>As you can see in the attached screenshots, even for 'bottom right' case has
>3 possibilities.
>
>The full set of values I'm suggesting is the one coming from the XSD file for KDChart, 
>which I posted some time ago:
>
>  
>
[...]  Legend values:
NoLegend
Top Bottom Left Right
TopLeft TopLeftTop TopLeftLeft
TopRight TopRightTop TopRightRight
BottomLeft  BottomLeftBottom BottomLeftLeft
BottomRight BottomRightBottom BottomRightRight

>To be honest I can't really understand those descriptions (and match them to the enum name and to the pictures).
>Pretty hard to describe this accurately...
>Maybe the naming scheme used here should be revised a little. Is there anything
>in the file format already, that could be used for this?
>  
>
I've discussed this with other developers, and have a clearer 
understanding of what this is trying to accomplish:

When you auto-position objects in a chart, you need to determine 1) 
where to put the object, and 2) how other objects react to this. Number 
2) is very easy to determine for side placements, since there is only 
one sensible 'reaction' to this. For the corners, there are multiple 
sensible reactions, namely three each. The KChart format codes this all 
into a single value (plus one for no legend). Below, I will suggest two 
ways of encoding it using two values. In each case I will not include a 
value for 'no legend', since I think this should be defined by the 
absence of a chart:legend element, not by a style property.

First, a more detailed explanation of the different placements. I will 
try to use ASCII art, where
L   desginates the legend
C   the chart area
r   .

+---------+
|CCCCCC   |
|CCCCCC   | The easy case: legend placed on the right side.
|CCCCCC LL| The chart move to the left. All area to the right
|CCCCCC LL| is reserved for the legend.
|CCCCCC   |
|CCCCCC   |
+---------+


+---------+
|CCCCCC   |
|CCCCCC   | The easy case: legend placed on the right side.
|CCCCCC LL| The chart move to the left. All area to the right
|CCCCCC LL| is reserved for the legend.
|CCCCCC   |
|CCCCCC   |
+---------+

Now, when we want to put the legend into the lower right corner,
then we have three ways of how the chart can react: 1) Move to the left
to make room for the chart on the right. 2) Move to the top, to make 
room for the chart at the bottom. 3) Or move to the top-left.

Case 1)        Case 2)       Case 3)
+---------+    +---------+   +---------+
|CCCCCC   |    |CCCCCCCCC|   |CCCCCC   |
|CCCCCC   |    |CCCCCCCCC|   |CCCCCC   |
|CCCCCC   |    |CCCCCCCCC|   |CCCCCC   |
|CCCCCC   |    |CCCCCCCCC|   |CCCCCC   |
|CCCCCC LL|    |       LL|   |       LL|
|CCCCCC LL|    |       LL|   |       LL|
+---------+    +---------+   +---------+

Note that in each case, the legend is at the lower right. What 
is different is how the main chart area is placed. David's
suggestion puts this into a single value (BottomRightRight, 
BottomRightBottom, and BottomRight, respectively).


The first (and I think more elegant) to put this into two values
would be to specify the main placement in four directions (just 
like now), but add an alignment attribute. Example: placement is right, 
and alignment is any of start/center/end.

+---------+   +---------+   +---------+
|CCCCCC LL|   |CCCCCC   |   |CCCCCC   | 
|CCCCCC LL|   |CCCCCC   |   |CCCCCC   | 
|CCCCCC   |   |CCCCCC LL|   |CCCCCC   | 
|CCCCCC   |   |CCCCCC LL|   |CCCCCC   | 
|CCCCCC   |   |CCCCCC   |   |CCCCCC LL| 
|CCCCCC   |   |CCCCCC   |   |CCCCCC LL| 
+---------+   +---------+   +---------+

These three would correspond to KOffice's TopRightRight, Right, and 
BottomRightRight. The good thing is that this new alignemnt would be an 
additional hint, and applications would get reasonable results even
if they wouldn't know how to interpret the alignment.

The problem with this suggestion is that the corner case (e.g. BottomRight) 
don't really fit in. These are arguably the least useful of the cases 
(because they leave so little room for the chart itself); they could 
be accomodated by making an additional alignment values such as 
corner-clockwise, which would place the legend into the next corner 
(clockwise) from the main position. That is, admittedly, a bit ugly.


A different way of encoding the placement options would be to make one 
(or two) attributes for the eight placement positions 
(top, left, bottom, right, top-left, top-right, bottom-left, bottom-right) 
or (top, center, bottom and left, center, right), and add an attribute
that says which additional space the legeng claims.

E.g. from the three cases above, the legend position would be bottom-right,
and the claim-space attribute would say vertical (case 1), horizontal 
(case 2), and both (case 3). This accomodates the corner-cases nicely,
but somehow seems less elegant to me.

Case 1)        Case 2)       Case 3)
+---------+    +---------+   +---------+
|CCCCCC   |    |CCCCCCCCC|   |CCCCCC   |
|CCCCCC   |    |CCCCCCCCC|   |CCCCCC   |
|CCCCCC   |    |CCCCCCCCC|   |CCCCCC   |
|CCCCCC   |    |CCCCCCCCC|   |CCCCCC   |
|CCCCCC LL|    |       LL|   |       LL|
|CCCCCC LL|    |       LL|   |       LL|
+---------+    +---------+   +---------+


So, my proposal for this problem would be the first proposal (without the 
corners); I'm not sure this will be acceptable for David, though. :-)


Sincerely,
Daniel




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]