JSFiddle - React, Tailwind, and code Playground
by larsenmtl
HTML
<script src="http://people.iola.dk/olau/flot/jquery.flot.js"></script>
<div id="placeholder" style="width:500px;height:300px;"></div>
JavaScript
$(function () {
var d1 = [];
for (var i = 0; i < 24; i++)
d1.push([i, Math.sin(i)]);
function someFunc(ctx, x, y, radius, shadow)
{
someFunc.calls++;
if (someFunc.calls % 2 == 0)
{
ctx.arc(x, y, radius * 4, 0, shadow ? Math.PI : Math.PI * 2, false);
}
else
{
ctx.arc(x, y, radius, 0, shadow ? Math.PI : Math.PI * 2, false);
}
}
someFunc.calls = 0;
var options = {
series: {
lines: { show: true },
points: { show: true, symbol: someFunc}
}
};
somePlot = $.plot($("#placeholder"), [ d1 ], options);
});