【问题标题】:Flot: Markings - Size of line strokeFlot:标记 - 线条笔划的大小
【发布时间】:2012-10-11 17:19:56
【问题描述】:

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

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

【问题讨论】:

    标签: javascript flot


    【解决方案1】:

    只需添加选项:

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

    【讨论】:

      【解决方案2】:

      除了适用于所有标记的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;

      【讨论】:

        猜你喜欢
        • 2020-07-05
        • 2013-08-02
        • 1970-01-01
        • 2023-04-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-10-15
        • 1970-01-01
        相关资源
        最近更新 更多