/Main/src/DynamicDataDisplay/Charts/Shapes/VerticalRange.cs
C# | 34 lines | 26 code | 5 blank | 3 comment | 0 complexity | e0ae6d74570f08f4c712009894e974ad MD5 | raw file
Possible License(s): CC-BY-SA-3.0
1using System; 2using System.Collections.Generic; 3using System.Linq; 4using System.Text; 5using System.Windows.Media; 6using System.Windows; 7 8namespace Microsoft.Research.DynamicDataDisplay.Charts 9{ 10 /// <summary> 11 /// Paints vertical filled and outlined range in viewport coordinates. 12 /// </summary> 13 public sealed class VerticalRange : RangeHighlight 14 { 15 protected override void UpdateUIRepresentationCore() 16 { 17 var transform = Plotter.Viewport.Transform; 18 DataRect visible = Plotter.Viewport.Visible; 19 20 Point p1_top = new Point(Value1, visible.YMin).DataToScreen(transform); 21 Point p1_bottom = new Point(Value1, visible.YMax).DataToScreen(transform); 22 Point p2_top = new Point(Value2, visible.YMin).DataToScreen(transform); 23 Point p2_bottom = new Point(Value2, visible.YMax).DataToScreen(transform); 24 25 LineGeometry1.StartPoint = p1_top; 26 LineGeometry1.EndPoint = p1_bottom; 27 28 LineGeometry2.StartPoint = p2_top; 29 LineGeometry2.EndPoint = p2_bottom; 30 31 RectGeometry.Rect = new Rect(p1_top, p2_bottom); 32 } 33 } 34}