Skip to content

Commit

Permalink
Merge pull request #1131 from beto-rodriguez/dev
Browse files Browse the repository at this point in the history
2.0.0-beta.860
  • Loading branch information
beto-rodriguez committed Jul 22, 2023
2 parents 6ac247a + 2daee45 commit bba2cd1
Show file tree
Hide file tree
Showing 50 changed files with 259 additions and 220 deletions.
4 changes: 2 additions & 2 deletions samples/AvaloniaSample/App.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;
using LiveChartsCore; // mark
using LiveChartsCore.Kernel;
using LiveChartsCore.Kernel; // mark
using LiveChartsCore.SkiaSharpView; // mark
using SkiaSharp;

Expand All @@ -20,7 +20,7 @@ public override void Initialize()
// .AddDarkTheme() // mark
// In case you need a non-Latin based font, you must register a typeface for SkiaSharp
.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('汉')) // <- Chinese // mark
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('汉')) // <- Chinese // mark
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('أ')) // <- Arabic // mark
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('あ')) // <- Japanese // mark
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('헬')) // <- Korean // mark
Expand Down
1 change: 1 addition & 0 deletions samples/AvaloniaSample/GlobalSuppressions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@

[assembly: SuppressMessage("Style", "IDE0058:Expression value is never used", Justification = "<Pending>", Scope = "member", Target = "~M:AvaloniaSample.MainWindowViewModel.SetDark")]
[assembly: SuppressMessage("Style", "IDE0073:The file header is missing or not located at the top of the file", Justification = "<Pending>")]
[assembly: SuppressMessage("Style", "IDE0005:Using directive is unnecessary.", Justification = "<Pending>")]
8 changes: 8 additions & 0 deletions samples/EtoFormsSample/GlobalSuppressions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.

using System.Diagnostics.CodeAnalysis;

[assembly: SuppressMessage("Style", "IDE0005:Using directive is unnecessary.", Justification = "<Pending>")]
4 changes: 2 additions & 2 deletions samples/EtoFormsSample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System;
using LiveChartsCore; // mark
using LiveChartsCore.SkiaSharpView; //mark
using SkiaSharp;
using SkiaSharp; // mark

namespace EtoFormsSample;

Expand All @@ -21,7 +21,7 @@ static void Main()
.AddLightTheme() // mark
// In case you need a non-Latin based font, you must register a typeface for SkiaSharp
.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('汉')) // <- Chinese // mark
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('汉')) // <- Chinese // mark
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('أ')) // <- Arabic // mark
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('あ')) // <- Japanese // mark
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('헬')) // <- Korean // mark
Expand Down
6 changes: 3 additions & 3 deletions samples/MauiSample/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
using SkiaSharp;
using LiveChartsCore.SkiaSharpView; // mark
using SkiaSharp; // mark

namespace MauiSample;

Expand All @@ -24,7 +24,7 @@ protected override void OnStart()
//.AddDarkTheme() // mark
// In case you need a non-Latin based font, you must register a typeface for SkiaSharp
.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('汉')) // <- Chinese // mark
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('汉')) // <- Chinese // mark
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('أ')) // <- Arabic // mark
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('あ')) // <- Japanese // mark
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('헬')) // <- Korean // mark
Expand Down
10 changes: 3 additions & 7 deletions samples/MauiSample/Axes/CustomSeparatorsInterval/View.xaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Class="MauiSample.Axes.Multiple.View"
<ContentPage x:Class="MauiSample.Axes.CustomSeparatorsInterval.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.Axes.Multiple;assembly=ViewModelsSamples"
xmlns:vms="clr-namespace:ViewModelsSamples.Axes.CustomSeparatorsInterval;assembly=ViewModelsSamples"
>
<ContentPage.BindingContext>
<vms:ViewModel/>
</ContentPage.BindingContext>
<lvc:CartesianChart
Series="{Binding Series}"
YAxes="{Binding YAxes}"
LegendPosition="Bottom"
LegendBackgroundPaint="{Binding LegendTextPaint}"
LegendTextPaint="{Binding LegendTextPaint}"
LegendTextSize="16">
YAxes="{Binding YAxes}">
</lvc:CartesianChart>
</ContentPage>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace MauiSample.Axes.Multiple;
namespace MauiSample.Axes.CustomSeparatorsInterval;

[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class View : ContentPage
Expand Down
10 changes: 7 additions & 3 deletions samples/MauiSample/Axes/Multiple/View.xaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Class="MauiSample.Axes.CustomSeparatorsInterval.View"
<ContentPage x:Class="MauiSample.Axes.Multiple.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.Axes.CustomSeparatorsInterval;assembly=ViewModelsSamples"
xmlns:vms="clr-namespace:ViewModelsSamples.Axes.Multiple;assembly=ViewModelsSamples"
>
<ContentPage.BindingContext>
<vms:ViewModel/>
</ContentPage.BindingContext>
<lvc:CartesianChart
Series="{Binding Series}"
YAxes="{Binding YAxes}">
YAxes="{Binding YAxes}"
LegendPosition="Bottom"
LegendBackgroundPaint="{Binding LegendTextPaint}"
LegendTextPaint="{Binding LegendTextPaint}"
LegendTextSize="16">
</lvc:CartesianChart>
</ContentPage>
2 changes: 1 addition & 1 deletion samples/MauiSample/Axes/Multiple/View.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace MauiSample.Axes.CustomSeparatorsInterval;
namespace MauiSample.Axes.Multiple;

[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class View : ContentPage
Expand Down
8 changes: 8 additions & 0 deletions samples/MauiSample/GlobalSuppressions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.

using System.Diagnostics.CodeAnalysis;

[assembly: SuppressMessage("Style", "IDE0005:Using directive is unnecessary.", Justification = "<Pending>")]
4 changes: 2 additions & 2 deletions samples/UnoPlatformSample/UnoPlatformSample/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

using LiveChartsCore; // mark
using LiveChartsCore.SkiaSharpView; // mark
using SkiaSharp;
using SkiaSharp; // mark

namespace UnoPlatformSample;

Expand All @@ -41,7 +41,7 @@ protected async override void OnLaunched(LaunchActivatedEventArgs args)
// .AddDarkTheme() // mark
// In case you need a non-Latin based font, you must register a typeface for SkiaSharp
.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('汉')) // <- Chinese // mark
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('汉')) // <- Chinese // mark
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('أ')) // <- Arabic // mark
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('あ')) // <- Japanese // mark
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('헬')) // <- Korean // mark
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.

using System.Diagnostics.CodeAnalysis;

[assembly: SuppressMessage("Style", "IDE0005:Using directive is unnecessary.", Justification = "<Pending>")]
26 changes: 13 additions & 13 deletions samples/ViewModelsSamples/Axes/LabelsFormat2/ViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
// You must register any non-Latin based font //mark
// you can add this code when the app starts to register Chinese characters: // mark

// LiveCharts.Configure(c =>
// c.AddSkiaSharp()
// .AddDefaultMappers()
// .AddLightTheme()
// .HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('汉')));

// You can learn more about extra settings at: // mark
// https://localhost:7053/docs/{{ platform }}/{{ version }}/Overview.Installation#configure-themes-fonts-or-mappers-optional // mark

using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.ComponentModel;
using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Painting;
Expand All @@ -20,6 +8,18 @@ namespace ViewModelsSamples.Axes.LabelsFormat2;

public partial class ViewModel : ObservableObject
{
public ViewModel()
{
// You must register any non-Latin based font //mark
// you can add this code when the app starts to register Chinese characters: // mark

LiveCharts.Configure(config =>
config.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('汉')));

// You can learn more about extra settings at: // mark
// https://localhost:7053/docs/{{ platform }}/{{ version }}/Overview.Installation#configure-themes-fonts-or-mappers-optional // mark
}

public ISeries[] Series { get; set; } =
{
new ColumnSeries<double> { Values = new double[] { 426, 583, 104 } },
Expand Down
4 changes: 2 additions & 2 deletions samples/WPFSample/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Windows;
using LiveChartsCore; // mark
using LiveChartsCore.SkiaSharpView; // mark
using SkiaSharp;
using SkiaSharp; // mark

namespace WPFSample;

Expand All @@ -20,7 +20,7 @@ protected override void OnStartup(StartupEventArgs e)
// .AddDarkTheme() // mark
// In case you need a non-Latin based font, you must register a typeface for SkiaSharp
.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('汉')) // <- Chinese // mark
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('汉')) // <- Chinese // mark
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('أ')) // <- Arabic // mark
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('あ')) // <- Japanese // mark
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('헬')) // <- Korean // mark
Expand Down
8 changes: 8 additions & 0 deletions samples/WPFSample/GlobalSuppressions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.

using System.Diagnostics.CodeAnalysis;

[assembly: SuppressMessage("Style", "IDE0005:Using directive is unnecessary.", Justification = "<Pending>")]
8 changes: 8 additions & 0 deletions samples/WinFormsSample/GlobalSuppressions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.

using System.Diagnostics.CodeAnalysis;

[assembly: SuppressMessage("Style", "IDE0005:Using directive is unnecessary.", Justification = "<Pending>")]
4 changes: 2 additions & 2 deletions samples/WinFormsSample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Windows.Forms;
using LiveChartsCore; // mark
using LiveChartsCore.SkiaSharpView; // mark
using SkiaSharp;
using SkiaSharp; // mark

namespace WinFormsSample;

Expand All @@ -20,7 +20,7 @@ static void Main()
// .AddDarkTheme() // mark
// In case you need a non-Latin based font, you must register a typeface for SkiaSharp
.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('汉')) // <- Chinese // mark
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('汉')) // <- Chinese // mark
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('أ')) // <- Arabic // mark
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('あ')) // <- Japanese // mark
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('헬')) // <- Korean // mark
Expand Down
4 changes: 2 additions & 2 deletions samples/WinUISample/WinUISample/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Microsoft.UI.Xaml;
using LiveChartsCore; // mark
using LiveChartsCore.SkiaSharpView; // mark
using SkiaSharp;
using SkiaSharp; // mark

namespace WinUISample;

Expand Down Expand Up @@ -37,7 +37,7 @@ protected override void OnLaunched(LaunchActivatedEventArgs args)
// .AddDarkTheme() // mark
// In case you need a non-Latin based font, you must register a typeface for SkiaSharp
.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('汉')) // <- Chinese // mark
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('汉')) // <- Chinese // mark
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('أ')) // <- Arabic // mark
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('あ')) // <- Japanese // mark
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('헬')) // <- Korean // mark
Expand Down
8 changes: 8 additions & 0 deletions samples/WinUISample/WinUISample/GlobalSuppressions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.

using System.Diagnostics.CodeAnalysis;

[assembly: SuppressMessage("Style", "IDE0005:Using directive is unnecessary.", Justification = "<Pending>")]
5 changes: 2 additions & 3 deletions samples/XamarinSample/XamarinSample/XamarinSample/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using Xamarin.Forms;
using LiveChartsCore; // mark
using LiveChartsCore.SkiaSharpView; // mark
using SkiaSharp;
using System.Drawing;
using SkiaSharp; // mark

namespace XamarinSample;

Expand All @@ -23,7 +22,7 @@ protected override void OnStart()
// .AddDarkTheme() // mark

// In case you need a non-Latin based font, you must register a typeface for SkiaSharp
.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('汉')) // <- Chinese // mark
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('汉')) // <- Chinese // mark
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('أ')) // <- Arabic // mark
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('あ')) // <- Japanese // mark
//.HasGlobalSKTypeface(SKFontManager.Default.MatchCharacter('헬')) // <- Korean // mark
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.

using System.Diagnostics.CodeAnalysis;

[assembly: SuppressMessage("Style", "IDE0005:Using directive is unnecessary.", Justification = "<Pending>")]
2 changes: 1 addition & 1 deletion src/LiveChartsCore/Axis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public abstract class Axis<TDrawingContext, TTextGeometry, TLineGeometry>
private TTextGeometry? _nameGeometry;
private AxisPosition _position = AxisPosition.Start;
private Func<double, string> _labeler = Labelers.Default;
private Padding _padding = Padding.Default;
private Padding _padding = new();
private double? _minLimit = null;
private double? _maxLimit = null;
private IPaint<TDrawingContext>? _namePaint;
Expand Down
5 changes: 0 additions & 5 deletions src/LiveChartsCore/Drawing/Padding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,6 @@ public Padding(double left, double top, double right, double bottom)
Bottom = (float)bottom;
}

/// <summary>
/// The default padding.
/// </summary>
public static Padding Default = new();

/// <summary>
/// Gets or sets the left.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/LiveChartsCore/LiveChartsCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<AssemblyName>LiveChartsCore</AssemblyName>
<RootNamespace>LiveChartsCore</RootNamespace>
<Version>2.0.0-beta.855</Version>
<Version>2.0.0-beta.860</Version>
<PackageIcon>icon.png</PackageIcon>
<Description>Simple, flexible, interactive and powerful data visualization for .Net, this is the core package probably you need another package also unless you are building your own backed.</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<TargetFrameworks>netcoreapp2.0;netstandard2.0;net462;</TargetFrameworks>
<AssemblyName>LiveChartsCore.SkiaSharpView.Avalonia</AssemblyName>
<RootNamespace>LiveChartsCore.SkiaSharpView.Avalonia</RootNamespace>
<Version>2.0.0-beta.855</Version>
<Version>2.0.0-beta.860</Version>
<PackageIcon>icon.png</PackageIcon>
<Description>Simple, flexible, interactive and powerful data visualization for AvaloniaUI.</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<TargetFrameworks>net462;netcoreapp3.1</TargetFrameworks>
<AssemblyName>LiveChartsCore.SkiaSharpView.WPF</AssemblyName>
<RootNamespace>LiveChartsCore.SkiaSharpView.WPF</RootNamespace>
<Version>2.0.0-beta.855</Version>
<Version>2.0.0-beta.860</Version>
<PackageIcon>icon.png</PackageIcon>
<Description>Simple, flexible, interactive and powerful data visualization for WPF.</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<TargetFrameworks>net462;netcoreapp3.1</TargetFrameworks>
<AssemblyName>LiveChartsCore.SkiaSharpView.WinForms</AssemblyName>
<RootNamespace>LiveChartsCore.SkiaSharpView.WinForms</RootNamespace>
<Version>2.0.0-beta.855</Version>
<Version>2.0.0-beta.860</Version>
<PackageIcon>icon.png</PackageIcon>
<Description>Simple, flexible, interactive and powerful data visualization for WindowsForms.</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<TargetFrameworks>netstandard2.0;</TargetFrameworks>
<AssemblyName>LiveChartsCore.SkiaSharpView.XamarinForms</AssemblyName>
<RootNamespace>LiveChartsCore.SkiaSharpView.XamarinForms</RootNamespace>
<Version>2.0.0-beta.855</Version>
<Version>2.0.0-beta.860</Version>
<PackageIcon>icon.png</PackageIcon>
<Description>Simple, flexible, interactive and powerful data visualization for XamarinForms.</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
using System;
using LiveChartsCore.Drawing;
using LiveChartsCore.Motion;
using LiveChartsCore.SkiaSharpView.Painting;
using SkiaSharp;

namespace LiveChartsCore.SkiaSharpView.Drawing.Geometries;
Expand Down Expand Up @@ -89,8 +88,8 @@ public override void OnDraw(SkiaSharpDrawingContext context, SKPaint paint)
context.Canvas.DrawLine(cx, yj, cx, l, paint);
}

/// <inheritdoc cref="Geometry.OnMeasure(Paint)" />
protected override LvcSize OnMeasure(Paint paintTasks)
/// <inheritdoc cref="Geometry.OnMeasure(IPaint{SkiaSharpDrawingContext})" />
protected override LvcSize OnMeasure(IPaint<SkiaSharpDrawingContext> paintTasks)
{
return new LvcSize(Width, Math.Abs(Low - Y));
}
Expand Down

0 comments on commit bba2cd1

Please sign in to comment.