Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » showing/hiding a series based on data values?
showing/hiding a series based on data values? [message #698911] Wed, 20 July 2011 09:07 Go to next message
Mike Wulkan is currently offline Mike Wulkan
Messages: 141
Registered: July 2009
Senior Member
Hi,

I have a chart that has a series that uses data value X. I would like to hide the entire series legend entry and all (ie., like it didn't exist) if the first data value of X is null. How can I best do this?
Re: showing/hiding a series based on data values? [message #698956 is a reply to message #698911] Wed, 20 July 2011 10:44 Go to previous messageGo to next message
Mike Wulkan is currently offline Mike Wulkan
Messages: 141
Registered: July 2009
Senior Member
I took a look at:
http://www.birt-exchange.org/org/devshare/designing-birt-reports/1289-remove-chart-series-based-on-parameter/
from another post. It gets me close in that it allows me to remove the series, but now the issue is that the condition for removal is derived from a dataset not a report parameter and I don't think I have access to this in the beforeFactory method of the report.

I could put a hidden table in the report and set a global parameter but I'm not sure that this would be done in the correct order?
(no subject) [message #698986 is a reply to message #698956] Wed, 20 July 2011 11:27 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Mike,

You can move the code from the beforeFactory to the beforeGeneration of
the chart like:


function beforeGeneration( chart, icsc )
{
//to get the reportContext use
//rpCtx = icsc.getExternalContext().getScriptable();
//rpCtx.getParameterValue(.. or rpCtx.getGlobalVariable
//to decide which series to remove
xAxis =chart.getAxes().get(0);
yAxis1 = xAxis.getAssociatedAxes().get(0);

//yAxis1.getSeriesDefinitions().remove( 1 );
//yAxis1.getSeriesDefinitions().remove( 0 );
}

Jason

On 7/20/2011 10:44 AM, Mike Wulkan wrote:
> I took a look at:
> http://www.birt-exchange.org/org/devshare/designing-birt-reports/1289-remove-chart-series-based-on-parameter/
>
> from another post. It gets me close in that it allows me to remove the
> series, but now the issue is that the condition for removal is derived
> from a dataset not a report parameter and I don't think I have access to
> this in the beforeFactory method of the report.
>
> I could put a hidden table in the report and set a global parameter but
> I'm not sure that this would be done in the correct order?


Jason Weathersby

BIRT Exchange
Re: (no subject) [message #699002 is a reply to message #698986] Wed, 20 July 2011 12:11 Go to previous message
Mike Wulkan is currently offline Mike Wulkan
Messages: 141
Registered: July 2009
Senior Member
Thanks, that did the trick.
Previous Topic:Birt and Hive
Next Topic:Birt connexion to Hive
Goto Forum:
  


Current Time: Mon Apr 21 11:43:06 EDT 2014

Powered by FUDForum. Page generated in 0.01841 seconds