Skip to content

Instantly share code, notes, and snippets.

@wbashir
Created April 17, 2014 22:03
Show Gist options
  • Save wbashir/11014090 to your computer and use it in GitHub Desktop.
Save wbashir/11014090 to your computer and use it in GitHub Desktop.
Flot tooltip
$(function () {
var d1 = [];
for (var i = 0; i < 14; i += 0.5)
d1.push([i, Math.sin(i)]);
var data = [
{ label: "IE", data: 19.5, color: "#4572A7"},
{ label: "Safari", data: 4.5, color: "#80699B"},
{ label: "Firefox", data: 36.6, color: "#AA4643"},
{ label: "Opera", data: 2.3, color: "#3D96AE"},
{ label: "Chrome", data: 36.3, color: "#89A54E"},
{ label: "Other", data: 0.8, color: "#3D96AE"}
];
var d2 = [[0, 3], [4, 8], [8, 5], [9, 13]];
// a null signifies separate line segments
var d3 = [[0, 12], [7, 12], null, [7, 2.5], [12, 2.5]];
$.plot($("#placeholder"), data,
{
series: {
pie: {
innerRadius: 0.5,
show: true
}
},
grid: {
hoverable: true,
clickable: true
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment