JavaScript
d1 = [[48,0],[16,0],[10,0],[40,0],[30,0],[37,0]];
d2 = [[43,0],[60,0],[74,0],[83,0]];
var options = {
points: { show: true, radius: 10, lineWidth: 4, fill: false },
lines: { show: false },
xaxis: { show: false },
yaxis: { show: false },
grid: { show:true,
color: "transparent",
markings: [
{ xaxis: { from: 40, to: 40 }, color:"black" },
{ xaxis: { from: 50, to: 50 }, color:"black" },
{ xaxis: { from: 60, to: 60 }, color:"black" }
]
}
};
xCallBack = function (ctx, x, y, radius, shadow) {
ctx.arc(x, y, radius, 0, Math.PI * 2, false);
var text = 'X'
var metrics = ctx.measureText(text);
ctx.font="15px Arial";
ctx.fillStyle = "red";
ctx.fillText(text,x-metrics.width/2,y+4);
}
checkCallBack = function (ctx, x, y, radius, shadow) {
ctx.arc(x, y, radius, 0, Math.PI * 2, false);
var text = '✓'
var metrics = ctx.measureText(text);
ctx.font="15px Arial";
ctx.fillStyle = "green";
ctx.fillText(text,x-metrics.width/2,y+4);
}
var data = [
{ data: d1, color: 'red', points: {symbol: xCallBack } },
{ data: d2, color: 'green', points: {symbol: checkCallBack }}
];
$.plot($('#placeholder'), data, options);