Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Designing Analytics Reports
Hide series identifier (title) when showing legends via scripting
Migrateduser
Hi,
I have a chart that have 2 series which I named series1 and series2.
I want to show/hide the legend items based on some condition, so I use some scripting to achieve this.
The code looks like something like this:
if (..condition is met..) {
var llh = gcs.getRunTimeContext().getLegendLayoutHints();
var liha = llh.getLegendItemHints( );
var new_length = liha.length/2; // Note: I only want to show legend for one series
var nliha = [];
nidx = 0;
for( idx = 0; idx < new_length; idx++ ){
tli = liha[idx];
nliha[nidx++]=tli;
}
var nllh = new LegendLayoutHints(llh.getLegendSize(),llh.getTitleSize(), llh.getLaTitle(), llh.isMinSliceApplied(), null, nliha );
gcs.getRunTimeContext().setLegendLayoutHints(nllh);
}
The legends did show when the condition is met, but the series title (series1) also shows. (See attachment)
How can I hide the title "series1"?
If I do not have the script, the legends looks fine without the title.
But this happens in 3.7.2. Previously with 2.2.1, it was fine.
Thanks.
Find more posts tagged with
Comments
There are no comments yet