c3 icon indicating copy to clipboard operation
c3 copied to clipboard

Axis Label color and position

Open nathancole opened this issue 12 years ago • 7 comments

Is it possible to set the Axis label color and position. See the image below for an example of what I might like to accomplish. This is the chart we currently have implemented.

If the color were configurable via css, that would be great.

dygraphschart

Thanks, Nathan

nathancole avatar Apr 01 '14 03:04 nathancole

Hi, it is possible to display like your screenshot.

First, specify axis.y.label.position and axis.y2.label.position to outer-middle. This option changes the position of axis label. Sample is here: http://c3js.org/samples/axes_label_position.html

Second, add style .c3-axis-y .tick and .c3-axis-y-label for y axis and .c3-axis-y2 .tick and .c3-axis-y2-label for y2 axis. These style change the style of axis ticks and labels. I added templates for these style in c3.css by the commit above.

Could you try these?

masayuki0812 avatar Apr 01 '14 14:04 masayuki0812

Once again... perfect and wonderful!

nathancole avatar Apr 02 '14 02:04 nathancole

@masayuki0812 Can you document somewhere the css options we have. I don't see it in examples or reference on the website. Thanks!

0o-de-lally avatar Feb 05 '15 17:02 0o-de-lally

@keyscores They're at http://www.c3js.org/reference.html under "CLASS" in the sidebar, but not documented yet. Apologies, it's something I keep meaning to get around to.

That said — documentation pull requests for masayuki0819/c3js.org are extremely welcome, if you care to do so! :smile: :+1:

aendra-rininsland avatar Feb 06 '15 01:02 aendra-rininsland

now i can't set y2 tick color via css: .c3-axis-y2 .tick{ color: #FE7E0D; }

dew063 avatar Aug 07 '15 04:08 dew063

@dew063 you should use 'fill' instead of 'color': .c3-axis-y2 .tick { fill: #FEFE0D; }

nsteenbeek avatar Dec 22 '15 12:12 nsteenbeek

Can you please add more information where to add this style in the code ??

HibaYousef avatar Aug 12 '18 01:08 HibaYousef