Skip to content

Commit 87f62c1

Browse files
VisualMelonBobLd
andauthored
Update to 2.1.0 (#38)
Co-authored-by: BobLD <boris.ledeist@edhec.com>
1 parent 6c2318e commit 87f62c1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1714
-1406
lines changed

Source/Examples/Avalonia/AvaloniaExamples/App.xaml.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ namespace AvaloniaExamples
99
{
1010
public class App : Application
1111
{
12-
1312
public override void Initialize()
1413
{
1514
AvaloniaXamlLoader.Load(this);

Source/Examples/Avalonia/AvaloniaExamples/AvaloniaExamples.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<ItemGroup>
1313
<PackageReference Include="JetBrains.Annotations" Version="11.0.0" />
1414
<ProjectReference Include="..\..\..\OxyPlot.Avalonia\OxyPlot.Avalonia.csproj" />
15-
<PackageReference Include="Avalonia.Desktop" Version="0.10.7" />
16-
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.7" />
15+
<PackageReference Include="Avalonia.Desktop" Version="0.10.11" />
16+
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.11" />
1717
</ItemGroup>
1818
</Project>

Source/Examples/Avalonia/AvaloniaExamples/Example.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ public Example(Type mainWindowType, string title = null, string description = nu
3434
}
3535
}
3636

37-
public string Title { get; private set; }
37+
public string Title { get; }
3838
public string Description { get; set; }
39-
private Type MainWindowType { get; set; }
39+
private Type MainWindowType { get; }
4040

4141
public IBitmap Thumbnail { get; set; }
4242

Source/Examples/Avalonia/AvaloniaExamples/ExampleAttribute.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ public ExampleAttribute(string title, string description)
2121
this.Description = description;
2222
}
2323

24-
public string Title { get; private set; }
24+
public string Title { get; }
2525

26-
public string Description { get; private set; }
26+
public string Description { get; }
2727
}
2828
}

Source/Examples/Avalonia/AvaloniaExamples/Examples/AnnotationDemo/MainWindow.xaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
<oxy:LinearAxis Position="Left" Minimum="0" Maximum="100" />
2525
</oxy:Plot.Axes>
2626
<oxy:Plot.Annotations>
27-
<oxy:EllipseAnnotation Text="EllipseAnnotation1" X="50" Y="50" Width="20" Height="10"/>
27+
<oxy:EllipseAnnotation Text="EllipseAnnotation1" X="50" Y="50" Width="20" Height="10"/>
28+
<oxy:EllipseAnnotation Text="EllipseAnnotation2" X="50" Y="80" Width="20" Height="10"/>
29+
<oxy:EllipseAnnotation Text="EllipseAnnotation3" X="80" Y="50" Width="20" Height="10"/>
2830
</oxy:Plot.Annotations>
2931
</oxy:Plot>
3032
</TabItem>

Source/Examples/Avalonia/AvaloniaExamples/Examples/AnnotationDemo/MainWindow.xaml.cs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@
99

1010
namespace AvaloniaExamples.Examples.AnnotationDemo
1111
{
12-
using System.Collections.Generic;
13-
using System.Windows;
14-
15-
using OxyPlot;
16-
1712
using AvaloniaExamples;
13+
using OxyPlot;
14+
using System.Collections.Generic;
1815

1916
/// <summary>
2017
/// Interaction logic for MainWindow.xaml
@@ -29,13 +26,12 @@ public MainWindow()
2926
{
3027
this.InitializeComponent();
3128
this.Points = new List<DataPoint>
32-
{
33-
new DataPoint(10, 10), new DataPoint(80, 30), new DataPoint(60, 70)
34-
};
29+
{
30+
new DataPoint(10, 10), new DataPoint(80, 30), new DataPoint(60, 70)
31+
};
3532
this.DataContext = new { Points };
3633
}
3734

38-
3935
private void InitializeComponent()
4036
{
4137
Avalonia.Markup.Xaml.AvaloniaXamlLoader.Load(this);

Source/Examples/Avalonia/AvaloniaExamples/Examples/AreaDemo/MainWindow.xaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
Title="AreaDemo" Height="480" Width="640">
77
<DockPanel>
88
<oxy:Plot Title="LineSeries and AreaSeries">
9+
<oxy:Plot.Legends>
10+
<oxy:Legend />
11+
</oxy:Plot.Legends>
912
<oxy:Plot.Series>
1013
<oxy:AreaSeries Items="{Binding Measurements}" Title="Maximum/Minimum" DataFieldX="Time" DataFieldY="Maximum" DataFieldX2="Time" DataFieldY2="Minimum" Fill="LightBlue" StrokeThickness="0" />
1114
<oxy:LineSeries Items="{Binding Measurements}" Title="Average" DataFieldX="Time" DataFieldY="Value" Color="Blue" StrokeThickness="2" />

Source/Examples/Avalonia/AvaloniaExamples/Examples/BarSeriesDemo/MainWindow.xaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
<oxy:PlotView Model="{Binding Model1}"/>
1010
</TabItem>
1111
<TabItem Header="Define plot in XAML">
12-
<oxy:Plot Title="Bar series (XAML)" LegendPlacement="Outside" LegendPosition="RightTop" LegendOrientation="Vertical">
12+
<oxy:Plot Title="Bar series (XAML)">
13+
<oxy:Plot.Legends>
14+
<oxy:Legend LegendPlacement="Outside" LegendPosition="RightTop" LegendOrientation="Vertical" />
15+
</oxy:Plot.Legends>
1316
<oxy:Plot.Axes>
1417
<oxy:CategoryAxis Position="Left" Items="{Binding Items}" LabelField="Label"/>
1518
<oxy:LinearAxis Position="Bottom" MinimumPadding="0" AbsoluteMinimum="0"/>
@@ -18,6 +21,7 @@
1821
<oxy:BarSeries Title="2009" Items="{Binding Items}" ValueField="Value1"/>
1922
<oxy:BarSeries Title="2010" Items="{Binding Items}" ValueField="Value2"/>
2023
<oxy:BarSeries Title="2011" Items="{Binding Items}" ValueField="Value3"/>
24+
<oxy:BarSeries Title="2012" Items="{Binding Items}" ValueField="Value4"/>
2125
</oxy:Plot.Series>
2226
</oxy:Plot>
2327
</TabItem>

Source/Examples/Avalonia/AvaloniaExamples/Examples/BarSeriesDemo/MainWindow.xaml.cs

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,16 @@
77
// </summary>
88
// --------------------------------------------------------------------------------------------------------------------
99

10-
using System.Collections.ObjectModel;
11-
using System.Windows;
1210
using OxyPlot;
11+
using System.Collections.ObjectModel;
1312

1413
namespace AvaloniaExamples.Examples.BarSeriesDemo
1514
{
15+
using AvaloniaExamples;
1616
using OxyPlot.Axes;
17+
using OxyPlot.Legends;
1718
using OxyPlot.Series;
1819

19-
using AvaloniaExamples;
20-
2120
/// <summary>
2221
/// Interaction logic for MainWindow.xaml
2322
/// </summary>
@@ -26,18 +25,17 @@ public partial class MainWindow : Avalonia.Controls.Window
2625
{
2726
public MainWindow()
2827
{
29-
this.InitializeComponent();
30-
3128
// Create some data
3229
var items = new Collection<Item>
33-
{
34-
new Item {Label = "Apples", Value1 = 37, Value2 = 12, Value3 = 19},
35-
new Item {Label = "Pears", Value1 = 7, Value2 = 21, Value3 = 9},
36-
new Item {Label = "Bananas", Value1 = 23, Value2 = 2, Value3 = 29}
37-
};
30+
{
31+
new Item { Label = "Apples", Value1 = 37, Value2 = 12, Value3 = 19, Value4 = 42},
32+
new Item { Label = "Pears", Value1 = 7, Value2 = 21, Value3 = 9, Value4 = 21},
33+
new Item { Label = "Bananas", Value1 = 23, Value2 = 2, Value3 = 29, Value4 = 10}
34+
};
3835

3936
// Create the plot model
40-
var tmp = new PlotModel { Title = "Bar series", LegendPlacement = LegendPlacement.Outside, LegendPosition = LegendPosition.RightTop, LegendOrientation = LegendOrientation.Vertical };
37+
var tmp = new PlotModel { Title = "Bar series" };
38+
tmp.Legends.Add(new Legend { LegendPlacement = LegendPlacement.Outside, LegendPosition = LegendPosition.RightTop, LegendOrientation = LegendOrientation.Vertical });
4139

4240
// Add the axes, note that MinimumPadding and AbsoluteMinimum should be set on the value axis.
4341
tmp.Axes.Add(new CategoryAxis { Position = AxisPosition.Left, ItemsSource = items, LabelField = "Label" });
@@ -47,9 +45,12 @@ public MainWindow()
4745
tmp.Series.Add(new BarSeries { Title = "2009", ItemsSource = items, ValueField = "Value1" });
4846
tmp.Series.Add(new BarSeries { Title = "2010", ItemsSource = items, ValueField = "Value2" });
4947
tmp.Series.Add(new BarSeries { Title = "2011", ItemsSource = items, ValueField = "Value3" });
48+
tmp.Series.Add(new BarSeries { Title = "2012", ItemsSource = items, ValueField = "Value4" });
5049

5150
this.DataContext = new { Model1 = tmp, Items = items };
5251

52+
this.InitializeComponent();
53+
5354
App.AttachDevTools(this);
5455
}
5556

@@ -65,5 +66,6 @@ public class Item : BarItem
6566
public double Value1 { get; set; }
6667
public double Value2 { get; set; }
6768
public double Value3 { get; set; }
69+
public double Value4 { get; set; }
6870
}
6971
}

Source/Examples/Avalonia/AvaloniaExamples/Examples/BoxPlotSeriesDemo/MainWindow.xaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
<oxy:PlotView Model="{Binding Model1}" />
1212
</TabItem>
1313
<TabItem Header="Define plot in XAML">
14-
<oxy:Plot Title="BoxPlot series (XAML)"
15-
LegendOrientation="Vertical"
16-
LegendPlacement="Outside"
17-
LegendPosition="RightTop">
14+
<oxy:Plot Title="BoxPlot series (XAML)">
15+
<oxy:Plot.Legends>
16+
<oxy:Legend LegendPlacement="Outside" LegendPosition="RightTop" LegendOrientation="Vertical" />
17+
</oxy:Plot.Legends>
1818
<oxy:Plot.Axes>
1919
<oxy:LinearAxis AbsoluteMinimum="0"
2020
MaximumPadding="0.3"

0 commit comments

Comments
 (0)