@@ -1942,6 +1942,57 @@ public static PlotModel ExportTransparentTextAnnotationToSvg()
19421942 return plot ;
19431943 }
19441944
1945+ [ Example ( "#1312: Annotations ignore LineStyle.None and draw as if Solid" ) ]
1946+ public static PlotModel DrawArrowAnnotationsWithDifferentLineStyles ( )
1947+ {
1948+ LineStyle [ ] lineStyles = new [ ]
1949+ {
1950+ LineStyle . Solid ,
1951+ LineStyle . Dash ,
1952+ LineStyle . Dot ,
1953+ LineStyle . DashDot ,
1954+ LineStyle . DashDashDot ,
1955+ LineStyle . DashDotDot ,
1956+ LineStyle . DashDashDotDot ,
1957+ LineStyle . LongDash ,
1958+ LineStyle . LongDashDotDot ,
1959+ LineStyle . None ,
1960+ LineStyle . Automatic
1961+ } ;
1962+
1963+ var plot = new PlotModel ( ) { Title = "Annotation Line Styles" , Subtitle = "'None' should produce nothing" } ;
1964+ plot . Axes . Add ( new LinearAxis { Position = AxisPosition . Left , Minimum = 0 , Maximum = lineStyles . Length * 10 + 10 } ) ;
1965+ plot . Axes . Add ( new LinearAxis { Position = AxisPosition . Bottom , Minimum = 0 , Maximum = 100 } ) ;
1966+
1967+ double y = 10 ;
1968+ foreach ( var lineStyle in lineStyles )
1969+ {
1970+ plot . Annotations . Add ( new LineAnnotation ( )
1971+ {
1972+ LineStyle = lineStyle ,
1973+ Type = LineAnnotationType . Horizontal ,
1974+ Y = y ,
1975+ MinimumX = 10 ,
1976+ MaximumX = 45
1977+ } ) ;
1978+
1979+ plot . Annotations . Add ( new ArrowAnnotation ( )
1980+ {
1981+ LineStyle = lineStyle ,
1982+ Text = lineStyle . ToString ( ) ,
1983+ TextHorizontalAlignment = HorizontalAlignment . Center ,
1984+ TextVerticalAlignment = VerticalAlignment . Bottom ,
1985+ TextPosition = new DataPoint ( 50 , y ) ,
1986+ StartPoint = new DataPoint ( 55 , y ) ,
1987+ EndPoint = new DataPoint ( 90 , y )
1988+ } ) ;
1989+
1990+ y += 10 ;
1991+ }
1992+
1993+ return plot ;
1994+ }
1995+
19451996 private class TimeSpanPoint
19461997 {
19471998 public TimeSpan X { get ; set ; }
0 commit comments