gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-30 05:51:14 24 4
gpt4 key购买 nike

是否有任何选项可用于增加折线图的线宽?我试图改变 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com