Closed GoogleCodeExporter closed 8 years ago
Here is an example of using a custom labelFormatter with flot.pie to show both
the percent and unchanged value. Of course you could use just one or the other.
var options= {
series: {
pie: {
show: true
}
},
legend: {
show: true,
labelFormatter: function(label, series) {
var percent= Math.round(series.percent);
var number= series.data[0][1]; //kinda weird, but this is what it takes
return(''+label+': '+number+' ('+ percent + '%)');
}
}
};
var data= [
{data:123, label:"test1"},
{data:456, label:"test2"},
{data:789, label:"test more"}
];
var plot= $.plot(placeholderSelector, data, options);
Hope this helps.
Eddie Canales
Original comment by eddiecan...@gmail.com
on 27 Sep 2010 at 6:57
Thanks for the info.
You might want to avoid using "options" as your variable name as it is a
reserved word in javascript. Maybe use "flotOptions" instead?
Original comment by keithhop...@gmail.com
on 16 Nov 2010 at 4:49
This seems to have been a question (which would have been better posed at the
mailing list by the way :), so I'm closing it.
keithhopkin: do you have a source? I've never heard that before, and I couldn't
find it with a quick search, see for instance
http://www.quackit.com/javascript/javascript_reserved_words.cfm
Original comment by olau%iol...@gtempaccount.com
on 13 Dec 2010 at 3:01
there more html formating that you can find here
http://www.html-codes-color.com/
Original comment by fr12...@yahoo.com
on 11 Feb 2012 at 3:34
[deleted comment]
fast growing social bookmarking website
http://bookmarkscope.com/
Original comment by nealkata...@gmail.com
on 12 Apr 2012 at 6:24
Original comment by dnsch...@gmail.com
on 4 Jun 2012 at 2:39
Thank a lot for your good information bro.
http://www.to-to-to.com
Original comment by shajimax...@live.com
on 31 Aug 2012 at 4:08
Really helpful info, i resolved my issue. Thank u so much.
http://www.newsbucket.org/
Original comment by newsbuck...@gmail.com
on 15 Sep 2013 at 4:06
Well, you can use html5 canvas to do it, here is demo to do it
http://www.tutorialspark.com/html5/HTML5_Canvas_Graphs_Charts.php
Original comment by punter...@gmail.com
on 30 Sep 2013 at 10:32
Original issue reported on code.google.com by
nizar.ab...@gmail.com
on 1 Feb 2010 at 7:02