Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Hiding a zero-length bars in a stacked bar chart
Hiding a zero-length bars in a stacked bar chart [message #551132] Thu, 05 August 2010 11:13 Go to next message
Eclipse UserFriend
Originally posted by: remkus.wideopenwest.com

I'm constrained to using BIRT 2.2.1 by my implementation ...

I have a stacked bar chart with two series. I'm printing the value of
the series on the bar with a series value label.

If the second series is zero for a particular x-axis value, I get a '0'
printed on the bar chart. I'd like to be able to make that bar (and
label) not visible if the value of the bar is zero.

I've seen some other posts about highlighting a bar based on a parameter
and about hiding a series altogether, but I've been struggling with
making individual bars for a series not visible if their value is zero.

Thanks
Re: Hiding a zero-length bars in a stacked bar chart [message #551198 is a reply to message #551132] Thu, 05 August 2010 15:07 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Dave,

I just posted an example of this to dev share:
http://www.birt-exchange.org/org/devshare/designing-birt-rep orts/1245-hide-one-bar-in-a-chart-using-script/

The report is written in 2.5.2 but I posted the scripts in the comments
which should work for 2.2.1. Basically I just set the bar to transparent.

Jason

On 8/5/2010 7:13 AM, Dave Remkus wrote:
> I'm constrained to using BIRT 2.2.1 by my implementation ...
>
> I have a stacked bar chart with two series. I'm printing the value of
> the series on the bar with a series value label.
>
> If the second series is zero for a particular x-axis value, I get a '0'
> printed on the bar chart. I'd like to be able to make that bar (and
> label) not visible if the value of the bar is zero.
>
> I've seen some other posts about highlighting a bar based on a parameter
> and about hiding a series altogether, but I've been struggling with
> making individual bars for a series not visible if their value is zero.
>
> Thanks
Re: Hiding a zero-length bars in a stacked bar chart [message #551277 is a reply to message #551198] Thu, 05 August 2010 18:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: remkus.wideopenwest.com

Jason,

Great!!

This works beautifully for one of my charts ...

The other one, however, I've made my life more difficult by customizing
the label.

One of my charts has Y series Grouping and I've set the label with the
Value Data and Value Series Name.

So, I'm guessing that somehow overloads the label - the same scripting
that works so well for the simpler case has no effect ... but, other
than that, I'm lost.

Thanks

On 08/05/2010 11:07 AM, Jason Weathersby wrote:
> Dave,
>
> I just posted an example of this to dev share:
> http://www.birt-exchange.org/org/devshare/designing-birt-rep orts/1245-hide-one-bar-in-a-chart-using-script/
>
>
> The report is written in 2.5.2 but I posted the scripts in the comments
> which should work for 2.2.1. Basically I just set the bar to transparent.
>
> Jason
>
> On 8/5/2010 7:13 AM, Dave Remkus wrote:
>> I'm constrained to using BIRT 2.2.1 by my implementation ...
>>
>> I have a stacked bar chart with two series. I'm printing the value of
>> the series on the bar with a series value label.
>>
>> If the second series is zero for a particular x-axis value, I get a '0'
>> printed on the bar chart. I'd like to be able to make that bar (and
>> label) not visible if the value of the bar is zero.
>>
>> I've seen some other posts about highlighting a bar based on a parameter
>> and about hiding a series altogether, but I've been struggling with
>> making individual bars for a series not visible if their value is zero.
>>
>> Thanks
>
Re: Hiding a zero-length bars in a stacked bar chart [message #551283 is a reply to message #551198] Thu, 05 August 2010 19:17 Go to previous message
Eclipse UserFriend
Originally posted by: remkus.wideopenwest.com

Ahhhh! ....

OK .. I've figured out where I went sideways ....

I was comparing dph.getDisplayValue() == 0 .... not
dph.getOrthogonalValue == 0 in beforeDrawDataPointLabel. Once I
corrected that, things worked as expected.

Thanks

On 08/05/2010 11:07 AM, Jason Weathersby wrote:
> Dave,
>
> I just posted an example of this to dev share:
> http://www.birt-exchange.org/org/devshare/designing-birt-rep orts/1245-hide-one-bar-in-a-chart-using-script/
>
>
> The report is written in 2.5.2 but I posted the scripts in the comments
> which should work for 2.2.1. Basically I just set the bar to transparent.
>
> Jason
>
> On 8/5/2010 7:13 AM, Dave Remkus wrote:
>> I'm constrained to using BIRT 2.2.1 by my implementation ...
>>
>> I have a stacked bar chart with two series. I'm printing the value of
>> the series on the bar with a series value label.
>>
>> If the second series is zero for a particular x-axis value, I get a '0'
>> printed on the bar chart. I'd like to be able to make that bar (and
>> label) not visible if the value of the bar is zero.
>>
>> I've seen some other posts about highlighting a bar based on a parameter
>> and about hiding a series altogether, but I've been struggling with
>> making individual bars for a series not visible if their value is zero.
>>
>> Thanks
>
Previous Topic:Table header/footer/detail style issues
Next Topic:Group Header
Goto Forum:
  


Current Time: Tue Apr 23 13:15:16 GMT 2024

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

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

Back to the top