javascript - 如何增加折线图的线宽?

标签 javascript raphael graphael

是否有任何选项可用于增加折线图的线宽?我试图改变 stroke,但似乎没有任何影响。

下面是折线图的初始化方式:

paper.linechart(10, 30, 400, 240, [
    [5, 10, 15, 20, 25, 30, 35]
], [
    [15, 10, 20, 14, 13, 17, 9],
    [7, 13, 17, 9, 10, 20, 14],
    [5, 4, 14, 12, 20, 3, 16]
]);

最佳答案

目前您唯一的选择是在选项中指定更高的 width 值。来自documentation ,在 Paper.lineChart 选项的 width 属性下:

(width) controls the size of the plotted symbol. Also controls the thickness of the line using a formula stroke-width=width/2.

要仅控制线条的 stroke-width,您应该能够将空的 symbol 和所需的 width 值传递给 opts ,例如:

paper.linechart(10, 30, 400, 240, [
    [5, 10, 15, 20, 25, 30, 35]
], [
    [15, 10, 20, 14, 13, 17, 9],
    [7, 13, 17, 9, 10, 20, 14],
    [5, 4, 14, 12, 20, 3, 16]
], {
    symbol: '',
    width: 5
});

(当然,您可以将 circle 作为符号传递,但其大小将由 width 值派生)。

关于javascript - 如何增加折线图的线宽?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14775843/

相关文章:

jquery - 拉斐尔设置事件

javascript - 无法使用 Raphaël 库

javascript - gRaphael 弹出位置

javascript - 如何在javascript文件中使用函数

javascript - 如何使用 Raphael.js 为图像元素提供 "selected"外观

javascript - 在使用 Chrome 进行分析时,React 的性能显着提高

raphael - 如何使用 Raphael.JS 绘制基于鼠标移动的线

javascript - gRaphael图书馆: Can't Create Line Chart

javascript - 如何在 Karma/Jasmine/Phantom JS 中对 cookie 过期进行单元测试

javascript - 与 "switch"相关的函数将不起作用