C3: colorize Y-Grid Lines

Created on 16 Jun 2014  路  4Comments  路  Source: c3js/c3

Hi.

How can i colorize Y grid lines?
I want to show a chart with three lines and show the averages as Y-Grid-Lines. To make it clear, that the shown average is the value from a given line, i want to use the same color for the line in the graph and for the average.
I tried to archive this using CSS only, but failed, as i can only select

<g class="c3-ygrid-line">

Is there another possibility? Or can you add an additional property of color to the grid-Lines?

question resolved maybe

Most helpful comment

I want to show all grid lines solid in black color without specifying class for each element. Please provide solution if you are aware about it.

I don't know why c3.js showing grid lines dotted instead of solid lines. This doen't look good at all.

All 4 comments

I came here looking how to do this as well, black grid lines on black background doesn't really work

Hi, I think you can do that like this fiddle http://jsfiddle.net/EgESr/1/ . Could you check this?

Hi Masayuki,
this works well in my case. I never thought about assigning a class manually.
I thought, that there should be some kind of automatically assigned classes like c3-ygrid-line-# as you do with many other objects in the charts. Maybe you should do something like that nevertheless
But naming the line by myself is simple.

Thank you very much indeed. You are a magician, Masayuki ;-)

I want to show all grid lines solid in black color without specifying class for each element. Please provide solution if you are aware about it.

I don't know why c3.js showing grid lines dotted instead of solid lines. This doen't look good at all.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wojciechowskid picture wojciechowskid  路  3Comments

Zerim picture Zerim  路  3Comments

seubert picture seubert  路  3Comments

patternboxtech picture patternboxtech  路  4Comments

alantygel picture alantygel  路  3Comments