Letractively / flot

Automatically exported from code.google.com/p/flot
MIT License
0 stars 0 forks source link

Pie Interactive, hove & click obj.series.data got extra 1, #634

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
i used pie interactive with hover and click events. but when i display the 
obj.series.data, the result will got extra "1,",it will make the mistake when 
ready the date. it is the bug?

function pieHover(event, pos, obj) 
{
    if (!obj)
                return;
    percent = parseFloat(obj.series.percent).toFixed(2);
    $("#hover").html('<span style="font-weight: bold; color: '+obj.series.color+'">'+obj.series.label+":"+obj.series.data+' ('+percent+'%)</span>');
}

Original issue reported on code.google.com by hanson2...@gmail.com on 21 Nov 2011 at 6:22

Attachments:

GoogleCodeExporter commented 9 years ago
Currently this is working as intended; you're getting an array, not a single 
value.  This is because the pie plugin transforms your input data, so what you 
see in obj.series.data is not your original value.

I'm accepting this as an enhancement, to improve the way Flot exposes original 
data after transformation.

Original comment by dnsch...@gmail.com on 5 Jun 2012 at 4:07