using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Shapes; using System.Windows; using System.Windows.Media; using Microsoft.Research.DynamicDataDisplay; namespace Microsoft.Research.DynamicDataDisplay.Charts { /// /// Represents an infinite horizontal line with y-coordinate. /// public sealed class HorizontalLine : SimpleLine { /// /// Initializes a new instance of the class. /// public HorizontalLine() { } /// /// Initializes a new instance of the class with specified y coordinate. /// /// The y coordinate of line. public HorizontalLine(double yCoordinate) { Value = yCoordinate; } protected override void UpdateUIRepresentationCore() { var transform = Plotter.Viewport.Transform; Point p1 = new Point(Plotter.Viewport.Visible.XMin, Value).DataToScreen(transform); Point p2 = new Point(Plotter.Viewport.Visible.XMax, Value).DataToScreen(transform); LineGeometry.StartPoint = p1; LineGeometry.EndPoint = p2; } } }