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 13:07 Go to next message
Mike Wulkan is currently offline Mike WulkanFriend
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 14:44 Go to previous messageGo to next message
Mike Wulkan is currently offline Mike WulkanFriend
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 15:27 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
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?
Re: (no subject) [message #699002 is a reply to message #698986] Wed, 20 July 2011 16:11 Go to previous messageGo to next message
Mike Wulkan is currently offline Mike WulkanFriend
Messages: 141
Registered: July 2009
Senior Member
Thanks, that did the trick.
Re: (no subject) [message #1338823 is a reply to message #699002] Wed, 07 May 2014 11:43 Go to previous messageGo to next message
Syed Shah is currently offline Syed ShahFriend
Messages: 13
Registered: April 2014
Junior Member
Hi,

The link given in the above post http://www.birt-exchange.org/org/devshare/designing-birt-reports/1289-remove-chart-series-based-on-parameter/ seems to have been removed. Can someone please give a correct like of this post or the sample file in it as I also need to remove few series based on parameter

Regards
Syed
Re: (no subject) [message #1371878 is a reply to message #1338823] Wed, 21 May 2014 15:26 Go to previous message
Kristopher Clark is currently offline Kristopher ClarkFriend
Messages: 130
Registered: January 2013
Senior Member
Syed Shah wrote:
> Hi,
>
> The link given in the above post
> http://www.birt-exchange.org/org/devshare/designing-birt-reports/1289-remove-chart-series-based-on-parameter/
> seems to have been removed. Can someone please give a correct like of
> this post or the sample file in it as I also need to remove few series
> based on parameter
>
> Regards
> Syed

Hi Syed, this link looks like what you're looking for
http://developer.actuate.com/community/forum/index.php?/files/file/401-remove-chart-series-based-on-parameter/

-Kris
Previous Topic:"Find" issue in XML source- page jumping back to top
Next Topic:How to populate environment/schema-aware (or dynamically established) data sets for BIRT report
Goto Forum:
  


Current Time: Mon Nov 24 04:21:08 GMT 2014

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

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