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)
Highlighting a pie chart slice
madhavil
Hi Every one,
Any body has some idea on highlighting a pie chart slice based on some criteria?
We have a pie chart that displays the quantities of products. And then the report also displays some more details of a single product selected by user(from a drop down).
Now my requirement is for the selected product the corresponding slice in the pie chart should be highlighted with some differentiation from other slices.
Please suggest a solution.
Thanks & Regards,
Madhavi.
Find more posts tagged with
Comments
kclark
You could do this one of two ways, you can either explode the slice that matches the parameter chosen or you can remove all of the labels except for the parameter chosen. The example I attached removes all labels except for the country that was selected.<br />
<br />
I set the parameter value as a PGV in the initialize() of my report, then I recalled it in the beforeDrawDataPointLabel() using this script.<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
function beforeDrawDataPointLabel( dph, label, icsc )
{
var highlight = icsc.getExternalContext().getScriptable().getPersistentGlobalVariable("highlight");
if( label.getCaption().getValue() != highlight ){
label.setVisible(false);
}
}
</pre>
madhavil
Thanks for the solution kclark !<br />
<br />
As our pie chart all slices are already exploded, i went with highlighting the slice label.<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>function beforeDrawDataPointLabel( dph, label, icsc )
{
var selectedProductName = icsc.getExternalContext().getScriptable().getParameterValue("selectedProductName");
if(label.getCaption().getValue().equals(selectedProductName)){
label.getCaption().getColor().set(255,0 ,0);
label.getCaption().getFont().setBold(true);
}
}</pre>