I have plotted a graph on a dark background but due to the axis-color and tick-value color it is very difficult to read. How do I change to color of the axis, ticks and axis tick value to white?
Asked
Active
Viewed 5,953 times
4 Answers
8
You could use CSS
to style the graph, for example
path.domain { stroke: white; }
.tick text { stroke: yellow; }
.c3-legend-item text { stroke: grey; }
To make the axis white, the tick labels yellow, and the legend text grey.

P Varga
- 19,174
- 12
- 70
- 108
-
For example use the CSS selector `.c3-legend-item text` – P Varga Apr 27 '15 at 11:03
-
That creates a stroke though and it does not change the color. Is there a way to just change the text color instead of creating a stroke? – Datacrawler Apr 20 '18 at 12:26
1
Try also changing the color of the fill if you don't want to use a stroke:
path.domain { fill: white; }
.tick text { fill: yellow; }
.c3-legend-item text { fill: grey; }

Datacrawler
- 2,780
- 8
- 46
- 100
1
You can attempt to adjust the CSS properties of the path and line. See the example CSS below as a helper.
.c3 .c3-axis-x path,
.c3 .c3-axis-x line {
stroke: red;
}
.c3 .c3-axis-y path,
.c3 .c3-axis-y line {
stroke: blue;
}

Tyler Rafferty
- 3,391
- 4
- 28
- 37

Anup Bangale
- 581
- 7
- 7