jQuery UI Widgets Forums Chart Pie chart with all zeros

This topic contains 4 replies, has 2 voices, and was last updated by  calimero100582 11 years, 2 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • Pie chart with all zeros #24871

    calimero100582
    Participant

    We want to draw a pie chart based on the usage data of certain tools with predefined ranges.

    var data = [{Text: ‘Low’, Value: 0}, {Text: ‘Medium’, Value: 0}, {Text: ‘High’, Value: 0}];

    the pie chart draw 2 sections at 0% and 1 at 100%.

    Any way to get this special case to draw all 3 sections at 33.3%?
    If I modify the data by myself, the tooltip would be incorrect.

    Pie chart with all zeros #24897

    Dimitar
    Participant

    Hello calimero100582,

    An example on value/percentage use in a pie chart can be found in the forum topic Pie Chart section label to show John: 8000(20%). However, it would not be suitable in your case because it cannot be determined what part of 0 is 0 (division by 0).

    We suggest you to manually modify the displayed values using the callback functions formatFunction and toolTipFormatFunction.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    Pie chart with all zeros #24940

    calimero100582
    Participant

    the formatFunction is useful for label, but do you know if there is a way to specify the size of the slice

    Pie chart with all zeros #24988

    Dimitar
    Participant

    Hi calimero100582,

    The value field specifies the size of the slices. You may change your values to equal numbers, e.g.:

    var data = [{Text: 'Low', Value: 10}, {Text: 'Medium', Value: 10}, {Text: 'High', Value: 10}];

    and change the labels using formatFunction to display zeros.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    Pie chart with all zeros #25103

    calimero100582
    Participant

    I added a percent to my data for the label, and kept value for the tooltip

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.