Chartist-js: How to change font size and color on chart?

Created on 13 Apr 2016  路  3Comments  路  Source: gionkunz/chartist-js

The font size on the charts are to small and hard to read on certain colors. Is there a way to change these attributes?

I can do this do make the whole pie red but setting color or font-size doesn't make a change:

.ct-series-x .ct-slice-pie {
    fill: #f05b4f
}

<div class="ct-chart ct-golden-section ct-series-x ct-slice-pie" id="chart2"></div>

Most helpful comment

If you look in chartist.css, you can see that the only class that has a font-size specified is .ct-label. You'll have to override that if you want to set the size and colour.

All 3 comments

If you look in chartist.css, you can see that the only class that has a font-size specified is .ct-label. You'll have to override that if you want to set the size and colour.

Yup, general approach of chartist is to use CSS for styling.

I got stuck on this. Remember CSS priority and to import your custom stylesheet after the chartist one.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pjfsilva picture pjfsilva  路  4Comments

eddr picture eddr  路  3Comments

FabienPapet picture FabienPapet  路  4Comments

ShlomoRosenheimer picture ShlomoRosenheimer  路  3Comments

unhinged picture unhinged  路  3Comments