Closed tomekit closed 3 years ago
I was playing with using set
with some random small fraction value using the setTimeout
and it indeed helped force refreshing graphs, but ultimately was too hacky and too buggy.
Since I didn't need the exact values displayed on the graph, I've decided to leave the maxValue
alone and change the needle using the percentage calculated and set using the set
method. Simple approach change, but solved my issue.
I need to dynamically update gauge chart when getting data from AJAX request. It does seem that if
maxValue
is being set:gauge.maxValue = maxValue;
it doesn't always update the graph. However if you call thegauge.set(newActualValue)
aftermaxValue
is being set then the graph always update correctly.In my use case I often need to update the
maxValue
without updating theactualValue
, which leads to stale gauge chart.Please find below example which illustrate this issue:
Graph is being update after first few maxValue changes, then it becomes stale. However if you uncomment lines which set the
actualValue
, then it keeps being updated indefinitely.Is there any way to force refresh graph? I was trying to make bogus change of
actualValue
:but it turns out it doesn't help.