4

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?

P Varga
  • 19,174
  • 12
  • 70
  • 108
Mark Henry
  • 2,649
  • 7
  • 40
  • 48

4 Answers4

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
3
.c3 path, .c3 line, .tick text { 
  stroke: white;
}
Paul Roub
  • 36,322
  • 27
  • 84
  • 93
Developer
  • 31
  • 2
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