I am currently working with Highcharts version 4.1.10
In my bar chart, I have implemented a feature where the color of the bar changes when its value exceeds a certain threshold.
//This function is called at regular intervals by a timeout
function myTimeoutFunction() {
var xmlRequest = $.ajax({
dataType: "json",
url: applicationPath + 'myWebapi/valuesToMeasure',
cache: false,
success: myFunctionOnSuccess,
error: myFunctionOnError
});
}
function myFunctionOnSuccess(myData) {
if (myData.value > 500000000) {
mySeriesDataArray.data.push({ y: myData.value, color: "rgb(255, 0, 0)" });
}
else {
mySeriesDataArray.data.push({ y: myData.value);
}
//...
mySeries.setData(mySeriesDataArray.data,true);
}
The series data undergoes updates periodically through a timeout mechanism.
When a value surpasses the threshold, the bar color changes as intended to red.
However, upon the value dropping back below the threshold, the bar remains red. It seems like the color style persists even after the condition is no longer met.
Is there a way in Highcharts to reset the color of the bar to the original one chosen automatically by the library for the series?