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

断了今生、忘了曾经 提交于 2021-01-02 05:48:11

问题


How to update the default line width in a C3.js graph? How to update the tick (the circles) color?


回答1:


If you use a DOM inspector you can see what classes the different objects have and then it's just a case of assigning some CSS to them e.g.

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

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



回答2:


For case of increasing scatterplot circle radius, radius of circles on line charts. Please use like this:

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



回答3:


As per documentation you can control line width individually by following

[chart-id] .c3-line-[chart-data-name] {
  stroke-width: 5px;
}

if it does not work try to use !important

ex:

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


来源:https://stackoverflow.com/questions/28296535/how-to-update-c3-js-graph-line-width-and-tick-color

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!