Home » Archived » BIRT » Bar chart with multiple axis
| |
Re: Bar chart with multiple axis [message #830748 is a reply to message #829632] |
Wed, 28 March 2012 02:38 |
|
Set the side by side field for the two y-axis. See attached report. If
using CE API use:
//do on both axis
yAxisPrimary.setSideBySide(true);
Jason
On 3/26/2012 11:23 AM, ing omini wrote:
> Hi everybody,
>
> I want to create a birt bar chart having:
> - a category x axis (example: product name)
> - two data series (example: number of purchases and total € amount)
>
> If I use a single y axis and choose "side by side" , the two series are
> displayed correctly, but not very readable because the two series have
> different value ranges (example: 0-100 for series1, 0-100.000 for series2).
>
> So I need to use multiple y axis. Here comes the problem: in the
> multiple axis mode, the bars belonging to the two data series are no
> more side by side, but overlapped.
>
> What can I do to have them side by side again?
>
> Thanks
>
>
-
Attachment: bar2axis.zip
(Size: 5.26KB, Downloaded 415 times)
|
|
| |
Re: Bar chart with multiple axis [message #832911 is a reply to message #832550] |
Fri, 30 March 2012 18:46 |
|
If you are doing this in the designer just use the gui. See attached
screenshot.
Jason
On 3/30/2012 5:15 AM, ing omini wrote:
> I have been using BIRT report designer for years on a basic level
> (dataset, "basic" charts, and so on..), but I am still a newbie (as you
> can see :d ) regarding BIRt scripting.
> That's why I am not sure I've understood correctly.
>
> Just to summarize: - inside my .rptdesign (created with BIRT designer
> version 2.3.2 ), I've added a bar chart with two series , to be
> displayed on multiple axis
> - in script tab, I inserted a new function:
>
>
> function beforeGeneration( chart, icsc )
> {
>
> var xAxis = chart.getAxes().get(0);
> var yAxisPrimary = xAxis.getAssociatedAxes().get(0);
> var yAxisSecondary = xAxis.getAssociatedAxes().get(1);
>
> yAxisPrimary.setSideBySide(true);
> yAxisSecondary.setSideBySide(true);
>
> }
>
>
>
> The returned error when generating the preview is
> " TypeError: Cannot find function setSideBySide. at line 8 of chart
> script:'' "
>
> What's my mystake??
>
> Thanks again
|
|
|
Re: Bar chart with multiple axis [message #832915 is a reply to message #832550] |
Fri, 30 March 2012 18:46 |
|
If you are doing this in the designer just use the gui. See attached
screenshot.
Jason
On 3/30/2012 5:15 AM, ing omini wrote:
> I have been using BIRT report designer for years on a basic level
> (dataset, "basic" charts, and so on..), but I am still a newbie (as you
> can see :d ) regarding BIRt scripting.
> That's why I am not sure I've understood correctly.
>
> Just to summarize: - inside my .rptdesign (created with BIRT designer
> version 2.3.2 ), I've added a bar chart with two series , to be
> displayed on multiple axis
> - in script tab, I inserted a new function:
>
>
> function beforeGeneration( chart, icsc )
> {
>
> var xAxis = chart.getAxes().get(0);
> var yAxisPrimary = xAxis.getAssociatedAxes().get(0);
> var yAxisSecondary = xAxis.getAssociatedAxes().get(1);
>
> yAxisPrimary.setSideBySide(true);
> yAxisSecondary.setSideBySide(true);
>
> }
>
>
>
> The returned error when generating the preview is
> " TypeError: Cannot find function setSideBySide. at line 8 of chart
> script:'' "
>
> What's my mystake??
>
> Thanks again
|
|
|
Re: Bar chart with multiple axis [message #832920 is a reply to message #832550] |
Fri, 30 March 2012 18:46 |
|
If you are doing this in the designer just use the gui. See attached
screenshot.
Jason
On 3/30/2012 5:15 AM, ing omini wrote:
> I have been using BIRT report designer for years on a basic level
> (dataset, "basic" charts, and so on..), but I am still a newbie (as you
> can see :d ) regarding BIRt scripting.
> That's why I am not sure I've understood correctly.
>
> Just to summarize: - inside my .rptdesign (created with BIRT designer
> version 2.3.2 ), I've added a bar chart with two series , to be
> displayed on multiple axis
> - in script tab, I inserted a new function:
>
>
> function beforeGeneration( chart, icsc )
> {
>
> var xAxis = chart.getAxes().get(0);
> var yAxisPrimary = xAxis.getAssociatedAxes().get(0);
> var yAxisSecondary = xAxis.getAssociatedAxes().get(1);
>
> yAxisPrimary.setSideBySide(true);
> yAxisSecondary.setSideBySide(true);
>
> }
>
>
>
> The returned error when generating the preview is
> " TypeError: Cannot find function setSideBySide. at line 8 of chart
> script:'' "
>
> What's my mystake??
>
> Thanks again
|
|
|
Re: Bar chart with multiple axis [message #832925 is a reply to message #832550] |
Fri, 30 March 2012 18:46 |
|
If you are doing this in the designer just use the gui. See attached
screenshot.
Jason
On 3/30/2012 5:15 AM, ing omini wrote:
> I have been using BIRT report designer for years on a basic level
> (dataset, "basic" charts, and so on..), but I am still a newbie (as you
> can see :d ) regarding BIRt scripting.
> That's why I am not sure I've understood correctly.
>
> Just to summarize: - inside my .rptdesign (created with BIRT designer
> version 2.3.2 ), I've added a bar chart with two series , to be
> displayed on multiple axis
> - in script tab, I inserted a new function:
>
>
> function beforeGeneration( chart, icsc )
> {
>
> var xAxis = chart.getAxes().get(0);
> var yAxisPrimary = xAxis.getAssociatedAxes().get(0);
> var yAxisSecondary = xAxis.getAssociatedAxes().get(1);
>
> yAxisPrimary.setSideBySide(true);
> yAxisSecondary.setSideBySide(true);
>
> }
>
>
>
> The returned error when generating the preview is
> " TypeError: Cannot find function setSideBySide. at line 8 of chart
> script:'' "
>
> What's my mystake??
>
> Thanks again
|
|
|
Re: Bar chart with multiple axis [message #832928 is a reply to message #832550] |
Fri, 30 March 2012 18:46 |
|
If you are doing this in the designer just use the gui. See attached
screenshot.
Jason
On 3/30/2012 5:15 AM, ing omini wrote:
> I have been using BIRT report designer for years on a basic level
> (dataset, "basic" charts, and so on..), but I am still a newbie (as you
> can see :d ) regarding BIRt scripting.
> That's why I am not sure I've understood correctly.
>
> Just to summarize: - inside my .rptdesign (created with BIRT designer
> version 2.3.2 ), I've added a bar chart with two series , to be
> displayed on multiple axis
> - in script tab, I inserted a new function:
>
>
> function beforeGeneration( chart, icsc )
> {
>
> var xAxis = chart.getAxes().get(0);
> var yAxisPrimary = xAxis.getAssociatedAxes().get(0);
> var yAxisSecondary = xAxis.getAssociatedAxes().get(1);
>
> yAxisPrimary.setSideBySide(true);
> yAxisSecondary.setSideBySide(true);
>
> }
>
>
>
> The returned error when generating the preview is
> " TypeError: Cannot find function setSideBySide. at line 8 of chart
> script:'' "
>
> What's my mystake??
>
> Thanks again
|
|
| |
Re: Bar chart with multiple axis [message #835717 is a reply to message #834663] |
Tue, 03 April 2012 15:33 |
|
I do not think 2.3.2 had this feature, but you can check the xml view
and do a search for <SideBySide> in the chart xml.
Jason
On 4/2/2012 4:25 AM, ing omini wrote:
> Unfortunately in my version (2.3.2.r232) the only options available
> under axis tab are:
> - visible
> - type
> - color
>
> "aligned" and "side by side" options are not available in the GUI
>
> is there any workaround to achieve the same effect?
>
>
> Thanks again!
|
|
|
Goto Forum:
Current Time: Fri Apr 26 19:14:58 GMT 2024
Powered by FUDForum. Page generated in 0.03138 seconds
|