Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Axis label formatting #13

Closed
unicron opened this issue Jan 31, 2014 · 8 comments
Closed

Axis label formatting #13

unicron opened this issue Jan 31, 2014 · 8 comments

Comments

@unicron
Copy link

unicron commented Jan 31, 2014

Hello,

I have a couple questions about formatting the axes.

For X axis, is there a way to display arbitrary category tick labels? For instance, I would like to display text instead of number for categories (like 'America' 'Europe' 'Afria' etc. rather than 1, 2, 3.

For Y axis, how can I format the ticks as currency, for example?

I like the simplicity of the library and the output. Thanks for writing it!

@masayuki0812
Copy link
Member

Hello,

For X axis, you can use axis.x.categories option to change text for each category.
I updated the sample, so please check this: http://c3js.org/samples/categorized.html

For Y axis, you can use axis.y.tick.format option to format value displayed as tick text.
I added a sample for this option, so please check this: http://c3js.org/samples/axes_y_tick_format.html

Thank you for using this library :)

@unicron
Copy link
Author

unicron commented Feb 3, 2014

Great, thanks!

@unicron unicron closed this as completed Feb 3, 2014
@ntquyen
Copy link

ntquyen commented Sep 12, 2014

One more question: how do I increase font-size of the labels?

@masayuki0812
Copy link
Member

@ntquyen Please use c3-text class to specify css style.

@d3netxer
Copy link

d3netxer commented Dec 2, 2014

I modified the font of my x-axis with this css tag:

.c3 svg g g.c3-axis.c3-axis-x {
font: 20px sans-serif;
}

@c5236786
Copy link

if i only want to increase font size of bar chart? what would be the class?

@CityC
Copy link

CityC commented May 20, 2016

Would be nice to have the font size as a property for axes objects.

@craigg75
Copy link

I modified the font of my x-axis with this css tag:

.c3 svg g g.c3-axis.c3-axis-x {
font: 20px sans-serif;
}

This modifies the tick fonts too :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants