![]() |
VOOZH | about |
dotnet add package EChartsGen --version 0.1.2
NuGet\Install-Package EChartsGen -Version 0.1.2
<PackageReference Include="EChartsGen" Version="0.1.2" />
<PackageVersion Include="EChartsGen" Version="0.1.2" />Directory.Packages.props
<PackageReference Include="EChartsGen" />Project file
paket add EChartsGen --version 0.1.2
#r "nuget: EChartsGen, 0.1.2"
#:package EChartsGen@0.1.2
#addin nuget:?package=EChartsGen&version=0.1.2Install as a Cake Addin
#tool nuget:?package=EChartsGen&version=0.1.2Install as a Cake Tool
在后端使用ECharts库,将ECharts图表Png图像文件导出到本地磁盘
dotnet add package EChartsGen
option是一个json对象,用于配置图表的各个属性,从而定义图表的展示形式。详情请查看官网:https://echarts.apache.org/zh/option.html
Exporter exporter = new Exporter();
var pngPath = await exporter.ExportAsync(new EChartsGen.ExportOption() { ChartOptionPath = "D:/option.json", OutputPath="D:/out" });
或使用Option对象参数
Exporter exporter = new Exporter();
var title = "血压监测结果分析"; var passCount = 40; var failedCount = 2;
var pngPath = exporter.ExportAsync(new EChartsGen.ExportOption()
{
Height = 400,
Width = 580,
ChartOption = new ChartOption()
{
title = new List<Title>()
{
new Title (){
text=title, left="center"}
},
tooltip = new ToolTip(),
legend = new Legend()
{
orient = OrientType.vertical,
left = "left"
},
series = new object[]
{
new {
name= "Access From",
type="pie",
data=new object[]
{
new { value= failedCount, name="异常" },
new { value= passCount, name="正常" },
}
}
}
},
OutputPath="D:/out"
})
查看结果:
\libs\phantomjs-2.1.1-windows\tmpChartOptionPath和ChartOption二选一,如果同时指定,优先使用ChartOptionPath。 图片的高度和宽度默认为1920*800,你可以根据实际情况调整。
| Date | Version | Content |
|---|---|---|
| V0.1.0 | 2023-11-15 | 初始版本 |
| V0.1.1 | 2024-8-22 | 修复phantomjs报错 |
| V0.1.2 | 2024-8-23 | 添加OutputPath参数 |
作者:林小
邮箱:jevonsflash@qq.com
The MIT License (MIT)
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. 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 was computed. 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 was computed. 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. |
| .NET Core | netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 netstandard2.1 is compatible. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.