Support for dark and light mode in ChartKick

83 views Asked by At

Chat JS seems to be offering dark and light mode support according to this GitHub PR: https://github.com/chartjs/Chart.js/pull/8685

The question is, how to call colorMode: "auto" in ChartKick as ChartJS default is none...

1

There are 1 answers

1
LeeLenalee On BEST ANSWER

The mr got closed, so there is no colorMode option in chart.js. To achieve a dark/light mode you will need to adjust all of the colors yourself.

The main colors you want to adjust are data.datasets[datasetIndex].backgroundColor and options.scales[scaleId].grid.color. That will make most of your chart be visible on light and dark