|
Re: Enabling study layout in JavaScript generated axes [message #709137 is a reply to message #709023] |
Wed, 03 August 2011 14:27 |
|
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 #709200 is a reply to message #709160] |
Wed, 03 August 2011 16:02 |
|
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.
|
|
|
|
Powered by
FUDForum. Page generated in 0.05123 seconds