gpt4 book ai didi

javascript - RGraph瀑布图: Get rid of lines connecting bars

转载 作者:行者123 更新时间:2023-12-02 23:24:31 24 4
gpt4 key购买 nike

我使用 RGraph 创建了一个瀑布,如下图所示。除了连接每个条形的细线之外,一切看起来都很棒。我在图中用红色圈出了它们。我怎样才能摆脱这些细连接线?我在文档中找不到它。

参见my jsfiddle here对于工作版本。

Waterfall image with lines circled in red

代码:

html:

<html>
<body>
<canvas id="cvs" width="800px" height="300px"></canvas>
</body>
</html>

JavaScript:

    var waterfallChart = new RGraph.Waterfall({
id: 'cvs',
data: [570.00, -7.39, -26.61, -18.69, -4.24],
options: {
linewidth: 0,
colors: ["#b3b3b3", "#afe5ed", "#afe5ed", "#afe5ed", "#afe5ed", "#6f2e92"],
colorsStroke: "#ffffff",
colorsSequential: true,
title: "The Title Of My Chart",
titleColor: "#727272",
titleSize: 15,
labelsAbove: true,
labelsAboveDecimals: 2,
labelsAboveUnitsPre: "$",
axes: false,
backgroundGrid: false,
backgroundBarsCount: 0,
yaxisLabels: false,
yaxisTickmarksCount: 0,
xaxisTickmarksCount: 0,
yaxisScaleMin: 450,
xaxisLabelsSize: 10,
xaxisLabels: ['Plan 3',
'This is\na label',
'This is \nanother label',
'This is\na thing',
'This is\nyet another thing',
'blah'],
xaxisLabelsOffsety: 50,
xaxisLabelsColor: "#9f9f9f"
}
});
// waterfallChart.Set('chart.gutter.bottom',35);
waterfallChart.draw();

感谢您的帮助!

最佳答案

它们只是连接线 - 没有选项可以将它们关闭,但您可以通过执行以下操作来更改源以隐藏它们:

在 RGraph.waterfall.js 的第 1318 行(或附近),您会发现以下几行:

co.lineWidth   = 1;
co.strokeStyle = '#666';

将它们改为:

co.lineWidth   = 0.00001; // Don't zet to zero
co.strokeStyle = 'rgba(0,0,0,0)'; // transparent

关于javascript - RGraph瀑布图: Get rid of lines connecting bars,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56798580/

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