c3js: Is there a way to change font size?

Kludge picture Kludge · Feb 11, 2015 · Viewed 20k times · Source

Can I enlarge the font of c3js charts, such as in axis labels, data labels or categories? I'm interested in setting the general-case font to a larger one.

I searched the docs and couldn't find anything that related to "font" in any way.

Answer

aberna picture aberna · Feb 11, 2015

C3 give some classes for each element when generating. So, you can change the style of the elements by using those classes with CSS.

Example: 1. Line style The lines have c3-line-[id] class, so this class can be used to define the style in css.

A Web Inspector would be useful to check classes.

In your case labels are:

  • c3-legend-item-event
  • tick
  • ....

From C3js documentation: http://c3js.org/gettingstarted.html