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)
Get Series/Chart type in beforeDrawLegendItem/afterDrawLegendItem
BirtRepUser
I have 2 series with Optional Y grouping. The 1st series is stacked Area chart and second is line chart.I would like to hide GP2 in series 2 (highlighted in yellow color in attached image). <br />
If I use the following code is hiding GP2 from both the series. What can I do to just hide GP2 in series 2?<br />
<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
//store values to move legend items to fill hole
boundsH=0;
boundsW=0;
boundsT=0;
boundsL=0;
tempBoundsT=0;
function beforeDrawLegendItem( lerh, bounds, icsc )
{
if( lerh.getDataIndex() == 1){
//Store values first so we can reset
boundsL = bounds.getLeft();
boundsT = bounds.getTop();
boundsH = bounds.getHeight();
boundsW = bounds.getWidth();
bounds.setHeight(0);
bounds.setWidth(0);
lerh.getLabel().setVisible(false);
}
//need to move up all the following entries after the hole
if( lerh.getDataIndex() > 1 ){
tempBoundsT = bounds.getTop();
bounds.setTop(boundsT);
boundsT= tempBoundsT;
}
}
function afterDrawLegendItem( lerh, bounds, icsc )
{
//Get second runtime series reset changes
if( lerh.getDataIndex() == 1 ){
lerh.getLabel().setVisible(true);
bounds.setHeight(boundsH);
bounds.setWidth(boundsW);
}
}
</pre>
<br />
Thanks,
Find more posts tagged with
Comments
Arif shah
<p>Hi,</p><p> </p><p>Did you find a solution for this? I have a similar kind of requirement where I need to hide an entry from series 2</p><p> </p><p>Arif</p>