VOOZH about

URL: https://www.nuget.org/packages/Blazor.ECharts/

⇱ NuGet Gallery | Blazor.ECharts 1.0.6




👁 Image
Blazor.ECharts 1.0.6

dotnet add package Blazor.ECharts --version 1.0.6
 
 
NuGet\Install-Package Blazor.ECharts -Version 1.0.6
 
 
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="Blazor.ECharts" Version="1.0.6" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Blazor.ECharts" Version="1.0.6" />
 
Directory.Packages.props
<PackageReference Include="Blazor.ECharts" />
 
Project file
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 Blazor.ECharts --version 1.0.6
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Blazor.ECharts, 1.0.6"
 
 
#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 Blazor.ECharts@1.0.6
 
 
#: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=Blazor.ECharts&version=1.0.6
 
Install as a Cake Addin
#tool nuget:?package=Blazor.ECharts&version=1.0.6
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Blazor.ECharts

介绍

Blazor版本的ECharts图表组件

重新出发

本项目源自https://github.com/caopengfei/BlazorECharts,由于原作者有好长一段时间没有更新和处理PR,故在此基础上,重新做了这个

👁 GitHub license

开源地址:https://github.com/lishewen/Blazor.ECharts

国内镜像:https://gitee.com/lishewen/Blazor.ECharts

ECharts配置请参考:

https://echarts.apache.org/examples/zh/index.html

使用方式

  1. 创建Blazor项目。
  2. 在NuGet中安装包Blazor.ECharts 👁 NuGet
    👁 downloads
  3. _Imports.razor中添加@using Blazor.ECharts.Components
  4. 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>
  1. wwwroot/index.html文件的Body中引入:
<script type="module" src="_content/Blazor.ECharts/core.js"></script>
  1. 修改Program.cs增加
builder.Services.AddECharts();
  1. 在页面中使用组件(可参考Demo项目)。

注意:因为没有设置默认的样式,所以需要在组件上设置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;
}

JS function的输出问题

由于function不是json的标准数据类型,所以json数据中若含function,则转换后,function会丢失。此库为解决这个问题通过JFuncConverter来实现转译输出。使用时传入一个JFunc对象即可。例如:

Position = new JFunc()
{
 RAW = """
 function (pt) {
 return [pt[0], '10%'];
 }
 """
}

功能实现进度

  • 公共配置
    • title
    • legend
    • grid(部分)
    • xAxis(部分)
    • yAxis(部分)
    • polar(部分)
    • radiusAxis(部分)
    • angleAxis(部分)
    • radar(部分)
    • dataZoom
    • visualMap(部分)
    • tooltip(部分)
    • axisPointer(部分)
    • toolbox(部分)
    • brush
    • geo
    • parallel
    • parallelAxis
    • singleAxis
    • timeline
    • graphic
    • calendar
    • dataset
    • aria
    • series(部分)
    • color
    • backgroundColor
    • textStyle
    • animation
    • animationThreshold
    • animationDuration
    • animationEasing
    • animationDelay
    • animationDurationUpdate
    • animationEasingUpdate
    • animationDelayUpdate
    • blendMode
    • hoverLayerThreshold
    • useUTC
  • 图表
    • 折线图(部分)
    • 柱状图(部分)
    • 饼图(部分)
    • 散点图(部分)
    • 地理坐标/地图(部分)
    • K线图(部分)
    • 雷达图(部分)
    • 盒须图
    • 热力图
    • 关系图(部分)
    • 路径图(部分)
    • 树图(部分)
    • 矩形树图(部分)
    • 旭日图(部分)
    • 平行坐标系
    • 桑基图(部分)
    • 漏斗图(部分)
    • 仪表盘(部分)
    • 象形柱图
    • 主题河流图
    • 日历坐标系
    • 词云图(使用方法:)

Nuget Package中没有打包echarts.js的原因

  1. 减少包的体积
  2. 方便自由更换cdn
  3. 方便echarts小版本更新时,作者没有来得及更新Package内的js时,可自行在页面上更换
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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

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

GitHub repositories

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
Loading failed