show method

void show(
  1. dynamic x,
  2. double y, [
  3. String? xAxisName,
  4. String? yAxisName,
])

Displays the tooltip at the specified x and y-values.

  • x & y - x & y point values at which the tooltip needs to be shown.

  • xAxisName - name of the x axis the given point must be bind to.

  • yAxisName - name of the y axis the given point must be bind to.

Implementation

void show(dynamic x, double y, [String? xAxisName, String? yAxisName]) {
  assert(x != null);
  assert(!y.isNaN);
  final RenderBehaviorArea? parent = parentBox as RenderBehaviorArea?;
  if (parent != null) {
    final RenderChartAxis? xAxis =
        xAxisName != null ? parent.axisFromName(xAxisName) : parent.xAxis;
    final RenderChartAxis? yAxis =
        yAxisName != null ? parent.axisFromName(yAxisName) : parent.yAxis;
    final Offset position =
        rawValueToPixelPoint(x, y, xAxis, yAxis, parent.isTransposed);
    showByPixel(position.dx, position.dy);
  }
}