如何更新 C3.js 图形线宽和刻度颜色?

How to update C3.js graph line width and tick color?

如何更新 C3.js 图中的默认线宽?如何更新刻度(圆圈)颜色?

如果你使用 DOM 检查器,你可以看到 类 不同的对象有什么,然后它只是 assigning some CSS to them 的一个例子,例如

.c3-line {
    stroke-width: 2px;
}

.c3-circle {
    fill: red !important;
}

对于增加散点图圆半径的情况,折线图上的圆半径。 请这样使用:

c3.generate({
...
  point: {
    r: 10,
  },
...
})

根据文档,您可以按照

单独控制线宽
[chart-id] .c3-line-[chart-data-name] {
  stroke-width: 5px;
}

如果不起作用,请尝试使用 !important

例如:

#chart .c3-line-data2 {
  stroke-width: 5px;
}