[context menu] Refactor the logic to be reusable #2134
Labels
:all
Applies to all chart types
enhancement
New feature or request
:refactor
Code refactor
:tooltip
Related to hover tooltip
The current context-menu logic is tied to the tooltip logic, the values that we are passing to the context menu are related to the tooltip and its state is specific to the chart data tooltip.
We should refactor the current code to make it reusable to introduce more "in-chart" actions, like clicking on the chart title, axis title, axis lines, and background to provide a set of actions like changing values/text or saving the chart as an image etc.
The idea is to split the context menu/right-click event state and the tooltip pinned state so we can reuse the right-click and the context menu in multiple situations.
We are also polluting the state with selected
TooltipValues
. We can probably put the values in the tooltip local state instead, as they are not required by the chart in any way right now.The text was updated successfully, but these errors were encountered: