对于如何在Flot散点图上绘制红日蚀,有什么想法或方法吗?
如果Flot是不可能的,您也可以为d3或任何图表工具提供我的解决方案!
发布于 2014-05-26 08:49:31
这可以通过使用钩子来实现。
hooks: {
drawSeries: [drawEllipse]
}具有这样的功能:
function drawEllipse(plot, ctx, series) {
// parameter for the ellipse, calculate with your chosen method from series
var center = {
x: 300,
y: 300
};
var radius = {
x: 150,
y: 100
};
ctx.save();
ctx.beginPath();
ctx.translate(center.x - radius.x, center.y - radius.y);
ctx.scale(radius.x, radius.y);
ctx.arc(1, 1, 1, 0, 2 * Math.PI, false);
ctx.restore();
ctx.strokeStyle = 'red';
ctx.stroke();
}椭圆-从这个所以回答绘制方法。有关工作示例,请参阅此小提琴。椭圆的参数在这里是硬编码的,要想得到真正的解决方案,就必须从数据中计算它们。
https://stackoverflow.com/questions/23864064
复制相似问题