简体   繁体   English

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

[英]how to style style line chart points in c3js

I have a general c3js question. 我有一个一般的c3js问题。 I'm trying to make the points in a C3JS line chart "hollow" (white fill, with a colored stroke), but am having a hard time figuring out how to do that. 我试图让C3JS折线图中的点“空心”(白色填充,带有彩色笔划),但我很难搞清楚如何做到这一点。 I've tried to add my own CSS, but it gets overwritten by the direct style tag in the html. 我试图添加自己的CSS,但它被html中的直接style标记覆盖。

Does anyone have any suggestions? 有没有人有什么建议?

Thanks! 谢谢!

or you can simply use the .c3-circle class as follow : 或者你可以简单地使用.c3-circle类如下:

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

You'd probably need to dip into the D3 code to manipulate them on the svg, something like this: 您可能需要深入研究D3代码以在svg上操作它们,如下所示:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM