/// <summary> /// Inverse transform the specified screen point. /// </summary> /// <param name="x">The x coordinate.</param> /// <param name="y">The y coordinate.</param> /// <param name="yaxis">The y-axis.</param> /// <returns>The data point.</returns> public virtual DataPoint InverseTransform(double x, double y, Axis yaxis) { return new DataPoint(this.InverseTransform(x), yaxis != null ? yaxis.InverseTransform(y) : 0); }
/// <summary> /// Zooms at the specified position. /// </summary> /// <param name="axis"> /// The axis. /// </param> /// <param name="factor"> /// The zoom factor. /// </param> /// <param name="x"> /// The position to zoom at. /// </param> public void ZoomAt(Axis axis, double factor, double x = double.NaN) { if (double.IsNaN(x)) { double sx = (axis.Transform(axis.ActualMaximum) + axis.Transform(axis.ActualMinimum)) * 0.5; x = axis.InverseTransform(sx); } axis.ZoomAt(factor, x); }
/// <summary> /// Transforms the specified point from screen space to data space. /// </summary> /// <param name="p">The point.</param> /// <param name="xaxis">The x axis.</param> /// <param name="yaxis">The y axis.</param> /// <returns>The data point.</returns> public static DataPoint InverseTransform(ScreenPoint p, Axis xaxis, Axis yaxis) { return xaxis.InverseTransform(p.x, p.y, yaxis); }