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

b.512 #698

Merged
merged 3 commits into from
Oct 19, 2022
Merged

b.512 #698

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/LiveChartsCore/ConditionalDraw/ConditionalDrawBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class ConditionalPaintBuilder<TModel, TVisual, TLabel, TDrawingContext>
where TLabel : class, ILabelGeometry<TDrawingContext>, new()
{
private bool _isPaintInCanvas = false;
private object _clipFor = new();
private readonly Series<TModel, TVisual, TLabel, TDrawingContext> _series;
private readonly IPaint<TDrawingContext> _paint;
private Func<ChartPoint<TModel, TVisual, TLabel>, bool>? _whenPredicate;
Expand Down Expand Up @@ -85,6 +86,17 @@ private void OnMeasured(ChartPoint<TModel, TVisual, TLabel> point)
_isPaintInCanvas = true;
}

if (point.Context.Chart.CoreChart.MeasureWork != _clipFor)
{
_clipFor = point.Context.Chart.CoreChart.MeasureWork;
if (point.Context.Chart.CoreChart is CartesianChart<TDrawingContext> cartesianChart)
{
var drawLocation = cartesianChart.DrawMarginLocation;
var drawMarginSize = cartesianChart.DrawMarginSize;
_paint.SetClipRectangle(cartesianChart.Canvas, new LvcRectangle(drawLocation, drawMarginSize));
}
}

if (isTriggered)
{
_paint.AddGeometryToPaintTask(canvas, drawable);
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.511</Version>
<Version>2.0.0-beta.512</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
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<LangVersion>10.0</LangVersion>
<Nullable>enable</Nullable>
<TargetFrameworks>netcoreapp2.0;netstandard2.0;net462;</TargetFrameworks>
<AssemblyName>LiveChartsCore.SkiaSharpView.Avalonia</AssemblyName>
<RootNamespace>LiveChartsCore.SkiaSharpView.Avalonia</RootNamespace>
<Version>2.0.0-beta.511</Version>
<Version>2.0.0-beta.512</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
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">

<PropertyGroup>
<Nullable>enable</Nullable>
Expand All @@ -7,7 +7,7 @@
<TargetFrameworks>net462;netcoreapp3.1</TargetFrameworks>
<AssemblyName>LiveChartsCore.SkiaSharpView.WPF</AssemblyName>
<RootNamespace>LiveChartsCore.SkiaSharpView.WPF</RootNamespace>
<Version>2.0.0-beta.511</Version>
<Version>2.0.0-beta.512</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.511</Version>
<Version>2.0.0-beta.512</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
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<LangVersion>10.0</LangVersion>
<Nullable>enable</Nullable>
<TargetFrameworks>netstandard2.0;</TargetFrameworks>
<AssemblyName>LiveChartsCore.SkiaSharpView.XamarinForms</AssemblyName>
<RootNamespace>LiveChartsCore.SkiaSharpView.XamarinForms</RootNamespace>
<Version>2.0.0-beta.511</Version>
<Version>2.0.0-beta.512</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 @@ -21,7 +21,6 @@
// SOFTWARE.

using System;
using System.Diagnostics;
using LiveChartsCore.Drawing;
using LiveChartsCore.Kernel.Sketches;
using LiveChartsCore.Motion;
Expand Down Expand Up @@ -104,6 +103,21 @@ public Drawing SelectColor(SKColor color, float? strokeWidth = null, bool? isFil
return SelectPaint(paint);
}

/// <summary>
/// Sets the
/// </summary>
/// <returns></returns>
public Drawing SetClip(LvcRectangle? clipRectangle)
{
if (clipRectangle is null) return this;
if (_selectedPaint is null)
throw new Exception(
"There is no paint selected, please select a paint (By calling a Select method) to add the geometry to.");

_selectedPaint.SetClipRectangle(Canvas, clipRectangle.Value);
return this;
}

/// <summary>
/// Draws the specified object.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<AssemblyName>LiveChartsCore.SkiaSharpView</AssemblyName>
<RootNamespace>LiveChartsCore.SkiaSharpView</RootNamespace>
<Version>2.0.0-beta.511</Version>
<Version>2.0.0-beta.512</Version>
<PackageIcon>icon.png</PackageIcon>
<Description>Simple, flexible, interactive and powerful data visualization for .Net, this package contains the SkiaSharp backend.</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<TypeScriptNoImplicitAny>True</TypeScriptNoImplicitAny>
Expand All @@ -17,7 +17,7 @@
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>2.0.0-beta.511</Version>
<Version>2.0.0-beta.512</Version>
<PackageIcon>icon.png</PackageIcon>
<Description>Simple, flexible, interactive and powerful data visualization for Blazor.</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<AssemblyName>LiveChartsCore.SkiaSharpView.Eto</AssemblyName>
<RootNamespace>LiveChartsCore.SkiaSharpView.Eto</RootNamespace>
<Version>2.0.0-beta.511</Version>
<Version>2.0.0-beta.512</Version>
<PackageIcon>icon.png</PackageIcon>
<Description>Simple, flexible, interactive and powerful data visualization for Eto.Forms.</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<SupportedOSPlatformVersion Condition="$(TargetFramework.Contains('-windows'))">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$(TargetFramework.Contains('-windows'))">10.0.17763.0</TargetPlatformMinVersion>

<Version>2.0.0-beta.511</Version>
<Version>2.0.0-beta.512</Version>
<PackageIcon>icon.png</PackageIcon>
<Description>Simple, flexible, interactive and powerful data visualization for Maui.</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package>
<metadata>
<id>LiveChartsCore.SkiaSharpView.Maui</id>
<version>2.0.0-beta.511</version>
<version>2.0.0-beta.512</version>
<title>LiveChartsCore.SkiaSharpView.Maui</title>
<authors>BetoRodriguez</authors>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
Expand All @@ -17,23 +17,23 @@
<dependencies>
<group targetFramework="net6.0">
<dependency id="SkiaSharp.Views.Maui.Controls.Compatibility" version="2.88.3" />
<dependency id="LiveChartsCore.SkiaSharpView" version="2.0.0-beta.511" />
<dependency id="LiveChartsCore.SkiaSharpView" version="2.0.0-beta.512" />
</group>
<group targetFramework="net6.0-ios13.6">
<dependency id="SkiaSharp.Views.Maui.Controls.Compatibility" version="2.88.3" />
<dependency id="LiveChartsCore.SkiaSharpView" version="2.0.0-beta.511" />
<dependency id="LiveChartsCore.SkiaSharpView" version="2.0.0-beta.512" />
</group>
<group targetFramework="net6.0-maccatalyst13.5">
<dependency id="SkiaSharp.Views.Maui.Controls.Compatibility" version="2.88.3" />
<dependency id="LiveChartsCore.SkiaSharpView" version="2.0.0-beta.511" />
<dependency id="LiveChartsCore.SkiaSharpView" version="2.0.0-beta.512" />
</group>
<group targetFramework="net6.0-android30.0">
<dependency id="SkiaSharp.Views.Maui.Controls.Compatibility" version="2.88.3" />
<dependency id="LiveChartsCore.SkiaSharpView" version="2.0.0-beta.511" />
<dependency id="LiveChartsCore.SkiaSharpView" version="2.0.0-beta.512" />
</group>
<group targetFramework="net6.0-windows10.0.18362">
<dependency id="SkiaSharp.Views.Maui.Controls.Compatibility" version="2.88.3" />
<dependency id="LiveChartsCore.SkiaSharpView" version="2.0.0-beta.511" />
<dependency id="LiveChartsCore.SkiaSharpView" version="2.0.0-beta.512" />
</group>
</dependencies>
</metadata>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">
<PropertyGroup>
<TargetFrameworks>net6.0-windows10.0.18362;netstandard2.0;net6.0-ios;net6.0-macos;net6.0-maccatalyst;net6.0-android</TargetFrameworks>
<!-- Ensures the .xr.xml files are generated in a proper layout folder -->
<GenerateLibraryLayout>true</GenerateLibraryLayout>

<Nullable>enable</Nullable>
<LangVersion>10.0</LangVersion>
<Version>2.0.0-beta.511</Version>
<Version>2.0.0-beta.512</Version>
<PackageIcon>icon.png</PackageIcon>
<Description>Simple, flexible, interactive and powerful data visualization for Uno.WinUI.</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<Nullable>enable</Nullable>
<LangVersion>10.0</LangVersion>
<Version>2.0.0-beta.511</Version>
<Version>2.0.0-beta.512</Version>
<PackageIcon>icon.png</PackageIcon>
<Description>Simple, flexible, interactive and powerful data visualization for Uno.</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<UseWinUI>true</UseWinUI>

<Version>2.0.0-beta.511</Version>
<Version>2.0.0-beta.512</Version>
<PackageIcon>icon.png</PackageIcon>
<Description>Simple, flexible, interactive and powerful data visualization for WinUI 3.</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package>
<metadata>
<id>LiveChartsCore.SkiaSharpView.WinUI</id>
<version>2.0.0-beta.511</version>
<version>2.0.0-beta.512</version>
<title>LiveChartsCore.SkiaSharpView.WinUI</title>
<authors>BetoRodriguez</authors>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
Expand All @@ -20,8 +20,8 @@
<!--not necessary in net5+-->
<!--<dependency id="Newtonsoft.Json" version="[13.0.1]" />-->
<dependency id="SkiaSharp.Views.WinUI" version="2.88.3" />
<dependency id="LiveChartsCore" version="2.0.0-beta.511" />
<dependency id="LiveChartsCore.SkiaSharpView" version="2.0.0-beta.511" />
<dependency id="LiveChartsCore" version="2.0.0-beta.512" />
<dependency id="LiveChartsCore.SkiaSharpView" version="2.0.0-beta.512" />
</group>
</dependencies>
</metadata>
Expand Down