beto-rodriguez / LiveCharts2

Simple, flexible, interactive & powerful charts, maps and gauges for .Net, LiveCharts2 can now practically run everywhere Maui, Uno Platform, Blazor-wasm, WPF, WinForms, Xamarin, Avalonia, WinUI, UWP.
https://livecharts.dev
MIT License
4.38k stars 572 forks source link

Keep Data Point "Hover" enabled when Tooltips are hidden #1621

Open Jannik-M91 opened 1 month ago

Jannik-M91 commented 1 month ago

Is your feature request related to a problem? Please describe.

When tooltips on a chart are disabled using TooltipPosition="Hidden" this also disables the neat hover functionality which highlights a point once the cursor is above it.

Describe the solution you'd like

In my application I do not want tooltips, but I really like the hover feature, so it would be nice to have a setting to disable tooltips, but keep hover.

Describe alternatives you've considered

As a workaround I have defined a custom tooltip class which does nothing:

public class CustomTooltip : IChartTooltip<SkiaSharpDrawingContext>
{
    public void Show(IEnumerable<ChartPoint> foundPoints, Chart<SkiaSharpDrawingContext> chart)
    {
    }

    public void Hide(Chart<SkiaSharpDrawingContext> chart)
    {
    }
}

And added it to my chart:

      <lvc:PolarChart Name="MyChart"
                      ...>
        <lvc:PolarChart.Tooltip>
          <vmp:CustomTooltip />
        </lvc:PolarChart.Tooltip>
      </lvc:PolarChart>

This works but a config option would be cleaner and probably cause less overhead when drawing the chart.