Skip to main content



      Home
Home » Archived » BIRT » Change visibility of series programmatically
Change visibility of series programmatically [message #362366] Fri, 09 May 2008 06:40 Go to next message
Eclipse UserFriend
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 #362384 is a reply to message #362366] Fri, 09 May 2008 12:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

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.
>
>
>
Re: Change visibility of series programmatically [message #362619 is a reply to message #362384] Mon, 19 May 2008 12:52 Go to previous messageGo to next message
Eclipse UserFriend
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.
>>
>>
>>
Re: Change visibility of series programmatically [message #362625 is a reply to message #362619] Mon, 19 May 2008 15:28 Go to previous message
Eclipse UserFriend
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.
>>>
>>>
>>>
>
>
Previous Topic:How to have toc items indented ?
Next Topic:experienced developers ask dummy questions too : resolve oneToMany
Goto Forum:
  


Current Time: Sun Oct 26 12:20:10 EDT 2025

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

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

Back to the top