Skip to content
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
6 changes: 3 additions & 3 deletions .github/actions/comment-progress/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ runs:
});

content = content
.replace(new RegExp('#success', 'g'), '✅ passed')
.replace(new RegExp('#failure', 'g'), '❌ failed')
.replace(new RegExp('#cancelled', 'g'), '⚠️ cancelled');
.replace(new RegExp('#success', 'g'), '✅')
.replace(new RegExp('#failure', 'g'), '❌')
.replace(new RegExp('#cancelled', 'g'), '⚠️');

let body = comment.data.body;

Expand Down
42 changes: 17 additions & 25 deletions .github/workflows/livecharts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
id: create-comment
with:
content: |
Thanks for your contribution!
### Thanks for your contribution! 🤗 (1 / 4)

The build and test process is starting. This may take a while.
You can find more details below as the process continues or at the [actions tab](https://github.com/Live-Charts/LiveCharts2/actions/runs/${{ github.run_id }}).
Expand Down Expand Up @@ -100,16 +100,14 @@ jobs:
comment_id: ${{ needs.report-progress-starting.outputs.comment_id }}
content: |

---

All packages have been packed successfully! 📦✅
You can download the NuGet packages for this build [here](${{ steps.merge.outputs.artifact-url }}).
### Packing complete! 📦 (2 / 4)

You can download the NuGet packages for this build [here](${{ steps.merge.outputs.artifact-url }}).
The packages will be available for 30 days, you can either [use them directly](https://stackoverflow.com/questions/43400069/add-a-package-with-a-local-package-file-in-dotnet), or wait for this PR to be merged to have them published to NuGet.org.

---
### Running tests 🧪 (3 / 4)

Tests will start now, you can monitor their progress below or at the [actions tab](https://github.com/Live-Charts/LiveCharts2/actions/runs/${{ github.run_id }}).
Tests are running now, you can monitor their progress below or at the [actions tab](https://github.com/Live-Charts/LiveCharts2/actions/runs/${{ github.run_id }}).

test-core:
runs-on: windows-2025
Expand Down Expand Up @@ -236,12 +234,12 @@ jobs:
fail-fast: false
matrix:
include:
# not running, blazor issue? factos issue? tests issue?
# ToDo: find why not running.
# - id: blazor
# workloads: wasm-tools
- id: avalonia-browser
workloads: wasm-tools
# not running, uno issue? factos issue? tests issue?
# ToDo: find why not running.
# - id: uno
# tf: net10.0-browserwasm
# workloads: wasm-tools android
Expand All @@ -257,7 +255,7 @@ jobs:
use-factos: true
test-id: ${{ matrix.id }}
workloads: ${{ matrix.workloads }}
# target-framework: ${{ matrix.tf }}
target-framework: ${{ matrix.tf }}

Copilot AI Feb 13, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The target-framework parameter is now being passed for all test-browser matrix entries, but the avalonia-browser entry doesn't define a 'tf' value in its matrix configuration. This means target-framework will be passed as an empty string to the run-tests action. Verify that the run-tests action handles empty or undefined target-framework values correctly, or add a tf value to the avalonia-browser matrix entry if it needs one.

Copilot uses AI. Check for mistakes.
comment_id: ${{ needs.report-progress-starting.outputs.comment_id }}

test-android:
Expand All @@ -271,7 +269,7 @@ jobs:
- id: maui
tf: net10.0-android
workloads: maui-android
# disabled for now, in this uno version, idk why on android no tests are detected.
# ToDo: find why not running.
# - id: uno
# tf: net10.0-android
# workloads: android
Expand All @@ -297,8 +295,8 @@ jobs:
fail-fast: false
matrix:
include:
# - id: avalonia-ios
# workloads: ios
- id: avalonia-ios

Copilot AI Feb 13, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The avalonia-ios test has been re-enabled but doesn't define a 'tf' (target framework) value in its matrix configuration, while the run-tests action is called with target-framework: ${{ matrix.tf }} on line 319. This means an empty string will be passed for target-framework. Verify that the run-tests action handles empty target-framework values correctly, or add a tf value to the avalonia-ios matrix entry if required.

Suggested change
- id: avalonia-ios
- id: avalonia-ios
tf: net10.0-ios

Copilot uses AI. Check for mistakes.
workloads: ios
- id: maui
tf: net10.0-ios
workloads: maui
Expand Down Expand Up @@ -358,24 +356,18 @@ jobs:
with:
comment_id: ${{ needs.report-progress-starting.outputs.comment_id }}
content: |
### Test Results Summary (Passed) ✅ :partying_face:
core #${{ needs.test-core.result }}, windows #${{ needs.test-windows.result }}, linux #${{ needs.test-linux.result }}, mac #${{ needs.test-mac.result }}, browser #${{ needs.test-browser.result }}, android #${{ needs.test-android.result }}, ios #${{ needs.test-ios.result }}

${{ steps.report.outputs.skipped }} skipped.
${{ steps.report.outputs.failed }} failed.
${{ steps.report.outputs.passed }} passed! ✅
### Test Results Summary (Passed) ✅ (4 / 4)

- name: Report tests failure
if: ${{ always() && (contains(join(needs.*.result, ' '), 'failure') || contains(join(needs.*.result, ' '), 'cancelled')) }}
uses: ./.github/actions/comment-progress
with:
comment_id: ${{ needs.report-progress-starting.outputs.comment_id }}
content: |
### Test Results Summary (Failure) ❌ :disappointed_relieved:

| Core | Windows | Linux | Mac | Browser | Android | iOS |
|-------|---------|-------|-----|---------|---------|-----|
| #${{ needs.test-core.result }} | #${{ needs.test-windows.result }} | #${{ needs.test-linux.result }} | #${{ needs.test-mac.result }} | #${{ needs.test-browser.result }} | #${{ needs.test-android.result }} | #${{ needs.test-ios.result }} |

Core #${{ needs.test-core.result }} | Windows #${{ needs.test-windows.result }} | Linux #${{ needs.test-linux.result }} | Mac #${{ needs.test-mac.result }} | Browser #${{ needs.test-browser.result }} | Android #${{ needs.test-android.result }} | iOS #${{ needs.test-ios.result }}

${{ steps.report.outputs.skipped }} skipped.
${{ steps.report.outputs.passed }} passed.
${{ steps.report.outputs.failed }} failed. ❌
### Test Results Summary (Failure) ❌ (4 / 4)

11 changes: 6 additions & 5 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

<!-- turn UITesting to true to include UI tests in the sample projects -->
<UITesting>false</UITesting>
<NoWarnUITests>$(NoWarn);NETSDK1198;NU1701;XC0022;XA0141;XAAADB0000;CS0067;CS0414;CS0108;CS0618;CS4014;CS8600;CS8601;CS8602;CS8603;CS8612;CS8618;CS8622;CS8625;CS8629;CS9264;</NoWarnUITests>
<!-- Factos version https://github.com/beto-rodriguez/Factos -->
<FactosVersion>0.8.0</FactosVersion>

Expand All @@ -42,14 +43,14 @@
</PropertyGroup>

<!--
used to test the library on multiple render modes,
used to test the library on multiple render modes, this config overrides the the settings defined by the user.
Comment thread
beto-rodriguez marked this conversation as resolved.

Copilot AI Feb 12, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The phrase "overrides the the settings" contains a duplicate word "the". It should be "overrides the settings".

Suggested change
used to test the library on multiple render modes, this config overrides the the settings defined by the user.
used to test the library on multiple render modes, this config overrides the settings defined by the user.

Copilot uses AI. Check for mistakes.

Copilot AI Feb 13, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a typo in the comment: "the the" should be just "the".

Suggested change
used to test the library on multiple render modes, this config overrides the the settings defined by the user.
used to test the library on multiple render modes, this config overrides the settings defined by the user.

Copilot uses AI. Check for mistakes.
the IsPacking check ensures that this config is not used in the NuGet packages.
-->
<PropertyGroup Condition="'$(IsPacking)' != 'true'">
<GPU>false</GPU>
<VSYNC>true</VSYNC>
<FPS>30</FPS>
<Diagnose>false</Diagnose>
<GPU>default</GPU> <!-- false, true, default (ignore ms build symbols) -->
<VSYNC>default</VSYNC> <!-- false, true, default (ignore ms build symbols) -->
<FPS>30</FPS> <!-- see RenderSettings.Build, but this is normally not used. -->
<Diagnose>false</Diagnose> <!-- false, true -->
</PropertyGroup>

<PropertyGroup Condition="
Expand Down
1 change: 1 addition & 0 deletions samples/AvaloniaSample/AvaloniaSample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
</ItemGroup>

<PropertyGroup Condition="$(UITesting) == 'true'">
<NoWarn>$(NoWarnUITests)</NoWarn>
<DefineConstants>$(DefineConstants);UI_TESTING;XAML_UI_TESTING;AVALONIA_UI_TESTING</DefineConstants>
</PropertyGroup>

Expand Down
1 change: 1 addition & 0 deletions samples/BlazorSample/BlazorSample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
</ItemGroup>

<PropertyGroup>
<NoWarn>$(NoWarnUITests)</NoWarn>
<DefineConstants Condition="$(UITesting) == 'true'">$(DefineConstants);UI_TESTING;BLAZOR_UI_TESTING</DefineConstants>
</PropertyGroup>

Expand Down
1 change: 1 addition & 0 deletions samples/EtoFormsSample/EtoFormsSample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
</ItemGroup>

<PropertyGroup Condition="$(UITesting) == 'true'">
<NoWarn>$(NoWarnUITests)</NoWarn>
<DefineConstants>$(DefineConstants);UI_TESTING;ETO_UI_TESTING</DefineConstants>
</PropertyGroup>

Expand Down
1 change: 1 addition & 0 deletions samples/MauiSample/MauiSample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
</ItemGroup>

<PropertyGroup Condition="$(UITesting) == 'true'">
<NoWarn>$(NoWarnUITests)</NoWarn>
<DefineConstants>$(DefineConstants);UI_TESTING;XAML_UI_TESTING;MAUI_UI_TESTING</DefineConstants>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
</ItemGroup>

<PropertyGroup Condition="$(UITesting) == 'true'">
<NoWarn>$(NoWarnUITests)</NoWarn>
<DefineConstants>$(DefineConstants);UI_TESTING;XAML_UI_TESTING;UNO_UI_TESTING</DefineConstants>
</PropertyGroup>

Expand Down
10 changes: 10 additions & 0 deletions samples/WPFSample/WPFSample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,23 @@
<Import Condition="$(UITesting) == 'true'" Project="..\..\build\UITestsLinks.Build.props" />

<PropertyGroup Condition="$(UITesting) == 'true'">
<NoWarn>$(NoWarnUITests)</NoWarn>
<DefineConstants>$(DefineConstants);UI_TESTING;XAML_UI_TESTING;WPF_UI_TESTING</DefineConstants>
</PropertyGroup>

<ItemGroup Condition="$(UITesting) == 'true'">
<PackageReference Include="Factos.WPF" Version="$(FactosVersion)" />
</ItemGroup>

<PropertyGroup Condition="$(TestBuildTargetFramework) == 'net10.0-windows'">
<!--
workaround, not sure why hardware accelerated views is failing on net10.0-windows10.0.19041.0 in CI environments
im not able top reproduce the issue locally, ill assume for now that it is a false positive and just exclude that

Copilot AI Feb 13, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are grammatical issues in this comment: "im" should be "I'm" and "ill" should be "I'll".

Suggested change
im not able top reproduce the issue locally, ill assume for now that it is a false positive and just exclude that
I'm not able to reproduce the issue locally, I'll assume for now that it is a false positive and just exclude that

Copilot uses AI. Check for mistakes.
hardware accelerated tests in this target.
-->
<DefineConstants>$(DefineConstants);TEST_HA_VIEWS</DefineConstants>
Comment on lines +46 to +52

Copilot AI Feb 13, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic in this conditional compilation symbol definition appears inverted. The comment says the hardware accelerated views are failing on net10.0-windows in CI, so tests should be excluded. However, the code defines TEST_HA_VIEWS (suggesting tests should be included) when the target framework is net10.0-windows. This appears to be backwards - if tests are failing, the symbol should NOT be defined, or the conditional checks should use a different symbol like SKIP_HA_VIEWS.

Copilot uses AI. Check for mistakes.
</PropertyGroup>

<!--
The next examples are not included in net462 because they use features not available in .Net framework
-->
Expand Down
1 change: 1 addition & 0 deletions samples/WinFormsSample/WinFormsSample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<Import Condition="$(UITesting) == 'true'" Project="..\..\build\UITestsLinks.Build.props" />

<PropertyGroup Condition="$(UITesting) == 'true'">
<NoWarn>$(NoWarnUITests)</NoWarn>
<DefineConstants>$(DefineConstants);UI_TESTING;WINFORMS_UI_TESTING</DefineConstants>
</PropertyGroup>

Expand Down
1 change: 1 addition & 0 deletions samples/WinUISample/WinUISample/WinUISample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
</ItemGroup>

<PropertyGroup Condition="$(UITesting) == 'true'">
<NoWarn>$(NoWarnUITests)</NoWarn>
<DefineConstants>$(DefineConstants);UI_TESTING;XAML_UI_TESTING;WINUI_UI_TESTING</DefineConstants>
</PropertyGroup>

Expand Down
5 changes: 5 additions & 0 deletions src/LiveChartsCore/Motion/CoreMotionCanvas.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ internal CanvasZone[] Zones
/// </value>
public object Sync { get; internal set => field = value ?? new object(); } = new();

/// <summary>
/// Gets the name of the renderer associated with the current canvas instance.
/// </summary>
public string RendererName => s_rendererName ?? "unknown renderer";

/// <summary>
/// Draws the frame.
/// </summary>
Expand Down
11 changes: 8 additions & 3 deletions src/skiasharp/LiveChartsCore.SkiaSharp.WPF/MotionCanvas.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,14 @@ static MotionCanvas()

return new MotionCanvasComposer(renderMode, ticker);
#else
IRenderMode renderMode = settings.UseGPU
? throw new System.Exception("LiveCharts does not support hardware acceleration in WPF .Net Framework.")
: new CPURenderMode();
if (settings.UseGPU)
{
System.Diagnostics.Trace.WriteLine(
"LiveCharts does not support hardware acceleration in WPF .Net Framework. " +
"Falling back to CPU rendering. To use GPU rendering, please migrate your project to .Net 6 or later.");
}

IRenderMode renderMode = new CPURenderMode();

IFrameTicker ticker = settings.TryUseVSync
? new CompositionTargetTicker()
Expand Down
2 changes: 1 addition & 1 deletion tests/CoreTests/CoreTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<PropertyGroup>
<NoWarn>$(NoWarn);MSTEST0037;MSTEST0023;CS0618</NoWarn>
<NoWarn>$(NoWarnUITests);MSTEST0037;MSTEST0023;CS0618</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
37 changes: 0 additions & 37 deletions tests/SharedUITests/AvaloniaTests.cs

This file was deleted.

47 changes: 47 additions & 0 deletions tests/SharedUITests/CartesianChartTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public async Task ShouldLoad()
}

#if XAML_UI_TESTING
// xaml platforms tests.

[AppTestMethod]
public async Task ShouldLoadTemplatedChart()
{
Expand Down Expand Up @@ -73,4 +75,49 @@ public async Task ShouldUnloadAndReload()
#endif
}
#endif

#if AVALONIA_UI_TESTING
// based on:
// https://github.com/Live-Charts/LiveCharts2/issues/1986
// ensure charts load when avalonia virtualization is on.

[AppTestMethod]
public async Task TabControlScrollViewerRendersAfterTabSwitch()
{
var sut = await App.NavigateTo<Samples.VisualTest.VirtualizationTest.View>();

// open the second tab, scroll to end and ensure the chart is loaded.
sut.OpenTab2();
await Task.Delay(1000);
sut.ScrollToChart();
await Task.Delay(1000);
Assert.ChartIsLoaded(sut.Chart2);

// now open the first tab, scroll to end and ensure the chart is loaded.
sut.OpenTab1();
await Task.Delay(1000);
sut.ScrollToChart();
await Task.Delay(1000);
Assert.ChartIsLoaded(sut.Chart1);
}
#endif

#if (WPF_UI_TESTING && TEST_HA_VIEWS) || MAUI_UI_TESTING || WINUI_UI_TESTING || (UNO_UI_TESTING && HAS_OS_LVC)
// native platforms where gpu is supported

[AppTestMethod]
public async Task ShouldLoadHardwareAcceleratedView()
{
LiveChartsCore.LiveCharts.Configure(config => config.HasRenderingSettings(builder => builder.UseGPU = true));

var sut = await App.NavigateTo<Samples.General.FirstChart.View>();
await sut.Chart.WaitUntilChartRenders();

Assert.Contains("GPU", sut.Chart.CoreCanvas.RendererName);
Assert.ChartIsLoaded(sut.Chart);

// restore default settings for other tests
LiveChartsCore.LiveCharts.Configure(config => config.HasRenderingSettings(builder => builder.UseGPU = false));
Comment on lines +113 to +120

Copilot AI Feb 12, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test modifies global configuration (LiveCharts.Configure) and relies on cleanup code at the end. If the test fails or is interrupted before line 120, the GPU setting will remain enabled, potentially affecting subsequent tests. Consider using a try-finally block to ensure the configuration is always restored, or implement IDisposable/IAsyncLifetime for proper test cleanup.

Suggested change
var sut = await App.NavigateTo<Samples.General.FirstChart.View>();
await sut.Chart.WaitUntilChartRenders();
Assert.Contains("GPU", sut.Chart.CoreCanvas.RendererName);
Assert.ChartIsLoaded(sut.Chart);
// restore default settings for other tests
LiveChartsCore.LiveCharts.Configure(config => config.HasRenderingSettings(builder => builder.UseGPU = false));
try
{
var sut = await App.NavigateTo<Samples.General.FirstChart.View>();
await sut.Chart.WaitUntilChartRenders();
Assert.Contains("GPU", sut.Chart.CoreCanvas.RendererName);
Assert.ChartIsLoaded(sut.Chart);
}
finally
{
// restore default settings for other tests
LiveChartsCore.LiveCharts.Configure(config => config.HasRenderingSettings(builder => builder.UseGPU = false));
}

Copilot uses AI. Check for mistakes.
}
#endif
}
19 changes: 19 additions & 0 deletions tests/SharedUITests/PieChartTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,23 @@ public async Task ShouldUnloadAndReload()
#endif
}
#endif

#if (WPF_UI_TESTING && TEST_HA_VIEWS) || MAUI_UI_TESTING || WINUI_UI_TESTING || (UNO_UI_TESTING && HAS_OS_LVC)
// native platforms where gpu is supported

[AppTestMethod]
public async Task ShouldLoadHardwareAcceleratedView()
{
LiveChartsCore.LiveCharts.Configure(config => config.HasRenderingSettings(builder => builder.UseGPU = true));

var sut = await App.NavigateTo<Samples.Pies.Basic.View>();
await sut.Chart.WaitUntilChartRenders();

Assert.Contains("GPU", sut.Chart.CoreCanvas.RendererName);
Assert.ChartIsLoaded(sut.Chart);

// restore default settings for other tests
LiveChartsCore.LiveCharts.Configure(config => config.HasRenderingSettings(builder => builder.UseGPU = false));
Comment on lines +67 to +74

Copilot AI Feb 12, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test modifies global configuration (LiveCharts.Configure) and relies on cleanup code at the end. If the test fails or is interrupted before line 74, the GPU setting will remain enabled, potentially affecting subsequent tests. Consider using a try-finally block to ensure the configuration is always restored, or implement IDisposable/IAsyncLifetime for proper test cleanup.

Suggested change
var sut = await App.NavigateTo<Samples.Pies.Basic.View>();
await sut.Chart.WaitUntilChartRenders();
Assert.Contains("GPU", sut.Chart.CoreCanvas.RendererName);
Assert.ChartIsLoaded(sut.Chart);
// restore default settings for other tests
LiveChartsCore.LiveCharts.Configure(config => config.HasRenderingSettings(builder => builder.UseGPU = false));
try
{
var sut = await App.NavigateTo<Samples.Pies.Basic.View>();
await sut.Chart.WaitUntilChartRenders();
Assert.Contains("GPU", sut.Chart.CoreCanvas.RendererName);
Assert.ChartIsLoaded(sut.Chart);
}
finally
{
// restore default settings for other tests
LiveChartsCore.LiveCharts.Configure(config => config.HasRenderingSettings(builder => builder.UseGPU = false));
}

Copilot uses AI. Check for mistakes.
}
#endif
}
Loading