Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chartist.js grid color

Tags:

chartist.js

I would like to change grid color on Chartist.js from default grey. I tried to override ct-grid-color setting, but probably did something incorrectly. Can anyone please suggest how to do it?

like image 703
onlyvix.blogspot.com Avatar asked Jan 07 '23 22:01

onlyvix.blogspot.com


2 Answers

Just insert in your CSS.

.ct-grid{ stroke: red;}
like image 192
Thái An Nguyễn Avatar answered Mar 02 '23 21:03

Thái An Nguyễn


grid lines:

.ct-grids line {
  color: steelblue;
}

.. and don't forget the labels! ..

grid labels:

.ct-labels span {
  color: steelblue;
}

The reason why targeting only ".ct-grid" won't work is due to css specificity. Basically the more specific the css, the more important it becomes so ..

.ct-grids line { } > .ct-grids { }

If it's a little confusing, a nifty little tool is Keegan Street's css specificity calculator.

like image 25
Butsuri Avatar answered Mar 02 '23 23:03

Butsuri