1
votes

I am trying to plot a flot pie chart the problem is when i am plotting the all other values are shown on the pie label but the value "1" is not showing..

pie chart options

var plot = $.plot("#" + divId, graphData, {
    series : {
        pie : {
            show : true,
            label : {
                show : true,
                radius : 2 / 3,
                formatter : labelFormatter,
                threshold : 0.1
            }
        }
    },
    zoom : {
        interactive : false
    },
    pan : {
        interactive : false
    },
    grid : {
        hoverable : true,
        clickable : true
    }
});


 function labelFormatter(label, series) {
  return "<div style='font-size:8pt; text-align:center; padding:2px;     color:white;'>" + series.data[0][1] + "</div>";
 }

my data

[
    {data:2,label:"xxxx"},{data:1,label:"xxxx"},
    {data:2,label:"xxxx"},data:1,label:"xxxx"},
    {data:2,label:"xxxx"},data:6,label:"xxxx"}
]

screenshot also attached here

1

1 Answers

1
votes

That is caused by the threshold: 0.1 option which suppresses labels for pieces with less less 0.1 of the total value. Since your total value is 14, all pieces with less then 1.4 have no label. Remove the option to show all labels.