Home » Archived » BIRT » Max y-axis value on split bar chart (birt 2.6.2)
| |
Re: Max y-axis value on split bar chart [message #906092 is a reply to message #905178] |
Fri, 31 August 2012 11:49   |
Eclipse User |
|
|
|
Thanks Jason,
I tried the example you provided, unfortunately, it cannot solve the issue. I think I should give more detail description:
1. adding dataSet column [matTotal]to the table header (the bar chart in the table)
2. onRender:
reportContext.setGlobalVariable("maxscale",this.getValue());
(this is good, I get maxscale is 67, for example)
3. beforeGeneration:
yscale.setMax( NumberDataElementImpl.create(icsc.getExternalContext().getScriptable().getGlobalVariable("maxscale")) );
(the issue is here, the max scale value is not always 67 on each page, it dynamically changes depend on the maxscale for that page, see the attachments above).
So, how can I let all pages keep same max scale value(i.e. 67)?
Thanks
Shusen
[Updated on: Fri, 31 August 2012 11:50] by Moderator
|
|
|
Re: Max y-axis value on split bar chart [message #906206 is a reply to message #906092] |
Fri, 31 August 2012 16:57   |
Eclipse User |
|
|
|
If you want all to have the same max scale just do a check to see if the
variable exists if it does not, set it only on the first oncreate (not
onrender) script and persist it.
if( reportContext.getPersistentGlobalVariable("maxscal") == null ){
reportContext.setPersistentGlobalVariable("maxscale",this.getValue());
}
Jason
On 8/31/2012 11:49 AM, Shusen Zhang wrote:
> Thanks Jason,
>
> I tried the example you provided, unfortunately, it cannot solve the
> issue. I think I should give more detail description:
> 1. adding dataSet column [matTotal]to the table header (the bar chart in
> the table)
> 2. onRender:
> reportContext.setGlobalVariable("maxscale",this.getValue());
> (this is good, I get maxscale is 67, for example)
> 3. beforeGeneration:
> yscale.setMax(
> NumberDataElementImpl.create(icsc.getExternalContext().getScriptable().getGlobalVariable("maxscale"))
> );
> (the issue is here, the max scale value is not always 67 on each
> page, it dynamically changes depend on the maxscale for that page, see
> the attachments above).
>
> So, how can I let all pages keep same max scale value(i.e. 67)?
>
|
|
| | |
Re: Max y-axis value on split bar chart [message #908593 is a reply to message #908145] |
Wed, 05 September 2012 12:03  |
Eclipse User |
|
|
|
According to the bugzilla entry this was fixed. You may want to add a
comment to the bug. You could always write a beforeDrawAxisLabel script
to trim the lengths as well.
Jason
On 9/4/2012 4:33 PM, Shusen Zhang wrote:
> Jason Weathersby wrote on Fri, 31 August 2012 16:57
>> If you want all to have the same max scale just do a check to see if
>> the variable exists if it does not, set it only on the first oncreate
>> (not onrender) script and persist it.
>>
>> if( reportContext.getPersistentGlobalVariable("maxscal") == null ){
>> reportContext.setPersistentGlobalVariable("maxscale",this.getValue());
>> }
>>
>> Jason
>>
>> >
>
>
> Thanks Jason, this is exactly what I want.
>
> I have another similar question on the same report: from my first
> question you can see the x-axis position is vary on each page accordance
> with the max length of the category label, now I want to fix x-axis
> position.
>
> What should I do?
>
> I tried to use fixed label span on third tab manually, it seems like the
> Bug 314708 still exist when I tested it on 3.7.2 runtime.
>
>
>
>
|
|
|
Goto Forum:
Current Time: Wed Apr 30 12:32:45 EDT 2025
Powered by FUDForum. Page generated in 0.10614 seconds
|