Jquery - Flot,我怎样才能只显示点而不是线?
问题描述:
好上手,我使用jQuery的海军报绘制一个辐射图我已经找到了一个插件来创建一个蛛网图看API这里:Jquery - Flot,我怎样才能只显示点而不是线?
http://www.jumware.com/Includes/jquery/Flot/Doc/JQuery.Flot.spider.html
现在的作品都很好地扎其实我不想显示连接点的线。 通常有:
points: { show: true}, lines: { show: false}
但使用蜘蛛插件时,似乎忽略此设置。我在这里做错了什么,或者是使用这个插件的情况下,我必须显示线?
工作示例在:
代码:
function EveryOneSec() {
var d1 = [[0, 10], [1, 20], [2, 80], [3, 70], [4, 60]];
var d2 = [[0, 30], [1, 25], [2, 50], [3, 60], [4, 95]];
var d3 = [[0, 50], [1, 40], [2, 60], [3, 95], [4, 30]];
var options = {
series: {
spider: {
active: true,
legs: {
data: ["", "", "", "", ""],
legScaleMax: 1,
legScaleMin: 0.8
}, spiderSize: 0.9
}
}, grid: {
hoverable: false,
clickable: false,
tickColor: "rgba(0,0,0,0.2)",
mode: "radar"
}
};
data = [{
label: "",
data: d1,
spider: {
show: true,
lineWidth: 0
}
}, {
label: "",
data: d2,
spider: {
show: true,
lineWidth: 0
}
}, {
label: "",
data: d3,
spider: {
show: true,
lineWidth: 0
},
points: { show: true},lines: { show: false }
}];
$.plot($("#RadialPlot"), data, options);
}
EveryOneSec();
更新一个
编辑lineWidth: 0, connectionWidth: 0
到任何数字似乎都没有影响。
我该如何显示点而不是线?
答
添加connection: { width: 0 }
蜘蛛选项:
spider: {
active: true,
connection: { width: 0 }, // add this line
legs: {
data: ["", "", "", "", ""],
legScaleMax: 1,
legScaleMin: 0.8
},
spiderSize: 0.9
}
Documentation指出,选项应该是:connectionWidth: 0
,但似乎已经改变,从source for the actual plugin看出:
function drawspiderConnections(ctx,cnt,serie,c,fill) {
var pos,d;
ctx.beginPath();
ctx.lineWidth = serie.spider.connection.width; // this is the line
// etc.
}
+0
我试图在下面的spiderSize添加,没有工作:S的确如你所做的那样,谢谢你,先生。 – Sphvn 2010-07-16 06:34:36
张望了一下打与脚本...如果你忽略了蜘蛛选项它的作品...有趣... – 2010-07-16 06:25:26
哪些蜘蛛选项,因为在没有插件的情况下将它作为一个普通的flot? – Sphvn 2010-07-16 06:27:52
我的意思是整个'spider:'-section ... – 2010-07-16 06:29:40