0

I have a variable length series array which I feed to the Chartist.js pie chart. It draws slices in terrible red colors.

There is an HSL color example in the Documentation, but it starts from red too. How do I start with a color #0099ff for the max value and then set different tints to the rest?

The slice color can be set by:

.on('draw', function(data) {
    if (data.type === 'slice') {
        data.element.attr({
            style: 'fill: hsl(?,?,?);'
        });
    }
})

I can't figure out how to manipulate the hsl() string to start with #0099ff and then change the max color tint based on the value.

linuxoid
  • 1,415
  • 3
  • 14
  • 32

0 Answers0