Issue 82971 - Hierarchical axis labels
Summary: Hierarchical axis labels
Status: CLOSED FIXED
Alias: None
Product: General
Classification: Code
Component: chart (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: PC All
: P3 Trivial with 2 votes (vote)
Target Milestone: ---
Assignee: kla
QA Contact: issues@graphics
URL: http://specs.openoffice.org/chart/Cha...
Keywords: ms_interoperability
Depends on:
Blocks:
 
Reported: 2007-10-25 14:39 UTC by jrobiso2
Modified: 2015-11-09 17:30 UTC (History)
4 users (show)

See Also:
Issue Type: FEATURE
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Performance Timings (131.50 KB, application/vnd.ms-excel)
2007-10-25 14:40 UTC, jrobiso2
no flags Details
test document (43.00 KB, application/vnd.ms-excel)
2008-03-12 11:18 UTC, daniel.rentz
no flags Details
New test document showing differences between Excel 2003 and 2007 (48.00 KB, application/vnd.ms-excel)
2008-03-12 13:04 UTC, daniel.rentz
no flags Details
example test document with typical cases (36.00 KB, application/vnd.ms-excel)
2010-02-04 16:42 UTC, IngridvdM
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description jrobiso2 2007-10-25 14:39:36 UTC
If opened in MS Excel, the charts in this spreadsheet show proper labels/legends
under the vertical bars along the x-axis. A small label for each bar, larger for
bar sets. In OO 2.3.0.1.3, the bar labels are missing.
Comment 1 jrobiso2 2007-10-25 14:40:34 UTC
Created attachment 49156 [details]
Performance Timings
Comment 2 frank 2007-10-26 09:11:13 UTC
wrong component, changed to chart and re-assigned
Comment 3 kla 2007-11-26 09:14:10 UTC
@DR: Pls have a look.
Comment 4 kpalagin 2008-01-18 14:48:31 UTC
Confirming using m241 on WinXP - as described.
Comment 5 kyoshida 2008-03-11 17:33:35 UTC
I've been looking into this.  The reason for this bug is because Calc provides a
structured (i.e. 2-dimensional) category label data to chart2 but chart2 renders
the label serially.  So, we would need to add a way to pass a structured label
data from sc to chart2, and add support for rendering multi-layer category
labels in chart2's view code.
Comment 6 daniel.rentz 2008-03-12 11:16:33 UTC
Excel's behaviour is as follows (as far as I can see the system here...):

** Definitions:
- Category = one label on the X axis, refering to a data point in a series.
- Level = single row of category labels. May be stacked downwards. Level 1 is
nearest to X axis, level N is outermost.
- Category source = cell range(s) in spreadsheet used for category labels.
- Series source = cell range(s) in spreadsheet used for data point values of a
series.

If the category source is 1-dimensional (means: contains one single row or one
single column of cells), the cell values are applied category by category to the
X axis, regardless of the orientation of the series source.

If the category source is complex (means: 2-dimensional, or a list of cell
ranges, even if this list forms a single row or column!), it is used depending
on the orientation of the series source of the first series shown on the first
axes set (or second axes set in case of the secondary X axis).
- If the series source is horizontal (means: it contains at least one cell range
with more than 1 column), the category source is divided into single columns.
Each column represents one category on the X axis.
- If the series source is vertical (means: it contains only single-column cell
ranges and/or single cells), the category source is divided into single rows.
Each row represents one category on the X axis.

In case the category source is a range list, it is processed range by range from
the beginning, and row by row or column by column for each range. The number of
levels N on the X axis is the count of the largest row/column of the category
source.

For each category: Use the cells of the single rows/columns of the category
source from last cell (right/bottom) to first cell (left/top), and set the
category labels starting from level 1 (nearest X axis) toward level N, as long
as there are cells left. If there are less than N cells, the outer levels remain
empty.

Inside of one cell range of the category source, empty cells are used to merge
several categories in a level together. The merged range starts with a non-empty
label in the current level, and ends before the next non-empty label in the
current level or an higher level. The label is centered in the category range.
- Categories are NOT merged in level 1.
- Categories are NOT merged over different cell ranges in the category source,
even if the cells of the first row/column of the next range are empty.

Excel test document will be attached...
Comment 7 daniel.rentz 2008-03-12 11:18:46 UTC
Created attachment 52051 [details]
test document
Comment 8 daniel.rentz 2008-03-12 11:34:21 UTC
Note that Excel 2007 has changed its behaviour in this area. The description
above is for Excel 2003. If the attached document is loaded in Excel 2007, the
charts in the second and third sheet will not show all X axis labels, or will
show completely different labels...
Comment 9 daniel.rentz 2008-03-12 12:01:02 UTC
More updates about Excel 2007:

- Font spacing for axis labels has been changed, there is more space between the
levels now. That is the reason that the last level is missing in some charts on
the second sheet of the test document.

- Excel does NOT consider the orientation of the series source anymore. If the
category source is complex, it is ALWAYS processed horizontally, means column by
column. Therefore, in the text document, second and third sheet, the charts in
the right column are equal to the charts in the left column.
Comment 10 daniel.rentz 2008-03-12 12:07:23 UTC
- Excel 2007 merges the category labels over different source ranges, if they
contain empty cells or if some columns are shorter than others.
Comment 11 daniel.rentz 2008-03-12 13:02:53 UTC
Ok, again, complete specification for Excel 2007. Different behaviour to Excel
2003 is marked with (**).

If the category source is 1-dimensional (means: contains one single row or one
single column cells), the cell values are applied category by category to the X
axis, regardless of the orientation of the series source.

If the category source is complex (means: 2-dimensional, or a list of cell
ranges, even if this list forms a single row or column!), the category source is
divided into single columns (**). Each column represents one category on the X axis.

In case the category source is a range list, it is processed range by range from
the beginning, and column by column for each range. The number of levels N on
the X axis is the height of the largest column of the category source.

For each category: Use the cells of the single columns of the category source
from bottom cell to top cell, and set the category labels starting from level 1
(nearest X axis) toward level N, as long as there are cells left. If there are
less than N cells, the outer levels remain empty.

Empty cells are used to merge several categories in a level together. The merged
range starts with a non-empty label in the current level, and ends before the
next non-empty label in the current level or an higher level. The label is
centered in the category range.
- Categories are NOT merged in level 1.
- Categories ARE merged over different cell ranges in the category source (**).
even if the cells of the first row/column of the next range are empty.
- Categories are NOT merged in the free area, if there is not enough data to
fill all categories on the X axis (**).

If a level is completely empty, it will be skipped. The X axis will not show an
empty line beteeen other levels.

New test document will be attached...

I prefer the new behaviour, as it is not that complicated.
Comment 12 daniel.rentz 2008-03-12 13:04:19 UTC
Created attachment 52052 [details]
New test document showing differences between Excel 2003 and 2007
Comment 13 daniel.rentz 2008-03-12 13:41:31 UTC
DR->IHA: Filter does work correctly, chart implementation needs to be fixed.
Comment 14 kyoshida 2008-03-12 14:43:19 UTC
@dr: wow.  You're very thorough, as always. :-)
Comment 15 IngridvdM 2008-04-03 15:27:46 UTC
Made summary more descriptive, adjusted target, type and keyword
Comment 16 IngridvdM 2009-12-01 14:16:38 UTC
started
Comment 17 IngridvdM 2010-01-29 17:01:54 UTC
Fixed in CWS chartmultiline.
Added a new button to the charts own data table for creation of additional text
columns:
Changed specification http://specs.openoffice.org/chart/ChartDataDialog.odt
Wrote issue 108777 and issue 108778 for adaption of the test scripts and
documentation.
Comment 18 IngridvdM 2010-02-04 16:38:22 UTC
The algorithm implemented is straight forward:
If the categories do span multiple rows and multiple columns, the direction of
the first data series is detected. If the data for the first series comes from
rows, the categories are split into multiple rows. Otherwise the categories are
split into multiple columns. The split categories are then applied as different
hierarchical levels at the x-axis.
This algorithm does not produce exactly the same results for all the border
cases shown in the attached example document chart_sourcedata_category_.... But
at this state I assume that it is not worth the effort to make the algorithm
extreme complex for those exotic scenarios. Future may tell more.
I'll attach an example document showing more typical everyday examples
'HierarchicalAxesLabel.xls'.

Comment 19 IngridvdM 2010-02-04 16:42:33 UTC
Created attachment 67616 [details]
example test document with typical cases
Comment 20 IngridvdM 2010-02-05 13:34:37 UTC
A new interface ::com::sun::star::chart::XComplexDescriptionAccess was
introduced. It allows to set sequences of sequences of strings as row or column
descriptions for the tabular chart data. You can obtain the new interface by
method getData() at interface css.chart.XChartDocument.
Comment 21 IngridvdM 2010-02-05 15:51:43 UTC
@Thomas, please verify in CWS chartmultiline.
Comment 22 kla 2010-03-03 14:11:06 UTC
Seen ok in CWS chartmultiline -> verified
Comment 23 jrobiso2 2010-03-03 14:25:34 UTC
Wow. Lots of great work here guys.  Many thanks on behalf of the user community!
Comment 24 kla 2010-08-04 11:50:37 UTC
integrated -> closed