[Bug] fixed tooltip on nonAxisChart does not working #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[Bug #3] fixed tooltip on nonAxisChart does not working
Related issue: #2720

As you can see on above video, the fixed tooltip on axisChart(Line chart) is working well.
But in the case of nonAxisChart(donut chart), fixed tooltip does not working.
Problem Solving Description
Tooltip.js의
seriesHoverByContext()함수에서는 차트에서 마우스 호버 이벤트가 발생했을 때 툴팁을 업데이트하고 표시하는 로직이 이루어집니다.함수의 마지막 부분을 보면,
fixedTooltip이 활성화된 경우, drawFixedTooltipRect()가 호출되어 툴팁의 위치가 고정됩니다.
nonAxisChartsTooltips()가 실행되면서 mousemove 또는 touchmove 이벤트에 따라 clientX, clientY 기준으로 툴팁 위치가 다시 계산됩니다.
Issue
Fixed Tooltip이 적용된 후에도 nonAxisChartsTooltips()에서 재계산된 위치로 덮어씌워지면서 툴팁이 고정되지 않고 움직이는 문제가 발생합니다.
Solution
두 코드 블록의 실행 순서를 변경하여, nonAxisChartsTooltips()가 먼저 실행되고 이후 drawFixedTooltipRect()가 실행되도록 수정하면 해결할 수 있습니다.
Problem Solving Description
In Tooltip.js, the seriesHoverByContext() function handles updating and displaying the tooltip when a mouse hover event occurs on the chart.
At the end of this function, the following sequence is executed:
If fixedTooltip is enabled, drawFixedTooltipRect() is called to set the tooltip's fixed position.
The nonAxisChartsTooltips() function is executed, which recalculates the tooltip position based on clientX and clientY during mousemove or touchmove events.
Issue
Even after applying the fixed tooltip position, nonAxisChartsTooltips() recalculates the tooltip position, overriding the fixed position and causing the tooltip to move instead of staying fixed.
Solution
This issue can be resolved by changing the execution order of the two code blocks. If nonAxisChartsTooltips() runs first and drawFixedTooltipRect() runs afterward, the tooltip position will be recalculated first, and then the fixed position will be applied correctly.