jquery flot,每个点的大小和颜色各不相同
我们可以在jquery flot plot中更改以下点的属性:
点的大小 :我基本上试图绘制三维图。 前两个维度是x和y值,第三个维度值将反映在点的大小中。 值越大,点越大。
点的颜色:再次,我试图显示除x和y值以外的属性。 值越大,点越暗。
[编辑] :我试图单独控制点的这些属性,而不是整个情节。
我现在了解你。 我能看到这样做的唯一方法是将回调函数传递给点符号选项:
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);
在上面我调整每个其他点的半径大小:
这里的例子