如何在 c3js 中设置样式折线图点

how to style style line chart points in c3js

我有一个一般的 c3js 问题。我正在尝试在 C3JS 折线图 "hollow"(白色填充,带有彩色笔划)中绘制点,但我很难弄清楚如何做到这一点。我尝试添加自己的 CSS,但它被 html 中的直接 style 标记覆盖。

有人有什么建议吗?

谢谢!

您可能需要深入研究 D3 代码才能在 svg 上操作它们,如下所示:

d3.selectAll("circle")
  .attr("r", 10)
  .style("fill", "white")
  .style("stroke", "black")
  .style("stroke-width", 5);

或者您可以简单地使用 .c3-circle class 如下:

.c3-circle {
    stroke-width: 2px;
    stroke: #fff;
}