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*3 > 0 ? unitW - MaxColumnWidth*3 : 0; unitW = unitW > MaxColumnWidth*3 ? MaxColumnWidth*3 : 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.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); }
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); }
protected override Point GetToolTipPosition(HoverableShape sender, List<HoverableShape> sibilings) { Size desiredSize1 = this.DesiredSize; double width = desiredSize1.Width; desiredSize1 = this.DesiredSize; double height = desiredSize1.Height; Size desiredSize2; double num1; if (width >= height) { desiredSize2 = this.DesiredSize; num1 = desiredSize2.Height; } else { desiredSize2 = this.DesiredSize; num1 = desiredSize2.Width; } double num2 = num1; desiredSize2 = this.DesiredSize; double x = (desiredSize2.Width - num2)/2.0 + 10.0; desiredSize2 = this.DesiredSize; double y = (desiredSize2.Height - num2)/2.0 + 10.0; return new Point(x, y); }