public void Draw(Chart2DSpriteContainer sprites, Vector2 direction, Vector2 offset) { sprites.Color = this.color; sprites.DrawLine(offset - direction * this.lengthNegative, offset + direction * this.lengthPositive, sprites.ThinLineWidth); }
public void Draw(Chart2DSpriteContainer sprites, IAxis axis1, IAxis axis2, Vector2 offset) { sprites.Color = this.color; Vector2 lastPoint = default(Vector2); bool first = true; foreach (var point in this.drawablePoints) { var pd = point.Position; var p = offset + new Vector2((float)axis1.DataToChart(pd.X), (float)axis2.DataToChart(pd.Y)); if (first) { first = false; lastPoint = p; continue; } sprites.DrawLine(lastPoint, p, sprites.ThickLineWidth); lastPoint = p; } }
public void Draw(Chart2DSpriteContainer sprites, IAxis parallelAxis, IAxis perpendicularAxis, Vector2 offset, Vector2 direction, Vector2 axisUnit) { sprites.Color = this.color; var minOffset = offset + direction * (float)parallelAxis.DataToChart(parallelAxis.MinValue); var maxOffset = offset + direction * (float)parallelAxis.DataToChart(parallelAxis.MaxValue); int minI = this.repeat ? (int)((perpendicularAxis.MinValue - this.StartValue) / this.interval) : 0; int maxI = this.repeat ? (int)((perpendicularAxis.MaxValue - this.StartValue) / this.interval) : 0; for (int i = minI; i <= maxI; i++) { var position = axisUnit * (float)perpendicularAxis.DataToChart(this.StartValue + this.interval * i); sprites.DrawLine( minOffset + position, maxOffset + position, sprites.ThinLineWidth); } }