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

3

9

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

Haberman answered 3/2, 2015 at 10:23 Comment(0)
O
16

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;
}
Outfielder answered 3/2, 2015 at 11:17 Comment(0)
D
3

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

c3.generate({
...
  point: {
    r: 10,
  },
...
})
Dowling answered 14/4, 2016 at 17:16 Comment(0)
E
1

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;
}
Exercitation answered 15/2, 2019 at 13:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.