Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Selectively disabling bar chart hyperlinks
moflopes
Hello all, first time poster here.
So I got this problem, in my stacked bar chart, I have 3 series, and 2 of them are zeroes, one is a tiny strip but there's data there. All 3 series are hyperlinked. When I click it, it sends wrong parameters, as if I clicked one of the zero value series. So the hyperlink is still there even though the value is zero. I'd like to know a good way to erase the hyperlinks if there is no data. Thanks for the help.
Find more posts tagged with
Comments
mwilliams
So, you're wanting to disable all hyperlinks if say the value is 0?
moflopes
The stacked bar has 3 different I think series is what you call it (sorry I'm not too familiar with the lingo), and they are in decimal format. Each of them have a hyperlink. I want to disable it when the value is 0.
mwilliams
Should have asked this before. What is your BIRT version. I'll try this out in your version.
moflopes
2.3.2
mwilliams
You can use the expression builder to build your link dynamically. Unfortunately in 2.3.2, it seems that if you specify a link for certain values, but not others, you just get a blank popup with no destination. Also, there isn't access to the actual chart data in the expression builder, just the dataSet data, which is fine, unless you're using grouping. Then, your values probably won't be correct. FYI, if you can upgrade to the newest version, this option works great.
I'll look into a way to shut them off in the onRender script on the fly. I'll let you know if I find a way.
moflopes
Theoretically, when 0, was not to appear on the chart, but it appears quite small. So initially I thought of two ways, or take a small bar that pops up or get the link on this bar
mwilliams
Have you tried just filtering out values of 0 in your chart data?
moflopes
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="78599" data-time="1308231391" data-date="16 June 2011 - 06:36 AM"><p>
Have you tried just filtering out values of 0 in your chart data?<br /></p></blockquote>
<br />
Yes, at chart; at expression builder for Y value; and at data set. None worked, the one at expression builder turned up all weird, the others did nothing at all.
mwilliams
Can you recreate your issue for me with the sample database or with a CSV file so I can see exactly what you're working with? Thanks.
mwilliams
Actually, try this real quick:
In your chart script, put this:
function beforeDrawDataPoint( dph, fill, icsc )
{
if (dph.getOrthogonalValue() == 0){
icsc.getChartInstance().getInteractivity().setEnable(false);
}
else{
icsc.getChartInstance().getInteractivity().setEnable(true);
}
}
That should disable the hyperlink for the values with 0.
moflopes
Thanks !!!!! I will test
moflopes
That script worked to some extent! I have about a dozen stacked bars one beside the next, and it worked on all except the first one from the left. Weird.
moflopes
there is a "debug" simple to find out what value is being set for each bar in the chart?
mwilliams
It must not switch the interactivity til the next value. If a value is 0, does that mean that all values are 0 in that series?
moflopes
including another question, when the bar graph provides very small, a solution which would you do? because it is difficult to hit pro user clicks what piece of the bar
moflopes
figure that illustrates the problem
mwilliams
You could add a drill through on the chart to link to a report that only runs a large version of the same chart so they can see what they're clicking on better.