-
Notifications
You must be signed in to change notification settings - Fork 514
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1174 from beto-rodriguez/error-series
Error series
- Loading branch information
Showing
52 changed files
with
1,294 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<UserControl x:Class="AvaloniaSample.Error.Basic.View" | ||
xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:lvc="using:LiveChartsCore.SkiaSharpView.Avalonia" | ||
xmlns:vms="using:ViewModelsSamples.Error.Basic"> | ||
<UserControl.DataContext> | ||
<vms:ViewModel/> | ||
</UserControl.DataContext> | ||
<lvc:CartesianChart | ||
Series="{Binding Series}"> | ||
</lvc:CartesianChart> | ||
</UserControl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Avalonia.Controls; | ||
using Avalonia.Markup.Xaml; | ||
|
||
namespace AvaloniaSample.Error.Basic; | ||
|
||
public class View : UserControl | ||
{ | ||
public View() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void InitializeComponent() | ||
{ | ||
AvaloniaXamlLoader.Load(this); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@page "/Error/Basic" | ||
@using LiveChartsCore.SkiaSharpView.Blazor | ||
@using ViewModelsSamples.Error.Basic | ||
|
||
<CartesianChart | ||
Series="ViewModel.Series"> | ||
</CartesianChart> | ||
|
||
@code { | ||
public ViewModel ViewModel { get; set; } = new(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using Eto.Forms; | ||
using LiveChartsCore.SkiaSharpView.Eto; | ||
using ViewModelsSamples.Error.Basic; | ||
|
||
namespace EtoFormsSample.Error.Basic; | ||
|
||
public class View : Panel | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="View"/> class. | ||
/// </summary> | ||
public View() | ||
{ | ||
var viewModel = new ViewModel(); | ||
|
||
var cartesianChart = new CartesianChart | ||
{ | ||
Series = viewModel.Series | ||
}; | ||
|
||
Content = cartesianChart; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ContentPage x:Class="MauiSample.Error.Basic.View" | ||
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:lvc="clr-namespace:LiveChartsCore.SkiaSharpView.Maui;assembly=LiveChartsCore.SkiaSharpView.Maui" | ||
xmlns:vms="clr-namespace:ViewModelsSamples.Error.Basic;assembly=ViewModelsSamples"> | ||
<ContentPage.BindingContext> | ||
<vms:ViewModel/> | ||
</ContentPage.BindingContext> | ||
<lvc:CartesianChart | ||
Series="{Binding Series}"> | ||
</lvc:CartesianChart> | ||
</ContentPage> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace MauiSample.Error.Basic; | ||
|
||
[XamlCompilation(XamlCompilationOptions.Compile)] | ||
public partial class View : ContentPage | ||
{ | ||
public View() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<UserControl x:Class="UWPSample.Error.Basic.View" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:lvc="using:LiveChartsCore.SkiaSharpView.Uno" | ||
xmlns:vms="using:ViewModelsSamples.Error.Basic" | ||
mc:Ignorable="d"> | ||
<UserControl.DataContext> | ||
<vms:ViewModel/> | ||
</UserControl.DataContext> | ||
<lvc:CartesianChart | ||
Series="{Binding Series}"> | ||
</lvc:CartesianChart> | ||
</UserControl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using Windows.UI.Xaml.Controls; | ||
|
||
namespace UWPSample.Error.Basic | ||
{ | ||
public sealed partial class View : UserControl | ||
{ | ||
public View() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
samples/UnoPlatformSample/UnoPlatformSample/LiveChartsSamples/Error/Basic/View.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<UserControl x:Class="UnoWinUISample.Error.Basic.View" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:lvc="using:LiveChartsCore.SkiaSharpView.WinUI" | ||
xmlns:vms="using:ViewModelsSamples.Error.Basic" | ||
mc:Ignorable="d"> | ||
<UserControl.DataContext> | ||
<vms:ViewModel/> | ||
</UserControl.DataContext> | ||
<lvc:CartesianChart | ||
Series="{Binding Series}"> | ||
</lvc:CartesianChart> | ||
</UserControl> |
11 changes: 11 additions & 0 deletions
11
samples/UnoPlatformSample/UnoPlatformSample/LiveChartsSamples/Error/Basic/View.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using Microsoft.UI.Xaml.Controls; | ||
|
||
namespace UnoWinUISample.Error.Basic; | ||
|
||
public sealed partial class View : UserControl | ||
{ | ||
public View() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using CommunityToolkit.Mvvm.ComponentModel; | ||
using LiveChartsCore; | ||
using LiveChartsCore.Defaults; | ||
using LiveChartsCore.SkiaSharpView; | ||
using LiveChartsCore.SkiaSharpView.Painting; | ||
using SkiaSharp; | ||
|
||
namespace ViewModelsSamples.Error.Basic; | ||
|
||
public partial class ViewModel : ObservableObject | ||
{ | ||
public ISeries[] Series { get; set; } = | ||
{ | ||
// use the ErrorValue type to define the error in Y | ||
new ColumnSeries<ErrorValue> | ||
{ | ||
Values = new ErrorValue[] | ||
{ | ||
// (y, y error) | ||
new(65, 6), | ||
// (y, top y error, bottom y error) | ||
new(70, 15, 4), | ||
new(35, 4), | ||
new(70, 6), | ||
new(30, 5), | ||
new(60, 4, 16), | ||
new(65, 6) | ||
}, | ||
ErrorPaint = new SolidColorPaint(SKColors.Black) | ||
}, | ||
|
||
// When you need to define the error in X and Y use the ErrorPoint type | ||
new ColumnSeries<ErrorPoint> | ||
{ | ||
Values = new ErrorPoint[] | ||
{ | ||
// (x, y, x error, y error) | ||
new(0, 50, 0.2, 8), | ||
// (x, y, left x error, right x erorr, top y error, bottom y error) | ||
new(1, 45, 0.1, 0.3, 15, 4), | ||
new(2, 25, 0.3, 4), | ||
new(3, 30, 0.2, 6), | ||
new(4, 70, 0.2, 8), | ||
new(5, 30, 0.4, 4), | ||
new(6, 50, 0.3, 6) | ||
}, | ||
ErrorPaint = new SolidColorPaint(SKColors.Black) | ||
} | ||
|
||
// Error marks are also supported in LineSeries<T> and RowSeries<T> // mark | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,6 +63,8 @@ public static class Index | |
|
||
"Financial/BasicCandlesticks", | ||
|
||
"Error/Basic", | ||
|
||
"Box/Basic", | ||
|
||
"Heat/Basic", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<UserControl x:Class="WPFSample.Error.Basic.View" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:lvc="clr-namespace:LiveChartsCore.SkiaSharpView.WPF;assembly=LiveChartsCore.SkiaSharpView.WPF" | ||
xmlns:vms="clr-namespace:ViewModelsSamples.Error.Basic;assembly=ViewModelsSamples"> | ||
<UserControl.DataContext> | ||
<vms:ViewModel/> | ||
</UserControl.DataContext> | ||
<lvc:CartesianChart | ||
Series="{Binding Series}"> | ||
</lvc:CartesianChart> | ||
</UserControl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System.Windows.Controls; | ||
|
||
namespace WPFSample.Error.Basic; | ||
|
||
/// <summary> | ||
/// Interaction logic for View.xaml | ||
/// </summary> | ||
public partial class View : UserControl | ||
{ | ||
public View() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System.Windows.Forms; | ||
using LiveChartsCore.SkiaSharpView.WinForms; | ||
using ViewModelsSamples.Error.Basic; | ||
|
||
namespace WinFormsSample.Error.Basic; | ||
|
||
public partial class View : UserControl | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="View"/> class. | ||
/// </summary> | ||
public View() | ||
{ | ||
InitializeComponent(); | ||
Size = new System.Drawing.Size(50, 50); | ||
|
||
var viewModel = new ViewModel(); | ||
|
||
var cartesianChart = new CartesianChart | ||
{ | ||
Series = viewModel.Series, | ||
|
||
// out of livecharts properties... | ||
Location = new System.Drawing.Point(0, 0), | ||
Size = new System.Drawing.Size(50, 50), | ||
Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom | ||
}; | ||
|
||
Controls.Add(cartesianChart); | ||
} | ||
} |
Oops, something went wrong.