Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » dynamic series symbol and titles in legend
dynamic series symbol and titles in legend [message #367601] Wed, 25 March 2009 00:34 Go to next message
mh10 is currently offline mh10Friend
Messages: 16
Registered: July 2009
Junior Member
Hi,
i have line graph with three lines/ series on it.
Now In legend it shows symbols for these three series.
But i just want to show only one symbol for one line in legend, i don't
want to show series symbol for remaining to 2 lines, All three lines will
be displayed on chart though.


Any suggestions?


Thanks
Re: dynamic series symbol and titles in legend [message #367621 is a reply to message #367601] Thu, 26 March 2009 17:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Can you try something like:

if(
lerh.getLabel().getCaption().getValue().compareToIgnoreCase( "series2")
== 0 ){

bounds.setHeight(0);
bounds.setWidth(0);
lerh.getLabel().setVisible(false);

}

Jason

mh10 wrote:
> Hi,
> i have line graph with three lines/ series on it.
> Now In legend it shows symbols for these three series.
> But i just want to show only one symbol for one line in legend, i don't
> want to show series symbol for remaining to 2 lines, All three lines
> will be displayed on chart though.
>
>
> Any suggestions?
>
>
> Thanks
>
Re: dynamic series symbol and titles in legend [message #640024 is a reply to message #367621] Thu, 18 November 2010 17:14 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 23
Registered: August 2010
Junior Member
Jason,
This solution creates an empty space at the position that the hidden labels are. Is there a way to remove the empty space?

Thanks
Re: dynamic series symbol and titles in legend [message #640032 is a reply to message #640024] Thu, 18 November 2010 17:35 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

I assume you mean the empty space vertically between two other legend
entries? If so use something like this:
This example assumes you have 3 series in the legend like
series3
series2
series1

and you want to remove series2 and bump up series1



boundsH=0;
boundsW=0;
boundsT=0;
boundsL=0;

function beforeDrawLegendItem(lerh, bounds, icsc)
{

if(
lerh.getLabel().getCaption().getValue().compareToIgnoreCase( "series2")
== 0 ){

boundsL = bounds.getLeft();
boundsT = bounds.getTop();
boundsH = bounds.getHeight();
boundsW = bounds.getWidth();

bounds.setHeight(0);
bounds.setWidth(0);
lerh.getLabel().setVisible(false);

}else{
lerh.getLabel().setVisible(true);
}

if(
lerh.getLabel().getCaption().getValue().compareToIgnoreCase( "series1")
== 0 ){
tempBoundsT = bounds.getTop();
bounds.setTop(boundsT);
boundsT= tempBoundsT;
}


}

Jason

On 11/18/2010 12:14 PM, asadanandan@axiomainc.com wrote:
> Jason, This solution creates an empty space at the position that the
> hidden labels are. Is there a way to remove the empty space?
>
> Thanks
Re: dynamic series symbol and titles in legend [message #640043 is a reply to message #640032] Thu, 18 November 2010 19:27 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 23
Registered: August 2010
Junior Member
Jason,
Thanks for the solution. I also wanted to know how the same space issue can be avoided on the chart (eg: if I am hiding a series in a bar chart, an empty space appears between 2 bars)

Thanks
Re: dynamic series symbol and titles in legend [message #640047 is a reply to message #640043] Thu, 18 November 2010 19:29 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Are you basing this on a report parameter? Why not just drop the series
completely?

On 11/18/2010 2:27 PM, asadanandan@axiomainc.com wrote:
> Jason,
> Thanks for the solution. I also wanted to know how the same space issue
> can be avoided on the chart (eg: if I am hiding a series in a bar chart,
> an empty space appears between 2 bars)
>
> Thanks
Re: dynamic series symbol and titles in legend [message #640062 is a reply to message #640047] Thu, 18 November 2010 21:08 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 23
Registered: August 2010
Junior Member
Yes- so that a series can be hidden at runtime. In which case I have this issue of blank spaces in the chart as well as legend...
Re: dynamic series symbol and titles in legend [message #640206 is a reply to message #640062] Fri, 19 November 2010 14:59 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Take a look at this example. It removes the series instead of hiding it.

Jason

On 11/18/2010 4:08 PM, asadanandan@axiomainc.com wrote:
> Yes- so that a series can be hidden at runtime. In which case I have
> this issue of blank spaces in the chart as well as legend...
Re: dynamic series symbol and titles in legend [message #640220 is a reply to message #640206] Fri, 19 November 2010 16:00 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 23
Registered: August 2010
Junior Member
Jason,
I'm sorry, but did you attach it somewhere? I couldn't view the example in the previous post..

Thanks
Re: dynamic series symbol and titles in legend [message #640226 is a reply to message #640220] Fri, 19 November 2010 16:30 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Sorry about that!

http://www.birt-exchange.org/org/devshare/designing-birt-rep orts/1289-remove-chart-series-based-on-parameter/

Jason

On 11/19/2010 11:00 AM, asadanandan@axiomainc.com wrote:
> Jason,
> I'm sorry, but did you attach it somewhere? I couldn't view the example
> in the previous post..
>
> Thanks
Re: dynamic series symbol and titles in legend [message #640278 is a reply to message #640226] Fri, 19 November 2010 21:28 Go to previous message
No real name is currently offline No real nameFriend
Messages: 23
Registered: August 2010
Junior Member
Thanks Jason
Previous Topic:Tomcat 5.5 + birt
Next Topic:how to get selected check box report
Goto Forum:
  


Current Time: Fri Dec 19 20:16:29 GMT 2014

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

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