Пример #1
0
        protected internal override void DataMouseLeave(object sender, MouseEventArgs e)
        {
            if (!Hoverable)
            {
                return;
            }

            var s = sender as Shape;

            if (s == null)
            {
                return;
            }

            var shape = Series.SelectMany(
                x =>
                x.IsPrimitive
                        ? x.Tracker.Primitives.Select(v => v.Value)
                        : x.Tracker.Instances.Select(v => v.Value))
                        .FirstOrDefault(x => Equals(x.HoverShape, s));

            if (shape == null)
            {
                return;
            }

            var targetAxis = Invert ? shape.Series.ScalesYAt : shape.Series.ScalesXAt;

            var sibilings = Invert
                ? Series.SelectMany(
                x =>
                x.IsPrimitive
                            ? x.Tracker.Primitives.Select(v => v.Value)
                            : x.Tracker.Instances.Select(v => v.Value))
                            .Where(se => Math.Abs(se.ChartPoint.Y - shape.ChartPoint.Y) < AxisY[targetAxis].S * .01)
                            .ToList()
                : Series.SelectMany(
                x =>
                x.IsPrimitive
                            ? x.Tracker.Primitives.Select(v => v.Value)
                            : x.Tracker.Instances.Select(v => v.Value))
                            .Where(x => x.IsHighlighted).ToList();

            foreach (var p in sibilings)
            {
                if (ShapeHoverBehavior == ShapeHoverBehavior.Dot)
                {
                    p.Shape.Fill   = p.Series.Stroke;
                    p.Shape.Stroke = new SolidColorBrush {
                        Color = PointHoverColor
                    };
                }
                else
                {
                    p.Shape.Opacity = 1;
                }
            }
            TooltipTimer.Stop();
            TooltipTimer.Start();
        }
Пример #2
0
        public override void DataMouseLeave(object sender, MouseEventArgs e)
        {
            var s = sender as Shape;

            if (s == null)
            {
                return;
            }

            var shape = HoverableShapes.FirstOrDefault(x => Equals(x.Shape, s));

            if (shape == null)
            {
                return;
            }

            shape.Target.Fill   = shape.Series.Stroke;
            shape.Target.Stroke = new SolidColorBrush {
                Color = PointHoverColor
            };

            TooltipTimer.Stop();
            TooltipTimer.Start();
        }