2

I'm currently using a Polar Area chart from the chart.js lib, and I'm looking to style the scale numbers via CSS.

Below are two examples:

What it currently looks like:

enter image description here

What I want it to look like:

enter image description here

I'm not sure how to access those elements and apply CSS to them.

Some help to understand that process would be much appreciated.

Thanks!

PRMoureu
  • 12,817
  • 6
  • 38
  • 48

1 Answers1

0

Charts.js produces a bit mapped image of a chart on a canvas element. Canvas elements are not subdivided into component elements that can individually styled using CSS (which is used for styling document elements in the DOM).

Styling of chart elements is actually achieved using canvas drawing options when the element is painted. Charts.js allows you to specify these.

A quick tour of documentation suggests you can specify the appearance of legend text using legend configuration options.

Worth looing into, the HTML legend call back may provide the means of making painted legends respond to CSS styling. See this related question Custom Legend with ChartJS v2.0

traktor
  • 17,588
  • 4
  • 32
  • 53