Ejemplo n.º 1
0
        protected override Point GetToolTipPosition(HoverableShape sender, List <HoverableShape> sibilings)
        {
            DataToolTip.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
            var x = sender.Value.X > (Min.X + Max.X) / 2
                ? ToPlotArea(sender.Value.X, AxisTags.X) - 10 - DataToolTip.DesiredSize.Width
                : ToPlotArea(sender.Value.X, AxisTags.X) + 10;
            var y = sender.Value.Y > (Min.Y + Max.Y) / 2
                ? ToPlotArea(sender.Value.Y, AxisTags.Y) + 10
                : ToPlotArea(sender.Value.Y, AxisTags.Y) - 10 - DataToolTip.DesiredSize.Height;

            return(new Point(x, y));
        }
Ejemplo n.º 2
0
        protected virtual Point GetToolTipPosition(HoverableShape sender, List <HoverableShape> sibilings)
        {
            DataToolTip.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
            var x = sender.Value.X > (Min.X + Max.X) / 2
                                ? ToPlotArea(sender.Value.X, AxisTags.X) - 10 - DataToolTip.DesiredSize.Width
                                : ToPlotArea(sender.Value.X, AxisTags.X) + 10;
            var y = ToPlotArea(sibilings.Select(s => s.Value.Y).DefaultIfEmpty(0).Sum()
                               / sibilings.Count, AxisTags.Y);

            y = y + DataToolTip.DesiredSize.Height > ActualHeight
                                ? y - (y + DataToolTip.DesiredSize.Height - ActualHeight) - 5
                                : y;
            return(new Point(x, y));
        }
Ejemplo n.º 3
0
        protected override Point GetToolTipPosition(HoverableShape sender, List <HoverableShape> sibilings)
        {
            DataToolTip.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
            var unitW    = ToPlotArea(1, AxisTags.X) - PlotArea.X + 5;
            var overflow = unitW - MaxColumnWidth > 0 ? unitW - MaxColumnWidth : 0;

            unitW = unitW > MaxColumnWidth ? MaxColumnWidth : unitW;
            var x = sender.Value.X + 1 > (Min.X + Max.X) / 2
                ? ToPlotArea(sender.Value.X, AxisTags.X) + overflow * .5 - DataToolTip.DesiredSize.Width
                : ToPlotArea(sender.Value.X, AxisTags.X) + unitW + overflow * .5;
            var y = ToPlotArea(sibilings.Where(s => s.Series is StackedBarSeries).Select(s => s.Value.Y).DefaultIfEmpty(0).Sum() * 0.5, AxisTags.Y);

            y = y + DataToolTip.DesiredSize.Height > ActualHeight
                ? y - (y + DataToolTip.DesiredSize.Height - ActualHeight) - 5
                : y;
            return(new Point(x, y));
        }