| Change visibility of series programmatically [message #362366] |
Fri, 09 May 2008 06:40  |
Eclipse User |
|
|
|
Hallo!
How can I hide the siries per Scripting?
Following script don't work:
function beforeRendering(gcs, icsc)
{
icsc.getChartInstance().getAxes().get(0).getSeriesDefinition s().get(1).setVisible(false);
}
Were can I read about Chart object model? Axes, Series, SeriesDefinitions
etc.
|
|
|
|
|
| Re: Change visibility of series programmatically [message #362625 is a reply to message #362619] |
Mon, 19 May 2008 15:28  |
Eclipse User |
|
|
|
Originally posted by: jasonweathersby.alltel.net
Andre,
It may be good to log this as a bug.
As a work around do this in the beforeGeneration
function beforeGeneration(chart, icsc)
{
importPackage( Packages.org.eclipse.birt.chart.model.attribute );
xAxis = chart.getBaseAxes()[0];
yAxis = chart.getOrthogonalAxes( xAxis, true)[0]
//use 0 in the following for the first series and 1
//for the second series
seriesDef = yAxis.getSeriesDefinitions().get(0)
runSeries = seriesDef.getRunTimeSeries();
firstRunSeries = runSeries.get(0);
firstRunSeries.setVisible(false);
}
Jason
Andre Dubrovsky wrote:
> Thans for your help, Jason.
> But if I combine your solution with legend, this produce corrupted chart.
> If I hide "seriesone" the legend show even "seriesone" and not
> "seriestwo" as expected.
> Bug?
>
> What can I use as workaround for this?
>
> My BIRT version is 2.2.2 (stable)
>
> Jason Weathersby wrote:
>
>> Andre,
>
>> You can do it the beforedrawseries like:
>
>> function beforeDrawSeries(series, isr, icsc)
>> {
>> if( series.getSeriesIdentifier() == "seriestwo" ){
>> series.setVisible(false);
>> }else{
>> series.setVisible(true);
>> }
>> }
>
>> Jason
>
>> Andre Dubrovsky wrote:
>>> Hallo!
>>>
>>> How can I hide the siries per Scripting?
>>>
>>> Following script don't work:
>>> function beforeRendering(gcs, icsc)
>>> {
>>>
> icsc.getChartInstance().getAxes().get(0).getSeriesDefinition s().get(1).setVisible(false);
>
>>>
>>> }
>>>
>>> Were can I read about Chart object model? Axes, Series,
>>> SeriesDefinitions etc.
>>>
>>>
>>>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.07141 seconds