FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Added Annotation Examples for TextAnnotation, RectangleAnnotation, an… · oxyplot/documentation-examples@ff157aa · GitHub

Repository navigation

Commit ff157aa

Browse files
committed
Added Annotation Examples for TextAnnotation, RectangleAnnotation, and EllipseAnnotation
1 parent 716d334 commit ff157aa

4 files changed

Lines changed: 61 additions & 1 deletion

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
namespace ExampleGenerator.Annotations
2+
{
3+
using OxyPlot;
4+
using OxyPlot.Annotations;
5+
using OxyPlot.Axes;
6+
7+
public class EllipseAnnotationExamples
8+
{
9+
[Export("Annotations/EllipseAnnotation")]
10+
public static PlotModel EllipseAnnotation()
11+
{
12+
var model = new PlotModel { Title = nameof(EllipseAnnotation) };
13+
model.Axes.Add(new LinearAxis { Position = AxisPosition.Bottom });
14+
model.Axes.Add(new LinearAxis { Position = AxisPosition.Left });
15+
model.Annotations.Add(new EllipseAnnotation { X = 50, Y = 50, Height= 30 , Width = 30, Text = nameof(EllipseAnnotation) });
16+
return model;
17+
}
18+
}
19+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
namespace ExampleGenerator.Annotations
2+
{
3+
using OxyPlot;
4+
using OxyPlot.Annotations;
5+
using OxyPlot.Axes;
6+
7+
public class RectangleAnnotationExamples
8+
{
9+
[Export("Annotations/RectangleAnnotation")]
10+
public static PlotModel RectangleAnnotation()
11+
{
12+
var model = new PlotModel { Title = nameof(RectangleAnnotation) };
13+
model.Axes.Add(new LinearAxis { Position = AxisPosition.Bottom });
14+
model.Axes.Add(new LinearAxis { Position = AxisPosition.Left });
15+
model.Annotations.Add(new RectangleAnnotation { MinimumX = 30, MaximumX = 70, MinimumY = 40, MaximumY = 60, Text = nameof(RectangleAnnotation) });
16+
return model;
17+
}
18+
}
19+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
namespace ExampleGenerator.Annotations
2+
{
3+
using OxyPlot;
4+
using OxyPlot.Annotations;
5+
using OxyPlot.Axes;
6+
7+
public class TextAnnotationExamples
8+
{
9+
[Export("Annotations/TextAnnotation")]
10+
public static PlotModel TextAnnotation()
11+
{
12+
var model = new PlotModel { Title = nameof(TextAnnotation) };
13+
model.Axes.Add(new LinearAxis { Position = AxisPosition.Bottom });
14+
model.Axes.Add(new LinearAxis { Position = AxisPosition.Left });
15+
model.Annotations.Add(new TextAnnotation { TextPosition = new DataPoint(50,50), Text = nameof(TextAnnotation) });
16+
return model;
17+
}
18+
}
19+
}

‎ExampleGenerator/ExampleGenerator.csproj‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@
4949
<Reference Include="System.Drawing" />
5050
</ItemGroup>
5151
<ItemGroup>
52+
<Compile Include="Annotations\EllipseAnnotationExamples.cs" />
5253
<Compile Include="Annotations\LineAnnotationExamples.cs" />
54+
<Compile Include="Annotations\RectangleAnnotationExamples.cs" />
55+
<Compile Include="Annotations\TextAnnotationExamples.cs" />
5356
<Compile Include="Axes\AxisExamples.cs" />
5457
<Compile Include="Axes\DateTimeAxisExamples.cs" />
5558
<Compile Include="Axes\LinearAxisExamples.cs" />
@@ -89,4 +92,4 @@
8992
<Target Name="AfterBuild">
9093
</Target>
9194
-->
92-
</Project>
95+
</Project>

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL