我正在使用 C3 生成折线图。我在 http://c3js.org/samples/simple_multiple.html 看到各个点都用与关联线相同的颜色填充。当我创建折线图时,我的点只是空圆圈。如何获得要用线条颜色填充的点?
空圆作为点:
C3代:
c3.generate({
bindto: divReference,
data: {
x: 'x',
columns: columnData,
colors: colorData,
axes: { data: 'y' },
},
grid: {
x: { show: true },
y: { show: true }
},
axis: {
x: {
type: 'timeseries',
tick: { format: '%m/%d' }
}
},
point: {
//stroke: '#ff0000'
fill: '#ff0000'
}
})
最佳答案
像这样设置事件“onrendered”,例如:
onrendered: function () {
var $$ = this;
var circles = $$.getCircles();
for(var i = 0; i < circles.length; i++){
for(var j = 0; j < circles[i].length; j++){
$$.getCircles(j).style("fill", '#FFF')
.style("stroke", $$.color)
.style("stroke-width", 3);
}
}
}
关于javascript - C3图表点为空圆,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26067106/