Ejemplo n.º 1
0
 protected override Point GetToolTipPosition(ShapeMap sender, List<ShapeMap> 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.ChartPoint.X + 1 > (Min.X + Max.X)/2
         ? ToPlotArea(sender.ChartPoint.X, AxisTags.X) + overflow*.5 - DataTooltip.DesiredSize.Width
         : ToPlotArea(sender.ChartPoint.X, AxisTags.X) + unitW + overflow*.5;
     var y = ToPlotArea(sibilings.Select(s => s.ChartPoint.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.º 2
0
 protected override Point GetToolTipPosition(ShapeMap sender, List<ShapeMap> 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);
 }
Ejemplo n.º 3
0
 protected virtual Point GetToolTipPosition(ShapeMap sender, List<ShapeMap> sibilings)
 {
     DataTooltip.UpdateLayout();
     DataTooltip.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
     var x = sender.ChartPoint.X > (Min.X + Max.X)/2 ? ToPlotArea(sender.ChartPoint.X, AxisTags.X) - 10 - DataTooltip.DesiredSize.Width : ToPlotArea(sender.ChartPoint.X, AxisTags.X) + 10;
     var y = ToPlotArea(sibilings.Select(s => s.ChartPoint.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);
 }