Chart.js icon indicating copy to clipboard operation
Chart.js copied to clipboard

Background color if value >0

Open Dergonic opened this issue 10 years ago • 2 comments

Hello

I'm currently charting my internet connection bandwith from my Raspberry pi. I get the ping, download speed, upload speed. I put everything in a graph (chartJs v2) and all is working good : http://dergonic.dyndns.org/speedtest/

Now, for each value, i can determine if my main computer is on or not (see 'playorison' in the table). I would like to have some kind of background if 'playorison' is >0 and/or another color when it is <=0

Does someone have an idea on how I could do this or something equivalent ?

thanks Dergonic

Dergonic avatar Feb 08 '16 14:02 Dergonic

Solved by adding a second scale that goes from 0 to 1 and adding a 'line' chart attached to it. I hide the line of this chart but enabled the background-color

Dergonic avatar Feb 08 '16 15:02 Dergonic

@Dergonic interesting approach. If you're interested in looking more into this stuff there's some discussion in #511 and the issues that are linked in there. My thought's were that a version 2.1 would include some new functionality to handle customized markers, fills, and gradients.

etimberg avatar Feb 08 '16 15:02 etimberg