/// <summary>
/// Draws the point plot on a GDI+ surface against the provided x and y axes.
/// </summary>
/// <param name="g">The GDI+ surface on which to draw.</param>
/// <param name="xAxis">The X-Axis to draw against.</param>
/// <param name="yAxis">The Y-Axis to draw against.</param>
public virtual void Draw(IGraphics g, PhysicalAxis xAxis, PhysicalAxis yAxis)
{
SequenceAdapter data_ =
new SequenceAdapter(DataSource, DataMember, OrdinateData, AbscissaData);
float leftCutoff_ = xAxis.PhysicalMin.X - Marker.Size;
float rightCutoff_ = xAxis.PhysicalMax.X + Marker.Size;
for (int i = 0; i < data_.Count; ++i)
{
if (!Double.IsNaN(data_[i].X) && !Double.IsNaN(data_[i].Y))
{
PointF xPos = xAxis.WorldToPhysical(data_[i].X, false);
if (xPos.X < leftCutoff_ || rightCutoff_ < xPos.X)
{
continue;
}
PointF yPos = yAxis.WorldToPhysical(data_[i].Y, false);
Marker.Draw(g, (int)xPos.X, (int)yPos.Y);
if (Marker.DropLine)
{
PointD yMin = new PointD(data_[i].X, Math.Max(0.0f, yAxis.Axis.WorldMin));
PointF yStart = yAxis.WorldToPhysical(yMin.Y, false);
g.DrawLine(Marker.Pen, new Point((int)xPos.X, (int)yStart.Y), new Point((int)xPos.X, (int)yPos.Y));
}
}
}
}