我正在使用 c3js 中的以下函数:
chart.load({
point: {
r: function (d) {
return 3;
}
},
bindto: "#chatterplot_elastic",
x: 'x',
xFormat: '%Y-%m-%d %H:%M:%S',
columns: [
getPassantenTotaalOnDate(res),
getPassantenDatesOnDate(res),
AvHensbergenOnDate(res),
GemeentehuisOnDate(res),
CoornhertpadOnDate(res),
DuivenweideOnDate(res),
TricotageOnDate(res)
],
});
如您所见,我正在使用 Chart.load 函数。除了点值不会更新为值 3 之外,一切正常。
我认为 .load 函数无法识别我试图更改的点设置。
我的问题:如何确保我可以更改 c3js .load 上的点值?
最佳答案
原因很简单:加载函数需要某种类型的 config.data
。
您想要更改config.point
但您尝试更改config.data.point
(不存在)。
要获得所需的行为,您可以在调用 load
函数时添加以下行:chart.internal.config.point_r = 3;
关于javascript - C3JS加载函数和点值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36667024/