jQuery UI Widgets › Forums › Chart › Pie Chart Legend – Property Question
This topic contains 3 replies, has 2 voices, and was last updated by Dimitar 10 years, 6 months ago.
-
Author
-
First, thank you so much for jQWidgets! It is a fantastic library and easy to use. I am volunteering my time, and using jQWidgets to create community service statisical charts for a local charity. Thank you!!!
I have a question, and I can’t seem to find it in the API.
When a chart is created, one of the slick things that jqWidgets does is to allow you to click on an item on the legend, which displays and hides the series data in the chart… nice!
In my pie chart, I have data with zeros…
For example, I might have 5 cities, but one of the cities has 0…
Danbury: 120
Bridgewater: 25
Roxbury: 50
New Milford: 0
Ridgefield: 75I would like to initially hide the “New Milford” series… you can do this by clicking on the “New Milford” label in the legend…
I was looking at “item.itemIndex”.?theValue? to check the value, and I was looking for a property like:
showSeriesItem: true|false;
Can you point me in the right direction? Thanks again…
Hello wcogd,
The only way to hide a series, except for clicking on its legend bullet is to modify the seriesGroups object, as shown in the forum topic changing data series.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Thank you, Dimitar…
The example you sent is interesting, but I’m not sure it would work well for my application. I would not know in advance when a particular value would be zero, and multiple dataFields could be zero…
What I did as a workaround was to send the zero pie slice off the chart, so it is not seen.
Like this:
centerOffset: function(item) { if (dataAdapter.records[item.itemIndex].myValue == 0) return 999; return 0; },
But there must be a “behind the curtain” value that you are using to toggle the dataField on/off when you click on the Legend bullet…
I respectfully ask if you could consider exposing this value / capability in a future release…
Thank you!
Hi wcogd,
Thank you for your feedback. We will consider your suggestion for a future release.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.