radzenhq / radzen-blazor

Radzen Blazor is a set of 90+ free native Blazor UI components packed with DataGrid, Scheduler, Charts and robust theming including Material design and FluentUI.
https://www.radzen.com
MIT License
3.47k stars 777 forks source link

Tooltip on click for graphs for Blazor server #505

Open eharbitz opened 2 years ago

eharbitz commented 2 years ago

Is your feature request related to a problem? Please describe. When using RadzenAreaSeries (or other chart components) with a lot of data, the tooltip can lag behind the mouse pointer with several seconds.

Describe the solution you'd like

  1. A parameter for the property RadzenChartTooltipOptions called something like TooltipOnClick which defaults to false.
  2. If TooltipOnClick is true, nothing happens until the user clicks somewhere on the chart. Then, the callback usually called when moving the mouse is triggered and the tooltip appears at that place and stays there.
  3. If clicking outside the graph, the tooltip disappears.
  4. While hovering over the graph, no messages are being sent. Today, even if Visible is set to false for RadzenChartTooltipOptions, a lot of messages are being sent to the server. We solve this by applying the style pointer-events: none; to the chart. Would be nice if this could be incorporated into the library.

Additional context I see there has been some improvements in the javascript-file reducing the number of rountrips: https://github.com/radzenhq/radzen-blazor/commit/f5fa06139285f6bcedf800be3d5ae6167a9fa11f#diff-2ee7884aeab000c119f6ada9611254c94e6e12f6b64553c418b166c301917434R30

Today there is a timeout restricting the number of times callback.apply(ctx, args); is called. Would be great if this could only be called on click.

akorchev commented 1 year ago

We would accept a pull request for this.