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)
How can I set legends of a pie chart dynamically depending on slice value?
NikhilNaik
Hi,
I am using pie chart in one of my report.
I want to set the label of the Legends of chart depending on the value of slice size.
I am trying to use the script
function beforeDrawLegendItem(lerh, bounds, icsc){}, but not able to get the Slice size by using the script.
Please help me out in implementing this ASAP.
Its Urgent.
Thanks for ur help in Advance.
Nikhil
Find more posts tagged with
Comments
JasonW
Nikhil,
Do you have the value already in the label?
If so you you can access it like
var myval = label.getCaption().getValue();
Jason
jyol2005
I have create a pie chart and assigned the category definition as row["desc"] and slice size as row["value"]. Grouping is enabled on category def. and I chose Sum as the aggregate function. (See Attachment)
The legend should display desc along with the sum of values for that desc.
For example, if my data is:
Desc Value
Desc 1 5
Desc 2 4
Desc 1 7
Desc 3 3
Desc 2 6
.....
Legends should be:
Desc 1 - 12, Desc 2 - 10, Desc 3 - 3, etc.
How can I do this? I'm using scripted data set and getting an object with the above list of values.
JasonW
Nikhil,
Any chance you could put dummy data in the report and post it? Then I will try to make it display correctly in the legend.
Jason