Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Easy question, I think - Hide a series
MVictory
Hi,
I want to allow the user to decide which series they want to see in a chart.
So, how do I hide/show a series in a chart based on the value of a parameter?
Thanks,
Mark
Find more posts tagged with
Comments
venky
Hi Mark,
i have used similar functionality in my project implemented in function beforeGeneration( chart, icsc )
check below syntax to get an idea
xAxis = chart.getBaseAxes()[0];
yAxis1 = chart.getOrthogonalAxes( xAxis, true )[0];
yAxis2 = chart.getOrthogonalAxes( xAxis, true )[1];
seriesDef1 = yAxis1.getSeriesDefinitions().get(0);
seriesDef2 = yAxis2.getSeriesDefinitions().get(0);
runSeries1 = seriesDef1.getRunTimeSeries()[0];
runSeries2 = seriesDef2.getRunTimeSeries()[0];
var isYaxis1 = icsc.getExternalContext().getScriptable().getPersistentGlobalVariable("graphdisplayline1");
if (isYaxis1.equals("false")){
runSeries1.setVisible(false);
}
var isYaxis2 = icsc.getExternalContext().getScriptable().getPersistentGlobalVariable("graphdisplayline2");
if (isYaxis2.equals("false")){
runSeries2.setVisible(false);
}
Virgil Dodson
Hi Mark, depending on your data, you might also be able to use the Filter capability of the Chart to effectively hide a series of data based on a parameter supplied by the user without writing script.