diff --git a/src/LiveChartsCore.Behaviours/LiveChartsCore.Behaviours.csproj b/src/LiveChartsCore.Behaviours/LiveChartsCore.Behaviours.csproj index c72bde7e4..83a8c4844 100644 --- a/src/LiveChartsCore.Behaviours/LiveChartsCore.Behaviours.csproj +++ b/src/LiveChartsCore.Behaviours/LiveChartsCore.Behaviours.csproj @@ -18,7 +18,7 @@ LiveChartsCore.Behaviours LiveChartsCore.Behaviours - 2.0.0-rc2 + 2.0.0-ramseyrc5 icon.png Adds user interaction for touch screens, touch pads and mouse. MIT diff --git a/src/LiveChartsCore/Chart.cs b/src/LiveChartsCore/Chart.cs index 8f1223bd0..403446881 100644 --- a/src/LiveChartsCore/Chart.cs +++ b/src/LiveChartsCore/Chart.cs @@ -369,6 +369,15 @@ internal virtual void InvokePointerMove(LvcPoint point) if (!_isPanning) return; _pointerPanningPosition = point; _panningThrottler.Call(); + + // fire the visual elements event. + var hitElements = + _everMeasuredElements.OfType>() + .Cast>() + .SelectMany(x => x.IsHitBy(this, point)); + + foreach (var ve in hitElements) + ve.InvokePointerMove(new VisualElementEventArgs(this, ve, point)); } internal virtual void InvokePointerUp(LvcPoint point, bool isSecondaryAction) @@ -387,6 +396,15 @@ internal virtual void InvokePointerUp(LvcPoint point, bool isSecondaryAction) _isPanning = false; _pointerPanningPosition = point; _panningThrottler.Call(); + + // fire the visual elements event. + var hitElements = + _everMeasuredElements.OfType>() + .Cast>() + .SelectMany(x => x.IsHitBy(this, point)); + + foreach (var ve in hitElements) + ve.InvokePointerUp(new VisualElementEventArgs(this, ve, point)); } internal void InvokePointerLeft() diff --git a/src/LiveChartsCore/LiveChartsCore.csproj b/src/LiveChartsCore/LiveChartsCore.csproj index 1651afdb8..bcab9f4fb 100644 --- a/src/LiveChartsCore/LiveChartsCore.csproj +++ b/src/LiveChartsCore/LiveChartsCore.csproj @@ -17,7 +17,7 @@ LiveChartsCore LiveChartsCore - 2.0.0-rc2 + 2.0.0-ramseyrc5 icon.png Simple, flexible, interactive and powerful data visualization for .Net, this is the core package probably you need another package also unless you are building your own backed. MIT diff --git a/src/LiveChartsCore/VisualElements/VisualElement.cs b/src/LiveChartsCore/VisualElements/VisualElement.cs index 61b37b661..f774afba8 100644 --- a/src/LiveChartsCore/VisualElements/VisualElement.cs +++ b/src/LiveChartsCore/VisualElements/VisualElement.cs @@ -82,7 +82,7 @@ public abstract class VisualElement : ChartElement _locationUnit; set => SetProperty(ref _locationUnit, value); } /// - /// Gets or sets the axis index where the series is scaled in the X plane, the index must exist + /// Gets or sets the axis index where the series is scaled in the X plane, the index must exist /// in the collection. /// /// @@ -91,7 +91,7 @@ public abstract class VisualElement : ChartElement _scalesXAt; set => SetProperty(ref _scalesXAt, value); } /// - /// Gets or sets the axis index where the series is scaled in the Y plane, the index must exist + /// Gets or sets the axis index where the series is scaled in the Y plane, the index must exist /// in the collection. /// /// @@ -110,6 +110,10 @@ public abstract class VisualElement : ChartElement public event VisualElementHandler? PointerDown; + public event VisualElementHandler? PointerMove; + + public event VisualElementHandler? PointerUp; + /// public override void Invalidate(Chart chart) { @@ -198,6 +202,16 @@ internal void InvokePointerDown(VisualElementEventArgs args) PointerDown?.Invoke(this, args); } + internal void InvokePointerMove(VisualElementEventArgs args) + { + PointerMove?.Invoke(this, args); + } + + internal void InvokePointerUp(VisualElementEventArgs args) + { + PointerUp?.Invoke(this, args); + } + internal abstract IAnimatable?[] GetDrawnGeometries(); internal virtual void AlignToTopLeftCorner() diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp/LiveChartsCore.SkiaSharpView.csproj b/src/skiasharp/LiveChartsCore.SkiaSharp/LiveChartsCore.SkiaSharpView.csproj index a278fc85c..283f87d99 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharp/LiveChartsCore.SkiaSharpView.csproj +++ b/src/skiasharp/LiveChartsCore.SkiaSharp/LiveChartsCore.SkiaSharpView.csproj @@ -17,7 +17,7 @@ LiveChartsCore.SkiaSharpView LiveChartsCore.SkiaSharpView - 2.0.0-rc2 + 2.0.0-ramseyrc5 icon.png Simple, flexible, interactive and powerful data visualization for .Net, this package contains the SkiaSharp backend. MIT diff --git a/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsCore.SkiaSharpView.Maui.csproj b/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsCore.SkiaSharpView.Maui.csproj index 96a5d20ff..bceaa49a0 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsCore.SkiaSharpView.Maui.csproj +++ b/src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsCore.SkiaSharpView.Maui.csproj @@ -14,7 +14,7 @@ 10.0.17763.0 6.5 - 2.0.0-rc2 + 2.0.0-ramseyrc5 icon.png Simple, flexible, interactive and powerful data visualization for Maui. MIT