Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 248540 - Can't align zero point on chart with two y-axes
Summary: Can't align zero point on chart with two y-axes
Status: VERIFIED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: 2.3.0   Edit
Hardware: PC Windows XP
: P2 enhancement with 1 vote (vote)
Target Milestone: 2.5.0 M5   Edit
Assignee: Yi Wang CLA
QA Contact: Xiaoying Gu CLA
URL:
Whiteboard: Obsolete
Keywords:
: 247128 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-09-25 04:38 EDT by Anthony CLA
Modified: 2009-03-31 04:43 EDT (History)
3 users (show)

See Also:


Attachments
Report containing a chart showing the problem (54.86 KB, application/octet-stream)
2008-09-25 04:38 EDT, Anthony CLA
no flags Details
screen snapshot (88.93 KB, image/jpeg)
2008-12-29 05:10 EST, Xiaoying Gu CLA
no flags Details
screen snapshot (151.15 KB, image/jpeg)
2008-12-29 05:10 EST, Xiaoying Gu CLA
no flags Details
report-design (54.86 KB, application/octet-stream)
2008-12-30 01:45 EST, Xiaoying Gu CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony CLA 2008-09-25 04:38:44 EDT
Created attachment 113440 [details]
Report containing a chart showing the problem

I'm working on a chart. My dataset has two series, both with positive and negative numbers, with for example series one being in the range -200 to 200, and the other -20 to 40 (but those values change, so I need the scale to be dynamic).

If I have a chart with two series, with different scales, there doesn't seem to be a way to have them use separate scales, have them side by side, and have the zero point of y-axis-1 level with the zero point of y-axis-2. I want this so it's easy to see which values are positive, and which are negative.

So I see two issues:
1) I've selected "Side-by-side" bar chart as the type, and the bars are still on top of each other.

2) I can't get the zero point on the two axes to align.

Example report using the sample database attached.

Expected result: The yellow and blue bars should be next to each other, not on top of each other.  The 0 point on the LHS axis should be level with the zero point on the RHS axis.  The gridlines should line up with the ticks on *both* sides so the gridlines make sense for both axes.
Comment 1 Yulin Wang CLA 2008-09-27 05:29:42 EDT
There's a workaround to align zero point with two y axes.
You could set same absolute value min/max to axis scale so that zero point could be in the middle of axes.

Regarding enhancements, will add two options in ChartWithAxes model.

For side-by-side series to multiple y axes, add a boolean option like "isAxisAccumulated" or better name. 
Default value is false, that means side-by-side or stacked series only affects each axis and the latter axis's series will overlap the first. This is similar to current behavior, which is useful for different chart types, like Bar+Line combination. 
If set to true, all axes' series will be side-by-side or stacked together. This is useful for same chart types like this case.

For zero point alignment, add a boolean option like "isOriginAligned".
Default value is false. If set to true, all numerical y axes' origin will be aligned. Due to multiple y axes' coordinates complexity, the common behavior is to set origin in the middle of axis.
If one y axis is datetime type, this option is invalid and should be disabled.

Note that these two options are only enabled for more than one y axis. These could be put FormatChart->Axis subtask page.
Comment 2 Yulin Wang CLA 2008-10-20 03:07:02 EDT
*** Bug 247128 has been marked as a duplicate of this bug. ***
Comment 3 Yi Wang CLA 2008-10-23 21:59:42 EDT
- Added Boolean properties "Aligned" and "SideBySide" to the model of Axis.
- In the sub page "Format Chart"->Axis both check boxes "Aligned" and "SideBySide" were added to modify the properties.
- The zero points of all the linear axes whose "Aligned" is set will be aligned. The "Aligned" check box will be enabled only when the axis is of type linear, and the default value is false.
- The "Side by Side" check box will be enabled only when the axis is of Bar-like(Bar, Tube Cone, Pyramid) series type. The data points (bar) of all the axes whose "Side by Side" is set, will be displayed side by side instead of overlaid.
Comment 4 Xiaoying Gu CLA 2008-12-15 03:06:32 EST
Verified in daily build 2.5.0.v20081215-0630.
Comment 5 Xiaoying Gu CLA 2008-12-29 05:09:07 EST
The zero point wasn't aligned in daily build 20081229. Reopen it.

When the chart was resized, the zero points will be un-aligned. See the snapshot.
Comment 6 Xiaoying Gu CLA 2008-12-29 05:10:17 EST
Created attachment 121302 [details]
screen snapshot
Comment 7 Xiaoying Gu CLA 2008-12-29 05:10:40 EST
Created attachment 121303 [details]
screen snapshot
Comment 8 Yulin Wang CLA 2008-12-29 23:31:21 EST
Did you use new API to align two y axes? By default, it's not enabled.
Could you attach report?
Comment 9 Xiaoying Gu CLA 2008-12-30 01:45:45 EST
Created attachment 121329 [details]
report-design
Comment 10 Yulin Wang CLA 2008-12-30 03:17:24 EST
I can reproduce. It seems the first Y axis is not correct.
Comment 11 Yi Wang CLA 2009-01-04 03:43:53 EST
Fixed.
Comment 12 Xiaoying Gu CLA 2009-01-14 02:28:58 EST
Verified in daily build <2.5.0.v20090113-0630>.