Skip to content

Commit fd6453e

Browse files
committed
Add example for MinimumSegmentLength issue #1044
1 parent 1ed15f0 commit fd6453e

1 file changed

Lines changed: 42 additions & 19 deletions

File tree

  • Source/Examples/ExampleLibrary/Issues

Source/Examples/ExampleLibrary/Issues/Issues.cs

Lines changed: 42 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,29 @@ namespace ExampleLibrary
2020
[Examples("Z1 Issues")]
2121
public class Issues
2222
{
23+
[Example("#1044 MinimumSegmentLength not working")]
24+
public static PlotModel MinimumSegmentLength()
25+
{
26+
var model = new PlotModel() { Title = "MinimumSegmentLength", Subtitle = "Three different curves should be visible" };
27+
for (var msl = 0; msl <= 200; msl += 100)
28+
{
29+
var series = new LineSeries
30+
{
31+
Title = $"MinimumSegmentLength = {msl}",
32+
MinimumSegmentLength = msl
33+
};
34+
35+
for (int i = 0; i < 1000; i++)
36+
{
37+
series.Points.Add(new DataPoint(i, Math.Sin(i * 0.01)));
38+
}
39+
40+
model.Series.Add(series);
41+
}
42+
43+
return model;
44+
}
45+
2346
[Example("#1303 Problem with infinity size polyline")]
2447
public static PlotModel InfinitySizePolyline()
2548
{
@@ -1956,7 +1979,7 @@ public static PlotModel ExportTransparentTextAnnotationToSvg()
19561979
[Example("#1312: Annotations ignore LineStyle.None and draw as if Solid")]
19571980
public static PlotModel DrawArrowAnnotationsWithDifferentLineStyles()
19581981
{
1959-
LineStyle[] lineStyles = new []
1982+
LineStyle[] lineStyles = new[]
19601983
{
19611984
LineStyle.Solid,
19621985
LineStyle.Dash,
@@ -1974,29 +1997,29 @@ public static PlotModel DrawArrowAnnotationsWithDifferentLineStyles()
19741997
var plot = new PlotModel() { Title = "Annotation Line Styles", Subtitle = "'None' should produce nothing" };
19751998
plot.Axes.Add(new LinearAxis { Position = AxisPosition.Left, Minimum = 0, Maximum = lineStyles.Length * 10 + 10 });
19761999
plot.Axes.Add(new LinearAxis { Position = AxisPosition.Bottom, Minimum = 0, Maximum = 100 });
1977-
2000+
19782001
double y = 10;
19792002
foreach (var lineStyle in lineStyles)
19802003
{
19812004
plot.Annotations.Add(new LineAnnotation()
1982-
{
1983-
LineStyle = lineStyle,
1984-
Type = LineAnnotationType.Horizontal,
1985-
Y = y,
1986-
MinimumX = 10,
1987-
MaximumX = 45
1988-
});
1989-
2005+
{
2006+
LineStyle = lineStyle,
2007+
Type = LineAnnotationType.Horizontal,
2008+
Y = y,
2009+
MinimumX = 10,
2010+
MaximumX = 45
2011+
});
2012+
19902013
plot.Annotations.Add(new ArrowAnnotation()
1991-
{
1992-
LineStyle = lineStyle,
1993-
Text = lineStyle.ToString(),
1994-
TextHorizontalAlignment = HorizontalAlignment.Center,
1995-
TextVerticalAlignment = VerticalAlignment.Bottom,
1996-
TextPosition = new DataPoint(50, y),
1997-
StartPoint = new DataPoint(55, y),
1998-
EndPoint = new DataPoint(90, y)
1999-
});
2014+
{
2015+
LineStyle = lineStyle,
2016+
Text = lineStyle.ToString(),
2017+
TextHorizontalAlignment = HorizontalAlignment.Center,
2018+
TextVerticalAlignment = VerticalAlignment.Bottom,
2019+
TextPosition = new DataPoint(50, y),
2020+
StartPoint = new DataPoint(55, y),
2021+
EndPoint = new DataPoint(90, y)
2022+
});
20002023

20012024
y += 10;
20022025
}

0 commit comments

Comments
 (0)