naikus / svg-gauge

Minimalistic, animated SVG gauge. Zero dependencies
MIT License
319 stars 74 forks source link

Update gauge on max value change #61

Closed bokisha closed 2 years ago

bokisha commented 2 years ago

Before this change, when you call public function updateMaxValue, nothing will happen. Adding updateGauge will fix this

Similiar issue like https://github.com/naikus/svg-gauge/issues/59

Real reason for this update is because i want to extend angular fork with option to change maxValue dynamically. In my use case, initially, i have fixed max value which can be lower than value after data has been loaded. That causes the gauge not showing real value, and it is showing maxValue. Updating max value along with value will fix that (and i don't wanna recreate gauge object because of performance)

naikus commented 2 years ago

@bokisha Thanks for this fix!

mboukhalfa commented 2 years ago

Thanks for the fix should we close https://github.com/mattlewis92/angular-gauge/pull/15