Issue 95934

Summary: Excel chart with percent-stacked data series is not rendered correctly
Product: General Reporter: kyoshida
Component: chartAssignee: AOO issues mailing list <issues>
Status: ACCEPTED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: IngridvdM, issues, mseidel, oooforum, stx123
Version: 3.3.0 or older (OOo)Keywords: ms_interoperability
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: PATCH Latest Confirmation in: ---
Developer Difficulty: ---
Issue Depends on: 95714    
Issue Blocks:    
Attachments:
Description Flags
test file 1
none
test file 2
none
test file 3
none
proposed patch for chart2
none
proposed patch for sc none

Description kyoshida 2008-11-06 17:09:53 UTC
When importing an Excel document with chart that has percent-stacked data series
mixed with a non-percent-stacked one, chart2 does not render it correctly.  This
causes an interoperability issue.
Comment 1 kyoshida 2008-11-06 17:12:05 UTC
Created attachment 57749 [details]
test file 1
Comment 2 kyoshida 2008-11-06 17:12:39 UTC
Created attachment 57750 [details]
test file 2
Comment 3 kyoshida 2008-11-06 17:13:17 UTC
Created attachment 57751 [details]
test file 3
Comment 4 kyoshida 2008-11-06 17:15:59 UTC
This issue depends on Issue 95714.
Comment 5 kyoshida 2008-11-06 17:18:23 UTC
accepting the issue.
Comment 6 kyoshida 2008-11-13 21:07:28 UTC
Created attachment 57982 [details]
proposed patch for chart2
Comment 7 kyoshida 2008-11-13 21:07:52 UTC
Created attachment 57983 [details]
proposed patch for sc
Comment 8 kyoshida 2008-11-13 21:10:47 UTC
Let's shoot this for 3.2.
Comment 9 stx123 2009-02-04 07:45:27 UTC
Hi, is this still on track for 3.2?
Comment 10 kyoshida 2009-02-05 21:59:56 UTC
Yes.  But this may potentially need an extension in the ODF spec.  The bad news
is that the ODF TC is closed for new proposal right now, prepping for 1.2
release.  So, it will depend on whether this requires a ODF extension, and if
so, when we can get an approval from the TC.
Comment 11 kyoshida 2009-02-05 22:26:13 UTC
BTW, I think this is for Ingrid, but this change requires two new properties in
chart2.ChartType object "Stacked" and "Percent", while the properties with the
same names in the Diagram object are deprecated.  That's the only way to support
this change since Excel's chart allows stack mode per chart, not per diagram.
Comment 12 kyoshida 2009-04-24 16:36:02 UTC
Ok.  I'm not sure if I can make this in for 3.2.  Re-targeting it to 3.x.
Comment 13 kyoshida 2009-10-02 14:12:11 UTC
registered this issue with koheichart02.  I will also look into what kind of
change we need to make in the ODF file format....
Comment 14 kyoshida 2010-03-11 01:32:33 UTC
There is one problem with handling ODF import and export.  Right now, ODF
doesn't have the concept of chart types.  The chart:series element, which stores
individual data series, occurs immediately below the chart:plot-area element. 
But for the mixed-type charts to be stored correctly we need to store the chart
types themselves.  Ideally the element for the chart types, say,
chart:chart-type, needs to be below the chart:plot-area but the parent of the
chart:series elements.

So, instead of storing

<chart:plot-area>
    ...
    <chart:series/>
    <chart:series/>
    <chart:series/>
    ...
</chart:plot-area>

as we currently do, we need to store it as

<chart:plot-area>
    ...
    <chart:chart-type>
        <chart:series/>
        <chart:series/>
    </chart:chart-type>
    <chart:chart-type>
        <chart:series/>
    </chart:chart-type>
    ...
</chart:plot-area>

Using this structure is also very similar to how the chart model is structured
internally, so it only makes sense to do it this way.

This only issue with this is obviously the ODF backward compatibility &
potential delay in getting (pre-)approval from the TC.  But to me, this is the
best way to approach this.
Comment 15 kyoshida 2010-03-11 04:49:50 UTC
I have a better idea.

<style:style style:name="ch10" style:family="chart">
    <style:chart-properties chart:stacked="true" ... />
</style:style>
...
<chart:plot-area>
    ...
    <chart:type chart:class="chart:bar" chart:style-name="ch10"/>
    <chart:series chart:class="chart:bar"/>
    <chart:series chart:class="chart:bar"/>
    <chart:series chart:class="chart:line"/>
    ...
</chart:plot-area>

Instead of having a new parent element nest the chart:series elements, we can
add a new sibling element "chart:type" which defines some additional attributes
for the used chart type(s).  This one is less intrusive & will probably mesh
well with the current XML structure.
Comment 16 kyoshida 2010-03-11 05:36:36 UTC
A 3rd version...

<style:style style:name="ch10" style:family="chart">
    <style:chart-properties chart:stacked="true" ... />
</style:style>
...
<chart:plot-area>
    ...
    <chart:class chart:name="chart:bar" chart:style-name="ch10"/>
    <chart:series chart:class="chart:bar"/>
    <chart:series chart:class="chart:bar"/>
    <chart:series chart:class="chart:line"/>
    ...
</chart:plot-area>

Instead of chart:type, use chart:class as the element name, and use chart:name
attribute to name it.

This <chart:class> element should be present only when the specified chart type
has some non-default attributes.
Comment 17 kyoshida 2010-03-11 13:42:13 UTC
@iha: Ingrid, does the last version of the XML structure look good to you?  Do
you have any better ideas?
Comment 18 IngridvdM 2010-03-11 16:49:18 UTC
@kohei, the percentage flag does affect the y-axis. As long as we have only one
percentage flag this is no problem. If we now have different percentage flags
for the same axis the handling needs to be specified.
Moreover the old excel is buggy in doing here. It displays a value of 88 (from a
not stacked series) as 88% at the percentage axis (example
simplePercentStacked.xls). This is wrong. The newer excel version displays the
88 correct at 8800%.
So if you load the example files in a more recent excel version you will see
that the result is again unexpected for the user.
All in all I am not convinced that this feature (relying on bugs in old excel)
is worth the effort... .
Anyhow for the concrete file format issue, why not using the stacked properties
directly at the series? For the pure stacked property this is much nearer to the
current implementation and from the schema it would be allowed right now already.
Comment 19 Rob Weir 2013-07-30 02:36:04 UTC
Reset assignee on issues not touched by assignee in more than 1000 days.
Comment 20 oooforum (fr) 2021-12-15 19:39:49 UTC
Status changed: 2 patches has been proposed
Somebody to push these?