![]() |
VOOZH | about |
dotnet add package Blazor.ECharts --version 1.0.6
NuGet\Install-Package Blazor.ECharts -Version 1.0.6
<PackageReference Include="Blazor.ECharts" Version="1.0.6" />
<PackageVersion Include="Blazor.ECharts" Version="1.0.6" />Directory.Packages.props
<PackageReference Include="Blazor.ECharts" />Project file
paket add Blazor.ECharts --version 1.0.6
#r "nuget: Blazor.ECharts, 1.0.6"
#:package Blazor.ECharts@1.0.6
#addin nuget:?package=Blazor.ECharts&version=1.0.6Install as a Cake Addin
#tool nuget:?package=Blazor.ECharts&version=1.0.6Install as a Cake Tool
Blazor版本的ECharts图表组件
本项目源自https://github.com/caopengfei/BlazorECharts,由于原作者有好长一段时间没有更新和处理PR,故在此基础上,重新做了这个
开源地址:https://github.com/lishewen/Blazor.ECharts
国内镜像:https://gitee.com/lishewen/Blazor.ECharts
ECharts配置请参考:
https://echarts.apache.org/examples/zh/index.html
Blazor.ECharts 👁 NuGet_Imports.razor中添加@using Blazor.ECharts.Components。wwwroot/index.html文件的Head中引入:<script src="https://lib.baomitu.com/echarts/5.6.0/echarts.min.js"></script>
需要使用地图相关功能的则需要额外添加地图js的引用
<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=[Your Key Here]"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@5/dist/extension/bmap.min.js"></script>
wwwroot/index.html文件的Body中引入:<script type="module" src="_content/Blazor.ECharts/core.js"></script>
Program.cs增加builder.Services.AddECharts();
注意:因为没有设置默认的样式,所以需要在组件上设置Class或者Style来控制宽度和高度
Demo中也提供示范样式
.chart-container {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: flex-start;
padding-left: 20px;
padding-bottom: 20px;
padding-right: 0px;
padding-top: 0px;
height: 95%;
width: 95%;
}
.chart-normal {
border-radius: 4px;
height: 300px;
width: 400px;
margin-top: 20px;
}
.chart-fill {
width: 100%;
height: 720px;
margin-top: 20px;
margin-right: 20px;
}
由于function不是json的标准数据类型,所以json数据中若含function,则转换后,function会丢失。此库为解决这个问题通过JFuncConverter来实现转译输出。使用时传入一个JFunc对象即可。例如:
Position = new JFunc()
{
RAW = """
function (pt) {
return [pt[0], '10%'];
}
"""
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 2 NuGet packages that depend on Blazor.ECharts:
| Package | Downloads |
|---|---|
|
Blazor.ECharts.WordCloud
Blazor版本的ECharts词云组件 开源地址:https://github.com/lishewen/Blazor.ECharts 使用方式见Demo项目 |
|
|
Ruth.JYC.ELSA.RazorLib
Package Description |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.6 | 1,088 | 11/27/2025 |
| 1.0.5 | 4,089 | 4/2/2025 |
| 1.0.4 | 2,434 | 11/18/2024 |
| 1.0.3 | 1,716 | 7/4/2024 |
| 1.0.2 | 2,261 | 3/17/2024 |
| 1.0.1 | 510 | 1/21/2024 |
| 1.0.0 | 674 | 1/10/2024 |
| 0.9.9 | 374 | 1/10/2024 |
| 0.9.8 | 868 | 11/17/2023 |
| 0.9.7 | 1,235 | 8/9/2023 |
| 0.9.6 | 440 | 7/26/2023 |
| 0.9.5 | 639 | 6/15/2023 |
| 0.9.4 | 451 | 5/24/2023 |
| 0.9.3 | 726 | 5/4/2023 |
| 0.9.2 | 354 | 5/4/2023 |
| 0.9.1 | 418 | 4/22/2023 |
| 0.9.0 | 370 | 4/20/2023 |
| 0.8.9 | 388 | 4/19/2023 |
| 0.8.8 | 408 | 4/19/2023 |
| 0.8.7 | 358 | 4/18/2023 |