LooseChart.Avalonia
1.0.16
dotnet add package LooseChart.Avalonia --version 1.0.16
NuGet\Install-Package LooseChart.Avalonia -Version 1.0.16
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LooseChart.Avalonia" Version="1.0.16" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LooseChart.Avalonia" Version="1.0.16" />
<PackageReference Include="LooseChart.Avalonia" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LooseChart.Avalonia --version 1.0.16
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: LooseChart.Avalonia, 1.0.16"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package LooseChart.Avalonia@1.0.16
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LooseChart.Avalonia&version=1.0.16
#tool nuget:?package=LooseChart.Avalonia&version=1.0.16
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
开源不易,感谢支持,承接医疗设备上位机软件开发
微信:Lvwl-CN
邮箱:Lvwl-CN@outlook.com
LooseChart 松散图表控件
LooseChart 是一款基于 NET 的高性能图表控件库,专为海量数据可视化场景设计。支持 500 万级数据点秒级渲染,提供多种图表类型和坐标轴,同时内置丰富的鼠标与触摸交互操作。
✨ 核心特性
- ⚡ 高性能渲染:500 万数据点单图 1 秒内完成显示 (配置不同性能有所差异)
- 📊 多种图表类型:散点图、折线图、密度图、伪彩图、等高线图、柱状图、条形图、直方图、饼图
- 📏 多种坐标轴:线性轴 (Linear)、对数轴 (NegativeLog)、双指数轴 (LogicleLog)、时间轴 (DateTime)、时长轴 (Duration)、字符串轴 (StringAxis)
- 🖱️ 丰富交互:鼠标滚轮缩放、左键拖动平移、触摸屏手势支持、可独立开关缩放/平移
- 🔄 异步绘制:后台线程计算 + UI 线程渲染,支持 CancellationToken 取消
- 🏗️ 灵活架构:多 Series 可共享同一对坐标轴,支持动态创建控件
- 🎨 可定制外观:填充色、边框、透明度、虚线样式、压边显示、HSB 渐变配色
- 🔧 交互可控:IsZoomEnabled / IsPanEnabled 属性独立控制缩放和平移行为
📦 支持框架
| UI框架 | 版本 |
|---|---|
| WPF | net472 / net48 / net6.0-windows / net8.0-windows / net10.0-windows |
| Avalonia 12.1.1 | net10.0 |
🚀 快速开始
1. 安装 NuGet 包
dotnet add package LooseChart
dotnet add package LooseChart.Avalonia
或通过 NuGet 包管理器搜索 LooseChart 安装。
2. XAML 中使用图表
支持多种图表类型和轴类型:
<Window x:Class="Demo.MainWindow"
xmlns:chart="clr-namespace:LooseChart;assembly=LooseChart">
<Grid>
<chart:LinearAxis x:Name="yaxis" AxisType="YLeft" />
<chart:LinearAxis x:Name="xaxis" AxisType="XBottom" Grid.Row="1" Grid.Column="1" />
<chart:ScatterSeries x:Name="series" Grid.Column="1"
XAxis="{Binding ElementName=xaxis}"
YAxis="{Binding ElementName=yaxis}" />
</Grid>
</Window>
也可使用其他图表类型和轴:
| 图表类型 | 说明 | 绑定轴 |
|---|---|---|
ScatterSeries |
散点图 | XAxis + YAxis (NumberBaseAxis) |
LineSeries |
折线图 | XAxis + YAxis (NumberBaseAxis) |
DensitySeries |
密度图 | XAxis + YAxis (NumberBaseAxis) |
PseudoColorSeries |
伪彩图 | XAxis + YAxis (NumberBaseAxis) |
ContourSeries |
等高线图 | XAxis + YAxis (NumberBaseAxis) |
HistogramSeries |
直方图 | XAxis + YAxis (NumberBaseAxis) |
BarSeries |
柱状图 | YAxis (NumberBaseAxis) |
HorizontalBarSeries |
水平条形图 | XAxis (NumberBaseAxis) |
ArrayLineSeries |
一维折线图 | YAxis (NumberBaseAxis) |
PieSeries |
饼图/环形图 | 无需绑定轴 |
3. 后端设置数据
var xData = new double[] { 1.0, 2.0, 3.0, 4.0, 5.0 };
var yData = new double[] { 10.0, 20.0, 15.0, 30.0, 25.0 };
this.series.Count = xData.Length;
this.series.XSourceConverter = (i) => xData[i];
this.series.YSourceConverter = (i) => yData[i];
this.series.DisplayColor = LooseChart.Utility.RandomColor();
📷 效果预览
🔗 相关链接
| 链接 | 说明 |
|---|---|
| Gitee 开源地址 | 国内镜像 |
| 更新日志 | 版本更新记录 |
| SDK 文档 | 完整 API 文档与使用指南 |
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Avalonia (>= 12.1.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.16 | 107 | 8/25/2026 |