Tooltip delay when updating a state. #106
-
As you can see in the video the first part is when im updating the state. What im trying to do is having different backgroundColor in my tooltip based on my index. (doesn't work even with the state) tooltip: {
trigger: "axis",
formatter: function (params) {
// setCurrentIndex(params[0].dataIndex);
return params[0].dataIndex === 0
? `${rangeLow.format("DD")}-${rangeLow.add(firstWeek.length-1, "day").format("DD MMM")} \n ${params[0].value.toFixed(1)}%` //prettier-ignore
: params[0].dataIndex === 52
? `${rangeHigh.subtract(lastWeek.length-1, "day").format("DD")}-${rangeHigh.format("DD MMM")} \n ${params[0].value.toFixed(1)}%` //prettier-ignore
: `${newRangeLow.add(params[0].dataIndex-1, "week").format("DD")}-${newRangeLow.add(params[0].dataIndex-1,"week").add(6,'day').format("DD MMM")} \n ${params[0].value.toFixed(1)}%` //prettier-ignore
},
// backgroundColor: currentIndex > 39 ? "#FF5630" : "#A19D9A", Screen.Recording.2023-08-25.at.10.57.37.AM.mov |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
Any news about this one? |
Beta Was this translation helpful? Give feedback.
-
This feature is currently not supported in echarts. |
Beta Was this translation helpful? Give feedback.
-
If you use useState it will cause re-rendering, which will be delayed. |
Beta Was this translation helpful? Give feedback.
-
Is there an other way to make it happen or is not possible currently? |
Beta Was this translation helpful? Give feedback.
-
It is also possible to implement it yourself by patching the echarts package |
Beta Was this translation helpful? Give feedback.
It is possible to make a feature request to the echarts project to have the backgroundColor support callback functions, but this is not a common feature