bernii / gauge.js

100% native and cool looking JavaScript gauge
MIT License
1.42k stars 391 forks source link

Colour ark from 0 to maxValue #82

Open glennpierce opened 9 years ago

glennpierce commented 9 years ago

Hi. I have setup the gauge to have 0 in the centre like https://jsfiddle.net/berni/smNjl/

Is it possible to have one colour up to 0 and another beyond 0. This is all the time not just when the needle is in that area.

Thanks

okierie commented 9 years ago

add this option : percentColors: [[0.0, "#51FA51"],[0.5, "#FAFA51"], [1.0, "#FA5151"]]

if your 0 is at the middle of the gauge then the color of the bar will be #FAFA51 ( at 50%)

musti2 commented 8 years ago

percentColors = [[0.0, "#a9d70b" ], [0.50, "#f9c802"], [1.0, "#ff0000"]]; does not work with Donut gauge...

am i doing something wrong here? percentColors: [[0.0, "#a9d70b" ], [0.50, "#f9c802"], [1.0, "#ff0000"]], limitMax: 'false', colorStart: '#ffcf45', strokeColor: '#E0E0E0', generateGradient: false