Flot:Markings - 线条笔划的大小

时间:2012-10-11 17:19:57

标签: javascript flot

是否可以更改标记的线条划线?我已经知道可以改变它的颜色了:

markings: [ { yaxis: { from: 0, to: 0 }, color: "#000"},
            { xaxis: { from: 0, to: 0 }, color: "#000" }],

我使用此解决方案使我的轴没有背景网格线: display-x-axis-and-y-axis-lines-with-out-the-grid-lines-using-flot

2 个答案:

答案 0 :(得分:6)

只需添加选项:

        markings: [ { yaxis: { from: 0, to: 0 }, color: "#000"},
                    { xaxis: { from: 0, to: 0 }, color: "#000" }],
        markingsLineWidth: 2.5, //number

答案 1 :(得分:0)

除了适用于所有标记的markingsLineWidth选项外,您还可以为每个标记定义lineWidth

markings: [ { yaxis: { from: 0, to: 0 }, color: "#000", lineWidth: 5},  // speficic value
            { xaxis: { from: 0, to: 0 }, color: "#000" }],
markingsLineWidth: 2.5, // default value

源代码链接:
默认值:markingsLineWidth: 2
每个标记值:var lineWidth = m.lineWidth || options.grid.markingsLineWidth;