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)
Add Legend Entry
scadden
Hi,
I would like the legend of a pie chart to always show the values 'Pass', Fail' and 'Skipped' even if one of these values is not present within the dataset.
The columns of the dataset are Test_Run_Id and Test_Status, where the rows of Test_Status could contain 'Pass', Fail' or 'Skipped'.
Can I use the beforeDrawLegendItem function to check if a legend item is not present and then add the value?
Thanks,
Steve
Find more posts tagged with
Comments
mwilliams
If you're using SQL, you could add a row for each of these, in your query, to guarantee the value is represented. Another option would be to create a static dataSet (scripted, flat file, etc.) that you can join with your current dataSet, then use computed columns to merge the data. This will also guarantee that al values are present.
jozef.vdm
<p>Hi,</p><p> </p><p>I'm trying to accomplish the same thing: make sure all categories are respresented on a bar chart and the legend even when they do not appear in the dataset.Soooo, I want them to appear with a zero value on the chart. How can I accomplish this??</p><p> </p><p>Can I do this through the Expression Builder? This is what I have in there for the Category (C) Series:</p><p> </p><p>row["SDLC_Phase"]</p><p> </p><p>I need all values of "SDLC_Phase" to appear on the chart, even when they're not in the dataset.</p><p> </p><p> </p><p>Thanks!</p><p> </p><p>Jozef</p><p> </p><p> </p><p> </p>
mwilliams
<p>You would need to have another dataSet that has all of the possible values, then you'd join your data together so that all are represented in the data for the chart. You'd probably have to create computed columns to merge the data together how you'd like. This would allow you to assign a 0 to the rows that don't have a value from the original dataSet.</p>