C3JS加载函数和点值
C3JS load function and point value
我正在使用 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;
我正在使用 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;