Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to 2.1.0 #38

Merged
merged 20 commits into from
Dec 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Source/Examples/Avalonia/AvaloniaExamples/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ namespace AvaloniaExamples
{
public class App : Application
{

public override void Initialize()
{
AvaloniaXamlLoader.Load(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="11.0.0" />
<ProjectReference Include="..\..\..\OxyPlot.Avalonia\OxyPlot.Avalonia.csproj" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.7" />
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.7" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.11" />
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.11" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions Source/Examples/Avalonia/AvaloniaExamples/Example.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ public Example(Type mainWindowType, string title = null, string description = nu
}
}

public string Title { get; private set; }
public string Title { get; }
public string Description { get; set; }
private Type MainWindowType { get; set; }
private Type MainWindowType { get; }

public IBitmap Thumbnail { get; set; }

Expand Down
4 changes: 2 additions & 2 deletions Source/Examples/Avalonia/AvaloniaExamples/ExampleAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public ExampleAttribute(string title, string description)
this.Description = description;
}

public string Title { get; private set; }
public string Title { get; }

public string Description { get; private set; }
public string Description { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
<oxy:LinearAxis Position="Left" Minimum="0" Maximum="100" />
</oxy:Plot.Axes>
<oxy:Plot.Annotations>
<oxy:EllipseAnnotation Text="EllipseAnnotation1" X="50" Y="50" Width="20" Height="10"/>
<oxy:EllipseAnnotation Text="EllipseAnnotation1" X="50" Y="50" Width="20" Height="10"/>
<oxy:EllipseAnnotation Text="EllipseAnnotation2" X="50" Y="80" Width="20" Height="10"/>
<oxy:EllipseAnnotation Text="EllipseAnnotation3" X="80" Y="50" Width="20" Height="10"/>
</oxy:Plot.Annotations>
</oxy:Plot>
</TabItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,9 @@

namespace AvaloniaExamples.Examples.AnnotationDemo
{
using System.Collections.Generic;
using System.Windows;

using OxyPlot;

using AvaloniaExamples;
using OxyPlot;
using System.Collections.Generic;

/// <summary>
/// Interaction logic for MainWindow.xaml
Expand All @@ -29,13 +26,12 @@ public MainWindow()
{
this.InitializeComponent();
this.Points = new List<DataPoint>
{
new DataPoint(10, 10), new DataPoint(80, 30), new DataPoint(60, 70)
};
{
new DataPoint(10, 10), new DataPoint(80, 30), new DataPoint(60, 70)
};
this.DataContext = new { Points };
}


private void InitializeComponent()
{
Avalonia.Markup.Xaml.AvaloniaXamlLoader.Load(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
Title="AreaDemo" Height="480" Width="640">
<DockPanel>
<oxy:Plot Title="LineSeries and AreaSeries">
<oxy:Plot.Legends>
<oxy:Legend />
</oxy:Plot.Legends>
<oxy:Plot.Series>
<oxy:AreaSeries Items="{Binding Measurements}" Title="Maximum/Minimum" DataFieldX="Time" DataFieldY="Maximum" DataFieldX2="Time" DataFieldY2="Minimum" Fill="LightBlue" StrokeThickness="0" />
<oxy:LineSeries Items="{Binding Measurements}" Title="Average" DataFieldX="Time" DataFieldY="Value" Color="Blue" StrokeThickness="2" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
<oxy:PlotView Model="{Binding Model1}"/>
</TabItem>
<TabItem Header="Define plot in XAML">
<oxy:Plot Title="Bar series (XAML)" LegendPlacement="Outside" LegendPosition="RightTop" LegendOrientation="Vertical">
<oxy:Plot Title="Bar series (XAML)">
<oxy:Plot.Legends>
<oxy:Legend LegendPlacement="Outside" LegendPosition="RightTop" LegendOrientation="Vertical" />
</oxy:Plot.Legends>
<oxy:Plot.Axes>
<oxy:CategoryAxis Position="Left" Items="{Binding Items}" LabelField="Label"/>
<oxy:LinearAxis Position="Bottom" MinimumPadding="0" AbsoluteMinimum="0"/>
Expand All @@ -18,6 +21,7 @@
<oxy:BarSeries Title="2009" Items="{Binding Items}" ValueField="Value1"/>
<oxy:BarSeries Title="2010" Items="{Binding Items}" ValueField="Value2"/>
<oxy:BarSeries Title="2011" Items="{Binding Items}" ValueField="Value3"/>
<oxy:BarSeries Title="2012" Items="{Binding Items}" ValueField="Value4"/>
</oxy:Plot.Series>
</oxy:Plot>
</TabItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@
// </summary>
// --------------------------------------------------------------------------------------------------------------------

using System.Collections.ObjectModel;
using System.Windows;
using OxyPlot;
using System.Collections.ObjectModel;

namespace AvaloniaExamples.Examples.BarSeriesDemo
{
using AvaloniaExamples;
using OxyPlot.Axes;
using OxyPlot.Legends;
using OxyPlot.Series;

using AvaloniaExamples;

/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
Expand All @@ -26,18 +25,17 @@ public partial class MainWindow : Avalonia.Controls.Window
{
public MainWindow()
{
this.InitializeComponent();

// Create some data
var items = new Collection<Item>
{
new Item {Label = "Apples", Value1 = 37, Value2 = 12, Value3 = 19},
new Item {Label = "Pears", Value1 = 7, Value2 = 21, Value3 = 9},
new Item {Label = "Bananas", Value1 = 23, Value2 = 2, Value3 = 29}
};
{
new Item { Label = "Apples", Value1 = 37, Value2 = 12, Value3 = 19, Value4 = 42},
new Item { Label = "Pears", Value1 = 7, Value2 = 21, Value3 = 9, Value4 = 21},
new Item { Label = "Bananas", Value1 = 23, Value2 = 2, Value3 = 29, Value4 = 10}
};

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

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

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

this.InitializeComponent();

App.AttachDevTools(this);
}

Expand All @@ -65,5 +66,6 @@ public class Item : BarItem
public double Value1 { get; set; }
public double Value2 { get; set; }
public double Value3 { get; set; }
public double Value4 { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
<oxy:PlotView Model="{Binding Model1}" />
</TabItem>
<TabItem Header="Define plot in XAML">
<oxy:Plot Title="BoxPlot series (XAML)"
LegendOrientation="Vertical"
LegendPlacement="Outside"
LegendPosition="RightTop">
<oxy:Plot Title="BoxPlot series (XAML)">
<oxy:Plot.Legends>
<oxy:Legend LegendPlacement="Outside" LegendPosition="RightTop" LegendOrientation="Vertical" />
</oxy:Plot.Legends>
<oxy:Plot.Axes>
<oxy:LinearAxis AbsoluteMinimum="0"
MaximumPadding="0.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ namespace AvaloniaExamples.Examples.BoxPlotSeriesDemo
using OxyPlot.Series;

using AvaloniaExamples;
using OxyPlot.Legends;

/// <summary>
/// Interaction logic for MainWindow.xaml
Expand All @@ -43,7 +44,8 @@ public MainWindow()
};

// Create the plot model
var tmp = new PlotModel { Title = "BoxPlot series", LegendPlacement = LegendPlacement.Outside, LegendPosition = LegendPosition.RightTop, LegendOrientation = LegendOrientation.Vertical };
var tmp = new PlotModel { Title = "BoxPlot series" };
tmp.Legends.Add(new Legend { LegendPlacement = LegendPlacement.Outside, LegendPosition = LegendPosition.RightTop, LegendOrientation = LegendOrientation.Vertical });

// Add the axes, note that MinimumPadding and AbsoluteMinimum should be set on the value axis.
tmp.Axes.Add(new LinearAxis { Position = AxisPosition.Bottom, MinimumPadding = 0.3, MaximumPadding = 0.3, AbsoluteMinimum = 0 });
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@

namespace AvaloniaExamples.Examples.CoupledAxesDemo
{
using System;
using System.Windows;

using AvaloniaExamples;
using OxyPlot;
using OxyPlot.Axes;
using OxyPlot.Series;

using AvaloniaExamples;
using System;

/// <summary>
/// Interaction logic for MainWindow.xaml
Expand All @@ -40,17 +37,17 @@ public MainWindow()

bool isInternalChange = false;
axis1.AxisChanged += (s, e) =>
{
if (isInternalChange)
{
if (isInternalChange)
{
return;
}
return;
}

isInternalChange = true;
axis2.Zoom(axis1.ActualMinimum, axis1.ActualMaximum);
this.Model2.InvalidatePlot(false);
isInternalChange = false;
};
isInternalChange = true;
axis2.Zoom(axis1.ActualMinimum, axis1.ActualMaximum);
this.Model2.InvalidatePlot(false);
isInternalChange = false;
};

axis2.AxisChanged += (s, e) =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<oxy:PlotView Model="{Binding Model}">
<oxy:PlotView.DefaultTrackerTemplate>
<ControlTemplate>
<oxy:TrackerControl Position="{Binding Position}" LineExtents="{Binding PlotModel.PlotArea}">
<oxy:TrackerControl Position="{Binding Position}" LineExtents="{Binding PlotModel.PlotArea}" CornerRadius="50">
<oxy:TrackerControl.Background>
<LinearGradientBrush EndPoint="0,1">
<GradientStop Color="#f0e0e0ff" />
Expand Down
Loading