Skip to content

Commit

Permalink
add properties to customize animations on default tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
beto-rodriguez committed Dec 13, 2024
1 parent 7543d62 commit 774d517
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@ public Paint? BackgroundPaint
/// </summary>
public double TextSize { get; set; } = 16;

/// <summary>
/// Gets or sets the easing function.
/// </summary>
public Func<float, float> Easing { get; set; } = EasingFunctions.EaseOut;

/// <summary>
/// Gets or sets the animations speed.
/// </summary>
public TimeSpan AnimationsSpeed { get; set; } = TimeSpan.FromMilliseconds(150);

/// <inheritdoc cref="IChartTooltip.Show(IEnumerable{ChartPoint}, Chart)" />
public void Show(IEnumerable<ChartPoint> foundPoints, Chart chart)
{
Expand All @@ -103,11 +113,11 @@ public void Show(IEnumerable<ChartPoint> foundPoints, Chart chart)

_container.Geometry.Fill = BackgroundPaint;
_container.Geometry.Wedge = wedge;
_container.Geometry.WedgeThickness = 2;
_container.Geometry.WedgeThickness = 3;

_container
.Animate(
new Animation(EasingFunctions.EaseOut, TimeSpan.FromMilliseconds(150)),
new Animation(Easing, AnimationsSpeed),
nameof(IDrawnElement.Opacity),
nameof(IDrawnElement.ScaleTransform),
nameof(IDrawnElement.X),
Expand Down

0 comments on commit 774d517

Please sign in to comment.