Issue 26795

Summary: display bars on different axis next to each other
Product: General Reporter: moltis17 <moltis>
Component: chartAssignee: kla <thomas.klarhoefer>
Status: CLOSED FIXED QA Contact: issues@graphics <issues>
Severity: Trivial    
Priority: P3 CC: bjoern.milcke, issues, pagalmes.lists, stevej, tony.galmiche.ooo, weizhao
Version: 3.3.0 or older (OOo)Keywords: rfe_eval_ok
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
URL: http://specs.openoffice.org/chart/BarChartOptions.odt
Issue Type: FEATURE Latest Confirmation in: ---
Developer Difficulty: ---
Issue Depends on:    
Issue Blocks: 72764    
Attachments:
Description Flags
sample file for the problem also showing a possible workaround using overlapping bars
none
basic sample file. note that a secondary y-axis is important as soon as the data sequences have a significant different scale.
none
effect of new method
none
the patch
none
revised patch
none
new patch
none
issue26795_070830 patch
none
TCS Bar Chart Option none

Description moltis17 2004-03-22 10:26:03 UTC
Created a simple diagram to show PRECIPITATION and TEMPERATURE in course of a
year. X-Axis was "MONTHS" (Jan-Dec), Y-Axis was PRECIPIATION. As diagram type I
selected the one showing bars for PRECIPITATION and TEMPERATURE next to each
other  for each months.

So far so good. However, when I assigned the TEMPERATURE values the "Secondary
Y-Axis", the bars of TEMPERATURE samples now appeared on top of the bars of
PRECIPIATION samples (the primary Y-Axis)! 

Also, the heading TEMPERATURE did not appear on the right side on the secondary
Y-Axis as I would have expected.
Comment 1 frank 2004-03-22 11:41:51 UTC
Hi,

this is submitted under the wrong component. It's Chart not Spreadsheet. I've
corrected this.

Frank
Comment 2 kla 2004-03-23 13:02:12 UTC
Hi Bettina,
one for you.
kla
Comment 3 stevejump 2004-06-25 12:37:23 UTC
I can confirm this defect still exists in OOo1.1.1   tested on Linux, XP, W2K

Any data assigned to 2nd Y axis is displayed behind 1st Y axis data.  There is
no way to place/display bars side by side.

Can provide repeatable examples if this will help.

SteveJump
Comment 4 bettina.haberer 2004-11-29 18:18:25 UTC
Reassigned to Ingrid.
Comment 5 IngridvdM 2005-04-19 09:53:58 UTC
Displaying bars next to each other is more useful than displaying them behind
each other. This is also valid if the bars are scaled at different axis. We
should introduce a posiibility to do this.
Comment 6 moltis17 2005-10-04 16:55:25 UTC
I forgot to mention that MS Excel 2003 displays them next to each other as it
should be. Showing them behind each other simply is not useful at all in most cases.
Comment 7 moltis17 2005-10-04 16:56:31 UTC
Created attachment 30116 [details]
sample file for the problem also showing a possible workaround using overlapping bars
Comment 8 moltis17 2005-10-04 16:58:02 UTC
Created attachment 30118 [details]
basic sample file. note that a secondary y-axis is important as soon as the data sequences have a significant different scale.
Comment 9 IngridvdM 2005-10-10 18:05:11 UTC
Hi Moltis, thanks for the example files. The problem is clear I think. But I
have a question regarding Excel. What are you exactly doing within MS Excel 2003
that you get your bars displayed next to each other if they are at different
axes. I am asking because I cannot reproduce that. Thanks for your help!
Comment 10 moltis17 2005-10-10 22:01:05 UTC
Hi Ingrid! I'm very sorry. My statement about how Excel 2003 displays it was not
first hand, but came from a step-by-step solution description of a student
homework task. Obviously I misinterpreted the instructions, because Excel 2003
does not any better than OO so far. I just tried it on a customer system I
happen to have in house at the moment - I do not own MS Office myself - why
should I since there is OO  :).

Nevertheless, no reason not to go beyond what Microsoft currently offers.  :)

I suggest to add a parameter to shift a data sequence in respect to others
and/or a check box to show them next to each other - same as in a normal bar
graph diagram.

Sorry again!
Moltis
Comment 11 IngridvdM 2005-10-11 13:27:40 UTC
No problem. Thanks for the fast response. I tend to implement something like a
checkbox only. I fear that an extra flexible shift value produces to much
confusion as we do already have two other values that influence the positions of
bars in respect to each other. Maybe we can collect some extra opinions here.
Feel free to comment.
Comment 12 IngridvdM 2006-06-12 10:25:29 UTC
changed target in prio
Comment 13 bjoern.milcke 2006-06-23 14:04:22 UTC
Changed Target to 2.x
Comment 14 bjoern.milcke 2006-06-23 14:16:17 UTC
Target set to Later
Comment 15 bjoern.milcke 2006-06-23 14:37:07 UTC
Ok, 3.0 seems more appropriate
Comment 16 bjoern.milcke 2006-10-23 21:49:21 UTC
*** Issue 70745 has been marked as a duplicate of this issue. ***
Comment 17 IngridvdM 2007-04-03 18:00:40 UTC
changed target to 2.x
Comment 18 IngridvdM 2007-06-19 10:13:48 UTC
hint for development:
First we need a check box, where the user can switch to the new modus.
A good place might be the options tabpage of the data series properties dialog
in case of 2D bar charts.
The source code for this tabpage is in:
chart2/source/controller/dialogs/tp_SeriesToAxis.hxx
chart2/source/controller/dialogs/tp_SeriesToAxis.cxx
chart2/source/controller/dialogs/tp_SeriesToAxis.src
chart2/source/controller/dialogs/TabPages.hrc
Look how the implementation works for the similar checkbox CB_CONNECTOR on the
same page (visible only in case of 2D stacked bar or column charts) and try to
introduce the new checkbox 'CB_GROUP_BARS_PER_AXIS'.
Comment 19 IngridvdM 2007-07-10 09:37:24 UTC
hint for development:
Now the information must be stored in the model. We want to keep the boolean
information once for the whole chart. Add a new boolean property to the diagram
and call it 'GroupBarsPerAxis'. Look how this is done for the similar property
'ConnectBars' in chart2/source/model/main/Daigram.cxx.
Comment 20 weiz 2007-07-17 04:15:08 UTC
Hi, bm & iha

I have added a checkbox to the data series dialog, and add a new boolean 
property call 'GroupBarsPerAxis' for the checkbox to the diagram, it works 
well. I have modified the function BarChart::createShapes() to show the bars or 
columns which attached to 2nd y axis next to each other. Please see the effect 
at the attached issue26795.pdf. Is the effect right?
I meet a problem when I try to save and load the property of the checkbox, I 
have added XML_GROUP_BARS_PER_AXIS to xmltoken.cxx, xmltoken.hxx and 
PropertyMap.cxx, it is compiled successfully, but it does not work.
Could you give some suggests about that? Thank you very much!

Regards,
Weizhao
Comment 21 weiz 2007-07-17 04:25:24 UTC
Created attachment 46846 [details]
effect of new method
Comment 22 bjoern.milcke 2007-07-17 08:52:18 UTC
Adding bm to CC
Comment 23 IngridvdM 2007-07-17 09:42:12 UTC
For saving and loading the standard chart API ::com::sun::star::chart is used
for most of the objects. There are wrappers for this older API in
chart2/source/controller/chartapiwrapper/. We need the new property
'GroupBarsPerAxis' also at the DiagramWrapper. Look how this is done for the
similar property 'StackedBarsConnected'. I think you will not need the line with 
'aWrappedProperties.push_back( new WrappedProperty ....'
because the new property is exactly the same in the new and in the old API.
Comment 24 IngridvdM 2007-07-19 11:01:04 UTC
changed target
Comment 25 weiz 2007-07-25 06:15:19 UTC
Hi, bm & iha

The attached is the patch of this issue. 
If you have any question or suggestion, please let me konw.
Thank you very much.

BTW: My email is: weiz@ch2000.com.cn

Best regards,
Weizhao
Comment 26 weiz 2007-07-25 06:16:15 UTC
Created attachment 47070 [details]
the patch
Comment 27 IngridvdM 2007-07-25 22:46:57 UTC
Hi weiz. Thanks, the patch is almost fine :-). But there are some points to
improve still:
- SCHATTR_END must be set to the new define SCHATTR_GROUP_BARS_PER_AXIS
- the changes in BarChart.cxx are too complicated, try to change only the method
BarChart::addSeries by replacing the comment "////if( bars side by side ) zSlot
= 0; //@todo uncomment this later on dependent on new flag" with:
if( !pSeries->getGroupBars() )
            zSlot = 0;
-in the method ChartTypeHelper::isSupportingGroupBars()
it would be more save to check eStackMode != StackMode_NONE
-The default for GroupBarsPerAxis is true. GroupBarsPerAxis == true should
represent the behavior that we had without this feature: The bars were grouped
per y-axes.
- So the method should better be named
ChartTypeHelper::isSupportingNotToGroupBarsPerAxis()
- I think it would be better to not shorten 'GroupBarsPerAxis' to 'GroupBars' as
the latter can be misinterpreted more easily
- consider to not offer the setting when all series are attached to the same
axis, because there is no visible effect then
- finally it's easier to compile when you add the new token at the end of the
token list in xmloff. Otherwise consider to use an alphabetical place and make
an incompatible build from xmloff.
Hope I haven't overseen anything.
Looking forward to the next version :-)

 
Comment 28 weiz 2007-07-26 02:38:26 UTC
Hi, iha

Thanks very much for your great help. I will improve the patch according to 
your suggestion, and I will submit it again if I finish the modify. :-)
Comment 29 weiz 2007-08-13 08:16:53 UTC
Hi bm & iha,

The attached is the revised patch according to your suggestions. 
I have added some new functions to disable the check box when all series are 
attached to the same axis.
It seems work well, but I am not sure that these new functions are added to the 
suitable place. :-)
If you have any suggestion, please email me.
Thank you very much.


Regards,
Weizhao
Comment 30 weiz 2007-08-13 08:18:28 UTC
Created attachment 47502 [details]
revised patch
Comment 31 weiz 2007-08-23 09:20:19 UTC
Hi bm & iha,

This is the new patch for this issue.
The major changes are as follow:
-Remove the unused two static variables and functions in last patch.
-Use two bool variables 'm_bSupportingNotToGroupBarsPerAxis' 
and 'm_bAllSeriesAttachedToSameAxis' to determine whether the new check box 
displayed on the tab page.

Please let me know if you have any suggestion. Thanks very much. :-)

Best Regards,
Weizhao
Comment 32 weiz 2007-08-23 09:21:58 UTC
Created attachment 47741 [details]
new patch
Comment 33 weiz 2007-08-31 02:59:42 UTC
Hi bm,

This is the latest patch for this issue. Pleae find the final attachment.

Best regards,
Weizhao
Comment 34 weiz 2007-08-31 03:00:39 UTC
Created attachment 47894 [details]
issue26795_070830 patch
Comment 35 bjoern.milcke 2007-08-31 14:48:01 UTC
weiz: I'll take over this issue.
Comment 36 bjoern.milcke 2007-08-31 15:26:53 UTC
Note that there is one small open issue:

Imagine that all series are attached to the first axis except one series that is
attached to the second one. Then you edit the properties of that one series that
is on the second axis. You attach it to the first axis, then the "group bars by
axis" will not be disabled.

I think this is a minor issue. To solve this, we would have to pass the entire
model to the dialog, which I want to avoid for now. (Or pass quite complicated
data to the dialog).
Comment 37 bjoern.milcke 2007-08-31 15:28:43 UTC
->weiz: Thanks a lot for your patch!

reassigning to bm.
Comment 38 bjoern.milcke 2007-10-02 12:24:49 UTC
Please verify in CWS chart14
Comment 39 bjoern.milcke 2007-10-02 12:34:43 UTC
Of course, this issue is fixed.
Comment 40 kla 2007-10-04 10:50:49 UTC
*** Issue 82237 has been marked as a duplicate of this issue. ***
Comment 41 kla 2007-10-10 10:19:10 UTC
The feature doesn't correspond with the Settings for Spacing and Overlap.
Comment 42 kla 2007-10-10 10:31:07 UTC
.
Comment 43 IngridvdM 2007-10-10 10:49:03 UTC
When the new feature is used (check side by side), setting overlap and gapwifth
does not work as expected.
Comment 44 IngridvdM 2007-10-11 10:20:44 UTC
I fixed the following in addition:
Overlap and gapwifth do work now also when the bars are shown next to each
other. The remaining problem was, that the bars have used different settings for
overlap and gap width from the different axes. Now when switching on the new
feature in the dialog the settings for overlap and gapwidth are applied equally
to both axes.
And in addition in the view there is a mechanism to ensure that the same values
are used for all bars.
Comment 45 IngridvdM 2007-10-11 16:45:23 UTC
->Thomas, please verify in CWS chart14.
Comment 46 kla 2007-10-18 11:07:46 UTC
Created attachment 48996 [details]
TCS Bar Chart Option
Comment 47 kla 2007-10-18 11:28:24 UTC
works fine in cws chart14 -> verified
Comment 48 kla 2008-03-13 13:08:12 UTC
Seen ok in the current version -> closed