Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Enabling study layout in JavaScript generated axes
Enabling study layout in JavaScript generated axes [message #709023] Wed, 03 August 2011 12:09 Go to next message
pickle_supreme is currently offline pickle_supreme
Messages: 13
Registered: July 2011
Junior Member
My report has a set of line charts, each of which needs to be annotated with additional series that are created based on the parameter selection. The logic behind it is currently residing in beforeFactory() and dataset's onFetch() method. Rather than just adding the new line series to the main section of the chart, I want to create an additional Y-axis with study layout (as introduced in BIRT 2.5) and add my new line series to it. This is the shortened version of the code:

cht = reportContext.getDesignHandle().findElement("All criteria chart");
mychart = cht.getReportItem().getProperty( "chart.instance" );
xAxis =mychart.getAxes().get(0);

yAxis1 = xAxis.getAssociatedAxes().get(0);
yAxis2 = AxisImpl.create( Axis.ORTHOGONAL );

xAxis.getAssociatedAxes( ).add( yAxis2 );
//mychart.setStudyLayout(true);

//create new line series here...

This works and adds the new line series, but as soon as I set the Study Layout, the axis labels and markers for existing axes (xAxis and yAxis1) dissappear!

Any idea what is going wrong?
Re: Enabling study layout in JavaScript generated axes [message #709137 is a reply to message #709023] Wed, 03 August 2011 14:27 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Take a look at this example.

Jason


On 8/3/2011 8:09 AM, vasa.curcin wrote:
> My report has a set of line charts, each of which needs to be annotated
> with additional series that are created based on the parameter
> selection. The logic behind it is currently residing in beforeFactory()
> and dataset's onFetch() method. Rather than just adding the new line
> series to the main section of the chart, I want to create an additional
> Y-axis with study layout (as introduced in BIRT 2.5) and add my new line
> series to it. This is the shortened version of the code:
>
> cht = reportContext.getDesignHandle().findElement("All criteria chart");
> mychart = cht.getReportItem().getProperty( "chart.instance" );
> xAxis =mychart.getAxes().get(0);
>
> yAxis1 = xAxis.getAssociatedAxes().get(0);
> yAxis2 = AxisImpl.create( Axis.ORTHOGONAL );
>
> xAxis.getAssociatedAxes( ).add( yAxis2 );
> //mychart.setStudyLayout(true);
>
> //create new line series here...
>
> This works and adds the new line series, but as soon as I set the Study
> Layout, the axis labels and markers for existing axes (xAxis and yAxis1)
> dissappear!
>
> Any idea what is going wrong?
Re: Enabling study layout in JavaScript generated axes [message #709160 is a reply to message #709137] Wed, 03 August 2011 15:14 Go to previous messageGo to next message
pickle_supreme is currently offline pickle_supreme
Messages: 13
Registered: July 2011
Junior Member
Thanks Jason. I copied all the steps, the two things missing were shifting the series palette and invoking yAxis2.getSeriesDefinitions().clear(), however the problem still remains. Could the issue be caused by the X axis being grouped on dates? It doesn't affect the non-study layout though.
Re: Enabling study layout in JavaScript generated axes [message #709200 is a reply to message #709160] Wed, 03 August 2011 16:02 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Are you using optional grouping or just the normal grouping on x-axis?
Can you try setting the labels explicitly:
yAxis.setType( AxisType.LINEAR_LITERAL );
yAxis.getMajorGrid( ).setTickStyle( TickStyle.RIGHT_LITERAL );
yAxis.setLabelPosition( Position.RIGHT_LITERAL );

Also try to add the second axis in the guid and put a series on it. Do
the labels show up then?

Jason

On 8/3/2011 11:14 AM, vasa.curcin wrote:
> Thanks Jason. I copied all the steps, the two things missing were
> shifting the series palette and invoking
> yAxis2.getSeriesDefinitions().clear(), however the problem still
> remains. Could the issue be caused by the X axis being grouped on dates?
> It doesn't affect the non-study layout though.
Re: Enabling study layout in JavaScript generated axes [message #709263 is a reply to message #709200] Wed, 03 August 2011 17:57 Go to previous message
pickle_supreme is currently offline pickle_supreme
Messages: 13
Registered: July 2011
Junior Member
I am using normal grouping on X-axis.

When I add a second axis using the Designer (using different data for the second series, but same starting chart), the behaviour is exactly the same, e.g. it appears normal when study view is deselected, but as soon as I switch it on the labels disappear from the X-axis and the original Y-axis.
Previous Topic:Calculate Cumulative value in cross tab
Next Topic:Disable default styles
Goto Forum:
  


Current Time: Thu Sep 18 09:44:31 GMT 2014

Powered by FUDForum. Page generated in 0.02787 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software