Andrius Naruševičius
Andrius Naruševičius

Reputation: 8578

Jquery flot pie chart going crazy

I have a very simple chart, no interesting code behind the scenes, but every time, the chart is loaded differently, alternating between two ways of placing the labels like this: enter image description here

All the labels seem to be pushed up into different locations. I am using:

and the code behind this is:

var options = 
{
    series: {
        pie: {
            show: true,
            label: {
                show: true,
                formatter: function (label, series)
                {
                    return '<div style="font-size:8pt;text-align:center;padding:2px;color:white;background-color:#000">' + label + '<br/>' + Math.round(series.data[0][1]) + '%</div>';
                }
            }
        }
    },

    legend: {
        show: false
    }
};

$.plot($('#chart'), data, options);

Html of the paceholder div:

<div id="#chart" style="margin: 40px 20px 20px 0px; padding: 0px; 
                        position: relative; width:400px; height: 300px;"></div>

Upvotes: 3

Views: 473

Answers (1)

Andrius Naruševičius
Andrius Naruševičius

Reputation: 8578

Apparently this got fixed with a newer combination of plugins (just as my other question here):

v0.7 to v0.8 of jquery.flot.js 

and

v1.0 to v1.1 of jquery.flot.pie.js

Upvotes: 1

Related Questions