├── .gitattributes ├── .github ├── FUNDING.yml └── workflows │ ├── gh-pages.yml │ ├── pull-request.yml │ └── release.yml ├── .gitignore ├── .vscode ├── launch.json └── tasks.json ├── AntDesign.Charts.sln ├── LICENSE ├── README-zh_CN.md ├── README.md └── src ├── AntDesign.Charts.Docs.Server ├── AntDesign.Charts.Docs.Server.csproj ├── Pages │ └── _Host.cshtml ├── Program.cs ├── Properties │ └── launchSettings.json ├── Startup.cs ├── appsettings.Development.json ├── appsettings.json └── wwwroot │ ├── css │ └── site.css │ └── favicon.ico ├── AntDesign.Charts.Docs.WebAssembly ├── AntDesign.Charts.Docs.WebAssembly.csproj ├── Program.cs ├── Properties │ └── launchSettings.json └── wwwroot │ ├── css │ └── app.css │ ├── favicon.ico │ ├── gh-pages │ ├── .nojekyll │ ├── .spa │ ├── 404.html │ └── index.html │ ├── icon-512.png │ ├── index.html │ ├── manifest.json │ ├── service-worker.js │ └── service-worker.published.js ├── AntDesign.Charts.Docs ├── AntDesign.Charts.Docs.csproj ├── App.razor ├── Demos │ ├── Area │ │ ├── Area_Chart.razor │ │ ├── Percent_Stacked_Area_Chart.razor │ │ └── Stacked_Area_Chart.razor │ ├── Bar │ │ ├── Bar_Chart.razor │ │ ├── Bar_Chart │ │ │ ├── API.en.md │ │ │ ├── API.zh.md │ │ │ ├── design.en.md │ │ │ ├── design.zh.md │ │ │ ├── index.en.md │ │ │ └── index.zh.md │ │ ├── Grouped_Bar_Chart.razor │ │ ├── Percent_Stacked_Bar_Chart.razor │ │ ├── Range_Bar_Chart.razor │ │ ├── Stacked_Bar_Chart.razor │ │ └── Stacked_Bar_Chart │ │ │ ├── API.en.md │ │ │ ├── API.zh.md │ │ │ ├── design.en.md │ │ │ ├── design.zh.md │ │ │ ├── index.en.md │ │ │ └── index.zh.md │ ├── Box │ │ └── Box_Chart.razor │ ├── Bubble │ │ └── Bubble_Chart.razor │ ├── Bullet │ │ └── Bullet_Chart.razor │ ├── Column │ │ ├── Column_Chart.razor │ │ ├── Grouped_Column_Chart.razor │ │ ├── Histogram_Chart.razor │ │ ├── Percent_Stacked_Column_Chart.razor │ │ ├── Ranged_Column_Chart.razor │ │ ├── Stacked_Column_Chart.razor │ │ ├── Stock_Chart.razor │ │ └── Waterfall_Chart.razor │ ├── Combo │ │ ├── Column_Line_Chart.razor │ │ ├── DualLine_Combo_Chart.razor │ │ ├── Grouped_Column_Line_Chart.razor │ │ └── Stacked_Column_Line_Chart.razor │ ├── DemoData.cs │ ├── Funnel │ │ └── Funnel_Chart.razor │ ├── Gauge │ │ └── Gauge_Chart.razor │ ├── GeneralConfigration │ │ ├── Annotations.razor │ │ ├── Axis.razor │ │ ├── Dark_Mode.razor │ │ ├── Event.razor │ │ ├── Guideline.razor │ │ ├── Interop.razor │ │ ├── Legend.razor │ │ ├── Set_Padding.razor │ │ ├── Set_State.razor │ │ └── Title_and_Description.razor │ ├── GetStarted │ │ ├── DynamicExample.razor │ │ └── Started.razor │ ├── Heatmap │ │ ├── DensityHeatmap_Chart.razor │ │ └── Heatmap_Chart.razor │ ├── Line │ │ ├── Line_Chart.razor │ │ ├── Marker_Point.razor │ │ └── Multiple_Line_Chart.razor │ ├── Liquid │ │ └── Liquid_Chart.razor │ ├── Pie │ │ ├── Donut_Chart.razor │ │ └── Pie_Chart.razor │ ├── Radar │ │ └── Radar_Chart.razor │ ├── Rose │ │ └── Rose_Chart.razor │ ├── Scatter │ │ └── Scatter_Chart.razor │ ├── Sparkline │ │ └── Sparkline.razor │ ├── Step │ │ ├── Basic_StepLine_Chart.razor │ │ └── Multiple_StepLine_Chart.razor │ ├── Temp.razor │ ├── Treemap │ │ └── Treemap_Chart.razor │ └── Violin │ │ └── Violin_Chart.razor ├── Pages │ └── Index.razor ├── Shared │ ├── DemoMenuItem.cs │ ├── GithubButton.razor │ ├── GithubButton.razor.cs │ ├── MainLayout.razor │ ├── NavMenu.razor │ └── TopMenu.razor ├── _Imports.razor ├── style │ ├── github-button.less │ └── index.less └── wwwroot │ ├── data │ ├── GDP.json │ ├── IMDB.json │ ├── contributions.json │ ├── country-economy.json │ ├── emissions.json │ ├── fireworks-sales.json │ ├── heatmap.json │ ├── income.json │ ├── jobpaying.json │ ├── life-expectancy.json │ ├── oil.json │ ├── revenue.json │ ├── sales.json │ ├── smoking-rate.json │ ├── stack-column-data.json │ ├── stock-data.json │ ├── subsales.json │ └── timePeriod.json │ └── menu.json └── AntDesign.Charts ├── AntDesign.Charts.csproj ├── ClassDiagram1.cd ├── Components ├── Base │ ├── ChartComponentBase.cs │ ├── ChartEvent.cs │ ├── ChartEventHandler.cs │ └── IChartComponent.cs ├── Configs │ ├── Annotation │ │ ├── Annotation.cs │ │ ├── AnnotationBackgroundCfg.cs │ │ ├── AnnotationTextCfg.cs │ │ ├── ArcAnnotation.cs │ │ ├── DataMarkerAnnotation.cs │ │ ├── DataMarkerLineCfg.cs │ │ ├── DataMarkerPointCfg.cs │ │ ├── DataRegionAnnotation.cs │ │ ├── HtmlAnnotation.cs │ │ ├── IAnnotation.cs │ │ ├── ImageAnnotation.cs │ │ ├── LineAnnotation.cs │ │ ├── RegionAnnotation.cs │ │ ├── RegionFilterAnnotation.cs │ │ ├── ShapeAnnotation.cs │ │ └── TextAnnotation.cs │ ├── ArrowOptions.cs │ ├── IAnimation.cs │ ├── IBarAutoLabel.cs │ ├── IBarLabel.cs │ ├── IBaseAxis.cs │ ├── ICatAxis.cs │ ├── IConversionTagOptions.cs │ ├── IDataItem.cs │ ├── IDescription.cs │ ├── IGraphicStyle.cs │ ├── IGuideLineConfig.cs │ ├── IInteraction.cs │ ├── ILayerConfig.cs │ ├── ILegend.cs │ ├── ILegendMarkerStyle.cs │ ├── ILineStyle.cs │ ├── ILooseMap.cs │ ├── IMeta.cs │ ├── IPlotConfig.cs │ ├── IRangeBarLabelConfig.cs │ ├── IScrollbar.cs │ ├── ISlider.cs │ ├── IStateConfig.cs │ ├── ITextStyle.cs │ ├── ITimeAxis.cs │ ├── ITitle.cs │ ├── ITooltip.cs │ ├── IValueAxis.cs │ ├── IViewConfig.cs │ ├── Label.cs │ ├── ValueCatTimeAxis.cs │ ├── ValueOptions.cs │ └── ValueTimeAxis.cs ├── Plots │ ├── Area │ │ ├── Area.razor │ │ ├── Area.razor.cs │ │ └── AreaConfig.cs │ ├── Bar │ │ ├── Bar.razor │ │ ├── Bar.razor.cs │ │ ├── BarConfig.cs │ │ └── IBarViewConfig.cs │ ├── Box │ │ ├── Box.razor │ │ ├── Box.razor.cs │ │ └── BoxConfig.cs │ ├── Bullet │ │ ├── Bullet.razor │ │ ├── Bullet.razor.cs │ │ └── BulletConfig.cs │ ├── Column │ │ ├── Column.razor │ │ ├── Column.razor.cs │ │ └── ColumnConfig.cs │ ├── DensityHeatmap │ │ ├── DensityHeatmap.razor │ │ ├── DensityHeatmap.razor.cs │ │ └── DensityHeatmapConfig.cs │ ├── DualAxes │ │ ├── DualAxes.razor │ │ ├── DualAxes.razor.cs │ │ └── DualAxesConfig.cs │ ├── Funnel │ │ ├── Funnel.razor │ │ ├── Funnel.razor.cs │ │ └── FunnelConfig.cs │ ├── Gauge │ │ ├── Gauge.razor │ │ ├── Gauge.razor.cs │ │ └── GaugeConfig.cs │ ├── Heatmap │ │ ├── Heatmap.razor │ │ ├── Heatmap.razor.cs │ │ └── HeatmapConfig.cs │ ├── Histogram │ │ ├── Histogram.razor │ │ ├── Histogram.razor.cs │ │ └── HistogramConfig.cs │ ├── Line │ │ ├── Line.razor │ │ ├── Line.razor.cs │ │ └── LineConfig.cs │ ├── Liquid │ │ ├── Liquid.razor │ │ ├── Liquid.razor.cs │ │ └── LiquidConfig.cs │ ├── Pie │ │ ├── Pie.razor │ │ ├── Pie.razor.cs │ │ └── PieConfig.cs │ ├── Radar │ │ ├── Radar.razor │ │ ├── Radar.razor.cs │ │ └── RadarConfig.cs │ ├── Rose │ │ ├── Rose.razor │ │ ├── Rose.razor.cs │ │ └── RoseConfig.cs │ ├── Scatter │ │ ├── Scatter.razor │ │ ├── Scatter.razor.cs │ │ └── ScatterConfig.cs │ ├── Stock │ │ ├── Stock.razor │ │ ├── Stock.razor.cs │ │ └── StockConfig.cs │ ├── Treemap │ │ ├── ITreemapData.cs │ │ ├── Treemap.razor │ │ ├── Treemap.razor.cs │ │ └── TreemapConfig.cs │ ├── Violin │ │ ├── Violin.razor │ │ ├── Violin.razor.cs │ │ └── ViolinConfig.cs │ └── Waterfall │ │ ├── Waterfall.razor │ │ ├── Waterfall.razor.cs │ │ └── WaterfallConfig.cs ├── Sparkline │ ├── Progress │ │ ├── Progress.razor │ │ ├── Progress.razor.cs │ │ └── ProgressConfig.cs │ ├── RingProgress │ │ ├── RingProgress.razor │ │ ├── RingProgress.razor.cs │ │ └── RingProgressConfig.cs │ ├── TinyArea │ │ ├── TinyArea.razor │ │ ├── TinyArea.razor.cs │ │ └── TinyAreaConfig.cs │ ├── TinyColumn │ │ ├── TinyColumn.razor │ │ ├── TinyColumn.razor.cs │ │ └── TinyColumnConfig.cs │ └── TinyLine │ │ ├── TinyLine.razor │ │ ├── TinyLine.razor.cs │ │ └── TinyLineConfig.cs ├── Temp.razor └── Temp.razor.cs └── wwwroot ├── .gitignore ├── AntDesign.Charts.lib.module.js ├── ant-design-charts-blazor.js ├── g2plot.min.js ├── g2plot.min.js.map ├── package-lock.json ├── package.json └── tests ├── deepObjectMerge.test.js ├── events.test.js ├── interop.test.js ├── serialization.test.js ├── setup.js └── utils.test.js /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: ant-design-blazor # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: ['http://jamesyeung.cn/qrcode/alipay.jpg','http://jamesyeung.cn/qrcode/wepay.jpg'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /.github/workflows/gh-pages.yml: -------------------------------------------------------------------------------- 1 | name: Publish Docs 2 | 3 | env: 4 | Version: 0.2.0 5 | NUGET_API_KEY: ${{secrets.NUGET_API_KEY}} 6 | 7 | on: 8 | push: 9 | branches: 10 | - master 11 | 12 | jobs: 13 | publish-and-deploy: 14 | runs-on: ubuntu-latest 15 | if: github.repository_owner == 'ant-design-blazor' 16 | 17 | steps: 18 | - name: Checkout 🛎️ 19 | uses: actions/checkout@v2 20 | with: 21 | persist-credentials: false 22 | 23 | - name: Setup .NET Core 24 | uses: actions/setup-dotnet@v1 25 | with: 26 | dotnet-version: 9.0.x 27 | 28 | - name: Publish Docs 🎉 29 | run: | 30 | cd ./src/AntDesign.Charts.Docs.WebAssembly/wwwroot 31 | cp -rf gh-pages/* gh-pages/.nojekyll gh-pages/.spa ./ 32 | cd ../../../ 33 | dotnet build 34 | dotnet publish -c Release -o cargo src/AntDesign.Charts.Docs.WebAssembly 35 | 36 | - name: Deploy 🚀 37 | uses: JamesIves/github-pages-deploy-action@releases/v3 38 | with: 39 | ACCESS_TOKEN: ${{ secrets.GH_PUSH_TOKEN }} 40 | BRANCH: gh-pages 41 | FOLDER: cargo/wwwroot 42 | 43 | - name: Package Nightly Nuget 📦 44 | run: | 45 | SUFFIX=`date "+%y%m%d%H%M%S"` 46 | dotnet pack src/AntDesign.Charts/AntDesign.Charts.csproj /p:PackageVersion=$Version-nightly-${SUFFIX} -c Release -o publish 47 | 48 | - name: Publish to Nuget ✔ 49 | run: | 50 | dotnet nuget push publish/*.nupkg -s https://api.nuget.org/v3/index.json -k $NUGET_API_KEY --skip-duplicate 51 | -------------------------------------------------------------------------------- /.github/workflows/pull-request.yml: -------------------------------------------------------------------------------- 1 | name: Pull Request Checks 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - master 7 | - feature 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - uses: actions/checkout@v1 15 | 16 | - name: Setup .NET 9.0 17 | uses: actions/setup-dotnet@v1 18 | with: 19 | dotnet-version: 9.0.x 20 | 21 | - name: Setup Node.js 22 | uses: actions/setup-node@v3 23 | with: 24 | node-version: '18.x' 25 | cache: 'npm' 26 | cache-dependency-path: './src/AntDesign.Charts/wwwroot/package-lock.json' 27 | 28 | - name: Install Dependencies 📦 29 | working-directory: ./src/AntDesign.Charts/wwwroot 30 | run: npm install 31 | 32 | - name: Run JavaScript Tests 🧪 33 | working-directory: ./src/AntDesign.Charts/wwwroot 34 | run: npm run test:ci 35 | 36 | - name: Build Project 🏗 37 | run: dotnet build 38 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | env: 4 | NUGET_API_KEY: ${{secrets.NUGET_API_KEY}} 5 | 6 | on: 7 | push: 8 | tags: 9 | - '*' 10 | 11 | jobs: 12 | release-and-publish-package: 13 | runs-on: ubuntu-latest 14 | if: github.repository_owner == 'ant-design-blazor' 15 | 16 | steps: 17 | - uses: actions/checkout@v2 18 | 19 | - name: Setup .NET Core 20 | uses: actions/setup-dotnet@v1 21 | with: 22 | dotnet-version: 9.0.x 23 | 24 | - uses: actions/setup-node@v1 25 | with: 26 | node-version: "10.x" 27 | 28 | - name: Package and publish to Nuget📦 29 | run: | 30 | VERSION=`git describe --tags` 31 | echo "Publishing Version: ${VERSION}" 32 | npm install 33 | dotnet build -c Release 34 | dotnet pack src/AntDesign.Charts/AntDesign.Charts.csproj /p:PackageVersion=$VERSION -c Release -o publish --no-build --no-restore 35 | dotnet nuget push publish/*.nupkg -s https://api.nuget.org/v3/index.json -k $NUGET_API_KEY --skip-duplicate 36 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | // Use IntelliSense to find out which attributes exist for C# debugging 6 | // Use hover for the description of the existing attributes 7 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md 8 | "name": ".NET Core Launch (web)", 9 | "type": "coreclr", 10 | "request": "launch", 11 | "preLaunchTask": "build", 12 | // If you have changed target frameworks, make sure to update the program path. 13 | "program": "${workspaceFolder}/src/AntDesign.Charts.Docs.Server/bin/Debug/net9.0/AntDesign.Charts.Docs.Server.dll", 14 | "args": [], 15 | "cwd": "${workspaceFolder}/src/AntDesign.Charts.Docs.Server", 16 | "stopAtEntry": false, 17 | // Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser 18 | "serverReadyAction": { 19 | "action": "openExternally", 20 | "pattern": "\\bNow listening on:\\s+(https?://\\S+)" 21 | }, 22 | "env": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | }, 25 | "sourceFileMap": { 26 | "/Views": "${workspaceFolder}/Views" 27 | } 28 | }, 29 | { 30 | "name": ".NET Core Attach", 31 | "type": "coreclr", 32 | "request": "attach" 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "build", 6 | "command": "dotnet", 7 | "type": "process", 8 | "args": [ 9 | "build", 10 | "${workspaceFolder}/src/AntDesign.Charts.Docs.Server/AntDesign.Charts.Docs.Server.csproj", 11 | "/property:GenerateFullPaths=true", 12 | "/consoleloggerparameters:NoSummary" 13 | ], 14 | "problemMatcher": "$msCompile" 15 | }, 16 | { 17 | "label": "publish", 18 | "command": "dotnet", 19 | "type": "process", 20 | "args": [ 21 | "publish", 22 | "${workspaceFolder}/src/AntDesign.Charts.Docs.Server/AntDesign.Charts.Docs.Server.csproj", 23 | "/property:GenerateFullPaths=true", 24 | "/consoleloggerparameters:NoSummary" 25 | ], 26 | "problemMatcher": "$msCompile" 27 | }, 28 | { 29 | "label": "watch", 30 | "command": "dotnet", 31 | "type": "process", 32 | "args": [ 33 | "watch", 34 | "run", 35 | "--project", 36 | "${workspaceFolder}/src/AntDesign.Charts.Docs.Server/AntDesign.Charts.Docs.Server.csproj" 37 | ], 38 | "problemMatcher": "$msCompile" 39 | } 40 | ] 41 | } -------------------------------------------------------------------------------- /AntDesign.Charts.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.1.32421.90 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AntDesign.Charts.Docs.Server", "src\AntDesign.Charts.Docs.Server\AntDesign.Charts.Docs.Server.csproj", "{23C760C0-98FE-4ED5-881C-070CBB94FE74}" 7 | EndProject 8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AntDesign.Charts", "src\AntDesign.Charts\AntDesign.Charts.csproj", "{CA2D52FC-0A3E-4B75-B63F-ECBE4716B3BB}" 9 | EndProject 10 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AntDesign.Charts.Docs", "src\AntDesign.Charts.Docs\AntDesign.Charts.Docs.csproj", "{E994DD0D-C3E0-47CA-B584-E0F92E9AB7EB}" 11 | EndProject 12 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AntDesign.Charts.Docs.WebAssembly", "src\AntDesign.Charts.Docs.WebAssembly\AntDesign.Charts.Docs.WebAssembly.csproj", "{1863ABD1-9C93-4CBC-8645-6FD02394F28B}" 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug|Any CPU = Debug|Any CPU 17 | Release|Any CPU = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {23C760C0-98FE-4ED5-881C-070CBB94FE74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {23C760C0-98FE-4ED5-881C-070CBB94FE74}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {23C760C0-98FE-4ED5-881C-070CBB94FE74}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {23C760C0-98FE-4ED5-881C-070CBB94FE74}.Release|Any CPU.Build.0 = Release|Any CPU 24 | {CA2D52FC-0A3E-4B75-B63F-ECBE4716B3BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 25 | {CA2D52FC-0A3E-4B75-B63F-ECBE4716B3BB}.Debug|Any CPU.Build.0 = Debug|Any CPU 26 | {CA2D52FC-0A3E-4B75-B63F-ECBE4716B3BB}.Release|Any CPU.ActiveCfg = Release|Any CPU 27 | {CA2D52FC-0A3E-4B75-B63F-ECBE4716B3BB}.Release|Any CPU.Build.0 = Release|Any CPU 28 | {E994DD0D-C3E0-47CA-B584-E0F92E9AB7EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 29 | {E994DD0D-C3E0-47CA-B584-E0F92E9AB7EB}.Debug|Any CPU.Build.0 = Debug|Any CPU 30 | {E994DD0D-C3E0-47CA-B584-E0F92E9AB7EB}.Release|Any CPU.ActiveCfg = Release|Any CPU 31 | {E994DD0D-C3E0-47CA-B584-E0F92E9AB7EB}.Release|Any CPU.Build.0 = Release|Any CPU 32 | {1863ABD1-9C93-4CBC-8645-6FD02394F28B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 33 | {1863ABD1-9C93-4CBC-8645-6FD02394F28B}.Debug|Any CPU.Build.0 = Debug|Any CPU 34 | {1863ABD1-9C93-4CBC-8645-6FD02394F28B}.Release|Any CPU.ActiveCfg = Release|Any CPU 35 | {1863ABD1-9C93-4CBC-8645-6FD02394F28B}.Release|Any CPU.Build.0 = Release|Any CPU 36 | EndGlobalSection 37 | GlobalSection(SolutionProperties) = preSolution 38 | HideSolutionNode = FALSE 39 | EndGlobalSection 40 | GlobalSection(ExtensibilityGlobals) = postSolution 41 | SolutionGuid = {F740E7F7-B218-4C02-B350-EC00CC24D13A} 42 | EndGlobalSection 43 | EndGlobal 44 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs.Server/AntDesign.Charts.Docs.Server.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs.Server/Pages/_Host.cshtml: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @namespace AntDesign.Charts.Docs.Server.Pages 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | @{ 5 | Layout = null; 6 | } 7 | 8 | 9 | 10 | 11 | 12 | 13 | Ant Design Charts of Blazor 14 | 15 | 16 | 17 | 18 | @* 19 | *@ 20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | An error has occurred. This application may no longer respond until reloaded. 29 | 30 | 31 | An unhandled exception has occurred. See browser dev tools for details. 32 | 33 | Reload 34 | 🗙 35 |
36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs.Server/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Hosting; 2 | using Microsoft.Extensions.Hosting; 3 | 4 | namespace AntDesign.Charts.Docs.Server 5 | { 6 | public static class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | CreateHostBuilder(args).Build().Run(); 11 | } 12 | 13 | public static IHostBuilder CreateHostBuilder(string[] args) => 14 | Host.CreateDefaultBuilder(args) 15 | .ConfigureWebHostDefaults(webBuilder => 16 | { 17 | webBuilder.UseStartup(); 18 | }); 19 | } 20 | } -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs.Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:63455", 7 | "sslPort": 44371 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | }, 17 | "ancmHostingModel": "OutOfProcess" 18 | }, 19 | "AntDesign.Charts.Docs.Server": { 20 | "commandName": "Project", 21 | "launchBrowser": true, 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | }, 25 | "applicationUrl": "https://localhost:5001;http://localhost:5000" 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs.Server/Startup.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Charts.Docs.Demos; 2 | using Microsoft.AspNetCore.Builder; 3 | using Microsoft.AspNetCore.Hosting; 4 | using Microsoft.Extensions.Configuration; 5 | using Microsoft.Extensions.DependencyInjection; 6 | using Microsoft.Extensions.Hosting; 7 | using System.Net.Http; 8 | 9 | namespace AntDesign.Charts.Docs.Server 10 | { 11 | public class Startup 12 | { 13 | public Startup(IConfiguration configuration) 14 | { 15 | Configuration = configuration; 16 | } 17 | 18 | public IConfiguration Configuration { get; } 19 | 20 | // This method gets called by the runtime. Use this method to add services to the container. 21 | // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 22 | public void ConfigureServices(IServiceCollection services) 23 | { 24 | services.AddRazorPages(); 25 | services.AddServerSideBlazor(); 26 | services.AddAntDesign(); 27 | 28 | services.AddTransient(sp => new HttpClient() 29 | { 30 | DefaultRequestHeaders = 31 | { 32 | // Use to call the github API on server side 33 | {"User-Agent","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36 Edg/81.0.416.68"} 34 | } 35 | }); 36 | } 37 | 38 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 39 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 40 | { 41 | if (env.IsDevelopment()) 42 | { 43 | app.UseDeveloperExceptionPage(); 44 | } 45 | else 46 | { 47 | app.UseExceptionHandler("/Error"); 48 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 49 | app.UseHsts(); 50 | } 51 | 52 | app.UseHttpsRedirection(); 53 | app.UseStaticFiles(); 54 | 55 | app.UseRouting(); 56 | 57 | app.UseEndpoints(endpoints => 58 | { 59 | endpoints.MapBlazorHub(); 60 | endpoints.MapFallbackToPage("/_Host"); 61 | }); 62 | } 63 | } 64 | } -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs.Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "DetailedErrors": true, 3 | "Logging": { 4 | "LogLevel": { 5 | "Default": "Information", 6 | "Microsoft": "Warning", 7 | "Microsoft.Hosting.Lifetime": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs.Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs.Server/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | #blazor-error-ui { 2 | background: lightyellow; 3 | bottom: 0; 4 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 5 | display: none; 6 | left: 0; 7 | padding: 0.6rem 1.25rem 0.7rem 1.25rem; 8 | position: fixed; 9 | width: 100%; 10 | z-index: 1000; 11 | } 12 | 13 | #blazor-error-ui .dismiss { 14 | cursor: pointer; 15 | position: absolute; 16 | right: 0.75rem; 17 | top: 0.5rem; 18 | } 19 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs.Server/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ant-design-blazor/ant-design-charts-blazor/4d190332057bbb7351141f3c71d843aca6053014/src/AntDesign.Charts.Docs.Server/wwwroot/favicon.ico -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs.WebAssembly/AntDesign.Charts.Docs.WebAssembly.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | service-worker-assets.js 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs.WebAssembly/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net.Http; 3 | using System.Threading.Tasks; 4 | using AntDesign.Charts.Docs.Demos; 5 | using Microsoft.AspNetCore.Components.WebAssembly.Hosting; 6 | using Microsoft.Extensions.DependencyInjection; 7 | 8 | namespace AntDesign.Charts.Docs.WebAssembly 9 | { 10 | public static class Program 11 | { 12 | public static async Task Main(string[] args) 13 | { 14 | var builder = WebAssemblyHostBuilder.CreateDefault(args); 15 | builder.RootComponents.Add("app"); 16 | 17 | builder.Services.AddTransient(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); 18 | builder.Services.AddAntDesign(); 19 | 20 | await builder.Build().RunAsync(); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs.WebAssembly/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:54023", 7 | "sslPort": 44331 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 15 | "environmentVariables": { 16 | "ASPNETCORE_ENVIRONMENT": "Development" 17 | } 18 | }, 19 | "AntDesign.Charts.Docs.WebAssembly": { 20 | "commandName": "Project", 21 | "launchBrowser": true, 22 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 23 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 24 | "environmentVariables": { 25 | "ASPNETCORE_ENVIRONMENT": "Development" 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs.WebAssembly/wwwroot/css/app.css: -------------------------------------------------------------------------------- 1 | #blazor-error-ui { 2 | background: lightyellow; 3 | bottom: 0; 4 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 5 | display: none; 6 | left: 0; 7 | padding: 0.6rem 1.25rem 0.7rem 1.25rem; 8 | position: fixed; 9 | width: 100%; 10 | z-index: 1000; 11 | } 12 | 13 | #blazor-error-ui .dismiss { 14 | cursor: pointer; 15 | position: absolute; 16 | right: 0.75rem; 17 | top: 0.5rem; 18 | } 19 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs.WebAssembly/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ant-design-blazor/ant-design-charts-blazor/4d190332057bbb7351141f3c71d843aca6053014/src/AntDesign.Charts.Docs.WebAssembly/wwwroot/favicon.ico -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs.WebAssembly/wwwroot/gh-pages/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ant-design-blazor/ant-design-charts-blazor/4d190332057bbb7351141f3c71d843aca6053014/src/AntDesign.Charts.Docs.WebAssembly/wwwroot/gh-pages/.nojekyll -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs.WebAssembly/wwwroot/gh-pages/.spa: -------------------------------------------------------------------------------- 1 | This file is used to enable gitee pages' spa mode. 2 | https://gitee.com/help/articles/4237 -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs.WebAssembly/wwwroot/gh-pages/404.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | Single Page Apps for GitHub Pages 7 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs.WebAssembly/wwwroot/gh-pages/index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | Ant Design Charts of Blazor 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | Loading... 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs.WebAssembly/wwwroot/icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ant-design-blazor/ant-design-charts-blazor/4d190332057bbb7351141f3c71d843aca6053014/src/AntDesign.Charts.Docs.WebAssembly/wwwroot/icon-512.png -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs.WebAssembly/wwwroot/index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | Ant Design Charts of Blazor 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | Loading... 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs.WebAssembly/wwwroot/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "AntDesign.Charts.Docs.WebAssembly", 3 | "short_name": "AntDesign.Charts.Docs.WebAssembly", 4 | "start_url": "./", 5 | "display": "standalone", 6 | "background_color": "#ffffff", 7 | "theme_color": "#03173d", 8 | "icons": [ 9 | { 10 | "src": "icon-512.png", 11 | "type": "image/png", 12 | "sizes": "512x512" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs.WebAssembly/wwwroot/service-worker.js: -------------------------------------------------------------------------------- 1 | // In development, always fetch from the network and do not enable offline support. 2 | // This is because caching would make development more difficult (changes would not 3 | // be reflected on the first load after each change). 4 | self.addEventListener('fetch', () => { }); 5 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs.WebAssembly/wwwroot/service-worker.published.js: -------------------------------------------------------------------------------- 1 | // Caution! Be sure you understand the caveats before publishing an application with 2 | // offline support. See https://aka.ms/blazor-offline-considerations 3 | 4 | self.importScripts('./service-worker-assets.js'); 5 | self.addEventListener('install', event => event.waitUntil(onInstall(event))); 6 | self.addEventListener('activate', event => event.waitUntil(onActivate(event))); 7 | self.addEventListener('fetch', event => event.respondWith(onFetch(event))); 8 | 9 | const cacheNamePrefix = 'offline-cache-'; 10 | const cacheName = `${cacheNamePrefix}${self.assetsManifest.version}`; 11 | const offlineAssetsInclude = [ /\.dll$/, /\.pdb$/, /\.wasm/, /\.html/, /\.js$/, /\.json$/, /\.css$/, /\.woff$/, /\.png$/, /\.jpe?g$/, /\.gif$/, /\.ico$/ ]; 12 | const offlineAssetsExclude = [ /^service-worker\.js$/ ]; 13 | 14 | async function onInstall(event) { 15 | console.info('Service worker: Install'); 16 | 17 | // Fetch and cache all matching items from the assets manifest 18 | const assetsRequests = self.assetsManifest.assets 19 | .filter(asset => offlineAssetsInclude.some(pattern => pattern.test(asset.url))) 20 | .filter(asset => !offlineAssetsExclude.some(pattern => pattern.test(asset.url))) 21 | .map(asset => new Request(asset.url, { integrity: asset.hash })); 22 | await caches.open(cacheName).then(cache => cache.addAll(assetsRequests)); 23 | } 24 | 25 | async function onActivate(event) { 26 | console.info('Service worker: Activate'); 27 | 28 | // Delete unused caches 29 | const cacheKeys = await caches.keys(); 30 | await Promise.all(cacheKeys 31 | .filter(key => key.startsWith(cacheNamePrefix) && key !== cacheName) 32 | .map(key => caches.delete(key))); 33 | } 34 | 35 | async function onFetch(event) { 36 | let cachedResponse = null; 37 | if (event.request.method === 'GET') { 38 | // For all navigation requests, try to serve index.html from cache 39 | // If you need some URLs to be server-rendered, edit the following check to exclude those URLs 40 | const shouldServeIndexHtml = event.request.mode === 'navigate'; 41 | 42 | const request = shouldServeIndexHtml ? 'index.html' : event.request; 43 | const cache = await caches.open(cacheName); 44 | cachedResponse = await cache.match(request); 45 | } 46 | 47 | return cachedResponse || fetch(event.request); 48 | } 49 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/AntDesign.Charts.Docs.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | 3.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/App.razor: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Sorry, there's nothing at this address.

8 |
9 |
10 |
11 | 12 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Area/Area_Chart.razor: -------------------------------------------------------------------------------- 1 | @page "/Area_Chart" 2 | @inject NavigationManager NavigationManager 3 | @inject HttpClient HttpClient 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 动手实验 23 | 24 | 25 | 26 | 27 | @code{ 28 | 29 | public IChartComponent chart; 30 | DynamicExample example; 31 | 32 | protected override void OnAfterRender(bool firstRender) 33 | { 34 | base.OnAfterRender(firstRender); 35 | example.Chart = chart; 36 | } 37 | 38 | #region Sample 1 39 | 40 | private async Task onChart1_FirstRender(IChartComponent chart) 41 | { 42 | var data1 = await DemoData.TimePeriodDataAsync(NavigationManager, HttpClient); 43 | await chart.ChangeData(data1); 44 | } 45 | 46 | AreaConfig config1 = new AreaConfig() 47 | { 48 | XField = "timePeriod", 49 | YField = "value", 50 | XAxis = new ValueCatTimeAxis() 51 | { 52 | Range = new[] { 0, 1 } 53 | } 54 | }; 55 | 56 | #endregion 57 | 58 | #region Sample 2 59 | 60 | private async Task onChart2_FirstRender(IChartComponent chart) 61 | { 62 | var data = await DemoData.FireworksSalesAsync(NavigationManager, HttpClient); 63 | await chart.ChangeData(data); 64 | } 65 | 66 | AreaConfig config2 = new AreaConfig() 67 | { 68 | XField = "Date", 69 | YField = "scales", 70 | XAxis = new ValueCatTimeAxis() 71 | { 72 | Range = new[] { 0, 1 }, 73 | TickCount = 5 74 | }, 75 | AreaStyle = new GraphicStyle() 76 | { 77 | Fill = "l(270) 0:#ffffff 0.5:#7ec2f3 1:#1890ff" 78 | } 79 | }; 80 | 81 | #endregion 82 | 83 | #region Sample 3 84 | 85 | AreaConfig config3 = new AreaConfig() 86 | { 87 | XField = "Date", 88 | YField = "scales", 89 | XAxis = new ValueCatTimeAxis() 90 | { 91 | TickCount = 5 92 | }, 93 | Animation = false, 94 | Slider = new Slider() 95 | { 96 | Start = 0.1, 97 | End = 0.9, 98 | TrendCfg = new TrendCfg() 99 | { 100 | IsArea = true 101 | } 102 | } 103 | }; 104 | 105 | #endregion 106 | } 107 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Area/Stacked_Area_Chart.razor: -------------------------------------------------------------------------------- 1 | @page "/Stacked_Area_Chart" 2 | @inject NavigationManager NavigationManager 3 | @inject HttpClient HttpClient 4 | 5 | 6 | 7 | 动手实验 8 | 9 | 10 | 11 | 12 | @code{ 13 | 14 | public IChartComponent chart; 15 | DynamicExample example; 16 | 17 | protected override void OnAfterRender(bool firstRender) 18 | { 19 | base.OnAfterRender(firstRender); 20 | example.Chart = chart; 21 | } 22 | 23 | 24 | #region 示例1 25 | 26 | private async Task onChart1_FirstRender(IChartComponent chart) 27 | { 28 | var data1 = await DemoData.OilAsync(NavigationManager, HttpClient); 29 | await chart.ChangeData(data1); 30 | } 31 | 32 | AreaConfig config1 = new AreaConfig() 33 | { 34 | XField = "date", 35 | YField = "value", 36 | SeriesField = "country", 37 | Color = new string[] { "#6897a7", "#8bc0d6", "#60d7a7", "#dedede", "#fedca9", "#fab36f", "#d96d6f" }, 38 | Legend = new Legend() 39 | { 40 | Visible = true, 41 | Position = "right-top", 42 | } 43 | }; 44 | 45 | 46 | object otherConfig = new 47 | { 48 | xAxis = new 49 | { 50 | range = new object[] { 0, 1 }, 51 | }, 52 | }; 53 | 54 | #endregion 示例1 55 | 56 | } 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Bar/Bar_Chart/API.en.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: API 3 | --- 4 | 5 | API. 6 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Bar/Bar_Chart/design.en.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 设计规范 3 | --- 4 | 5 | 设计规范 6 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Bar/Bar_Chart/design.zh.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 设计规范 3 | --- 4 | 5 | ## 何时使用 6 | 7 | 条形图通过水平柱子长短对比数值大小,它与柱状图类似,只是交换了 X 轴与 Y 轴位置。均适用于对比一组或者多组分类数据。 8 | 9 | ## 数据类型 10 | 11 | | 适合的数据 | 「一组或多组分类数据」+「一组或者多组对应的数值」 | 12 | | ---------------- | -------------------------------------------------------------------------------------------------- | 13 | | 功能 | 对比分类数据的数值大小 | 14 | | 数据与图形的映射 | 分类数据字段映射到纵轴的位置,连续数据字段映射到矩形的宽度,分类数据也可以设置颜色增强分类的区分度 | 15 | | 适合的数据条数 | 数据量不作限制。条形图适合纵向滑动,在移动端显示有天然优势 | 16 | 17 | ## 用法建议 18 | 19 | 20 | 21 | ## 元素 22 | 23 | 24 | 25 | - X 轴:通常对应连续数据,值为数字,调用连续数据 X 轴。 26 | - Y 轴:通常对应分类数据,值为文本,调用连续数据 Y 轴。 27 | - 图例:通常出现在分组柱关图、分组条形图中,用来区分不同柱子代表的数据含义。 28 | - 标签:用来解释数据点的值。 29 | - 辅助元素:用来解释某个特殊的数据点的值,或标记出某个特殊含义的区域。 30 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Bar/Bar_Chart/index.en.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Bar Chart 3 | order: 0 4 | --- 5 | 6 | Description about this component. 7 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Bar/Bar_Chart/index.zh.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 基础条形图 3 | order: 0 4 | --- 5 | 6 | 条形图即是横向柱状图,相比基础柱状图,条形图的分类文本可以横向排布,因此适合用于分类较多的场景。 7 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Bar/Grouped_Bar_Chart.razor: -------------------------------------------------------------------------------- 1 | @page "/Grouped_Bar_Chart" 2 | 3 | 4 | 5 | 动手实验 6 | 7 | 8 | 9 | 10 | @code{ 11 | 12 | public IChartComponent chart; 13 | DynamicExample example; 14 | 15 | protected override void OnAfterRender(bool firstRender) 16 | { 17 | base.OnAfterRender(firstRender); 18 | example.Chart = chart; 19 | } 20 | 21 | #region 示例1 22 | 23 | object[] data1 = new object[] { 24 | new { 25 | label= "Mon.", 26 | type= "series1", 27 | value= 2800, 28 | }, 29 | new { 30 | label= "Mon.", 31 | type= "series2", 32 | value= 2260, 33 | }, 34 | new { 35 | label= "Tues.", 36 | type= "series1", 37 | value= 1800, 38 | }, 39 | new { 40 | label= "Tues.", 41 | type= "series2", 42 | value= 1300, 43 | }, 44 | new { 45 | label= "Wed.", 46 | type= "series1", 47 | value= 950, 48 | }, 49 | new { 50 | label= "Wed.", 51 | type= "series2", 52 | value= 900, 53 | }, 54 | new { 55 | label= "Thur.", 56 | type= "series1", 57 | value= 500, 58 | }, 59 | new { 60 | label= "Thur.", 61 | type= "series2", 62 | value= 390, 63 | }, 64 | new { 65 | label= "Fri.", 66 | type= "series1", 67 | value= 170, 68 | }, 69 | new { 70 | label= "Fri.", 71 | type= "series2", 72 | value= 100, 73 | }, 74 | }; 75 | 76 | BarConfig config1 = new BarConfig() 77 | { 78 | IsGroup = true, 79 | XField = "value", 80 | YField = "label", 81 | SeriesField = "type", 82 | Color = new string[] { "#1383ab", "#c52125" }, 83 | Label = new BarViewConfigLabel 84 | { 85 | 86 | }, 87 | }; 88 | 89 | #endregion 示例1 90 | 91 | 92 | } 93 | 94 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Bar/Percent_Stacked_Bar_Chart.razor: -------------------------------------------------------------------------------- 1 | @page "/Percent_Stacked_Bar_Chart" 2 | 3 | 4 | 5 | 动手实验 6 | 7 | 8 | 9 | 10 | @code{ 11 | 12 | public IChartComponent chart; 13 | DynamicExample example; 14 | 15 | protected override void OnAfterRender(bool firstRender) 16 | { 17 | base.OnAfterRender(firstRender); 18 | example.Chart = chart; 19 | } 20 | 21 | #region 示例1 22 | 23 | object[] data1 = new object[] { 24 | new { 25 | country= "Asia", 26 | year= "1750", 27 | value= 502, 28 | }, 29 | new { 30 | country= "Asia", 31 | year= "1800", 32 | value= 635, 33 | }, 34 | new { 35 | country= "Asia", 36 | year= "1850", 37 | value= 809, 38 | }, 39 | new { 40 | country= "Asia", 41 | year= "1900", 42 | value= 947, 43 | }, 44 | new { 45 | country= "Asia", 46 | year= "1950", 47 | value= 1402, 48 | }, 49 | new { 50 | country= "Asia", 51 | year= "1999", 52 | value= 3634, 53 | }, 54 | new { 55 | country= "Asia", 56 | year= "2050", 57 | value= 5268, 58 | }, 59 | new { 60 | country= "Africa", 61 | year= "1750", 62 | value= 106, 63 | }, 64 | new { 65 | country= "Africa", 66 | year= "1800", 67 | value= 107, 68 | }, 69 | new { 70 | country= "Africa", 71 | year= "1850", 72 | value= 111, 73 | }, 74 | new { 75 | country= "Africa", 76 | year= "1900", 77 | value= 133, 78 | }, 79 | new { 80 | country= "Africa", 81 | year= "1950", 82 | value= 221, 83 | }, 84 | new { 85 | country= "Africa", 86 | year= "1999", 87 | value= 767, 88 | }, 89 | new { 90 | country= "Africa", 91 | year= "2050", 92 | value= 1766, 93 | }, 94 | new { 95 | country= "Europe", 96 | year= "1750", 97 | value= 163, 98 | }, 99 | new { 100 | country= "Europe", 101 | year= "1800", 102 | value= 203, 103 | }, 104 | new { 105 | country= "Europe", 106 | year= "1850", 107 | value= 276, 108 | }, 109 | new { 110 | country= "Europe", 111 | year= "1900", 112 | value= 408, 113 | }, 114 | new { 115 | country= "Europe", 116 | year= "1950", 117 | value= 547, 118 | }, 119 | new { 120 | country= "Europe", 121 | year= "1999", 122 | value= 729, 123 | }, 124 | new { 125 | country= "Europe", 126 | year= "2050", 127 | value= 628, 128 | }, 129 | }; 130 | 131 | BarConfig config1 = new BarConfig() 132 | { 133 | XField = "value", 134 | YField = "year", 135 | SeriesField = "country", 136 | Color = new string[] { "#2582a1", "#f88c24", "#c52125", "#87f4d0" }, 137 | Label = new BarViewConfigLabel 138 | { 139 | Visible = true, 140 | }, 141 | }; 142 | 143 | 144 | #endregion 示例1 145 | 146 | } 147 | 148 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Bar/Range_Bar_Chart.razor: -------------------------------------------------------------------------------- 1 | @page "/Range_Bar_Chart" 2 | 3 | 4 | 5 | 动手实验 6 | 7 | 8 | 9 | 10 | @code{ 11 | 12 | public IChartComponent chart; 13 | DynamicExample example; 14 | 15 | protected override void OnAfterRender(bool firstRender) 16 | { 17 | base.OnAfterRender(firstRender); 18 | example.Chart = chart; 19 | } 20 | 21 | #region 示例1 22 | 23 | object[] data1 = new object[] { 24 | new { type= "分类一", values=new int []{76, 100 } }, 25 | new { type= "分类二", values=new int []{56, 108 } }, 26 | new { type= "分类三", values=new int []{38, 129 } }, 27 | new { type= "分类四", values=new int []{58, 155 } }, 28 | new { type= "分类五", values=new int []{45, 120 } }, 29 | new { type= "分类六", values=new int []{23, 99 } }, 30 | new { type= "分类七", values=new int []{18, 56 } }, 31 | new { type= "分类八", values=new int []{18, 34 } }, 32 | }; 33 | 34 | BarConfig config1 = new BarConfig() 35 | { 36 | XField = "values", 37 | YField = "type", 38 | IsRange = true, 39 | Label = new BarViewConfigLabel() 40 | { 41 | Position = "middle", 42 | Layout = new [] 43 | { 44 | new LayoutType() 45 | { 46 | Type = "adjust-color" 47 | } 48 | } 49 | } 50 | }; 51 | 52 | #endregion 示例1 53 | 54 | } 55 | 56 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Bar/Stacked_Bar_Chart/API.en.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: API 3 | --- 4 | 5 | API. 6 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Bar/Stacked_Bar_Chart/design.en.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 设计规范 3 | --- 4 | 5 | 设计规范 6 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Bar/Stacked_Bar_Chart/design.zh.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 设计规范 3 | --- 4 | 5 | ## 何时使用 6 | 7 | 条形图通过水平柱子长短对比数值大小,它与柱状图类似,只是交换了 X 轴与 Y 轴位置。均适用于对比一组或者多组分类数据。 8 | 9 | ## 数据类型 10 | 11 | | 适合的数据 | 「一组或多组分类数据」+「一组或者多组对应的数值」 | 12 | | ---------------- | -------------------------------------------------------------------------------------------------- | 13 | | 功能 | 对比分类数据的数值大小 | 14 | | 数据与图形的映射 | 分类数据字段映射到纵轴的位置,连续数据字段映射到矩形的宽度,分类数据也可以设置颜色增强分类的区分度 | 15 | | 适合的数据条数 | 数据量不作限制。条形图适合纵向滑动,在移动端显示有天然优势 | 16 | 17 | ## 用法建议 18 | 19 | 20 | 21 | ## 元素 22 | 23 | 24 | 25 | - X 轴:通常对应连续数据,值为数字,调用连续数据 X 轴。 26 | - Y 轴:通常对应分类数据,值为文本,调用连续数据 Y 轴。 27 | - 图例:通常出现在分组柱关图、分组条形图中,用来区分不同柱子代表的数据含义。 28 | - 标签:用来解释数据点的值。 29 | - 辅助元素:用来解释某个特殊的数据点的值,或标记出某个特殊含义的区域。 30 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Bar/Stacked_Bar_Chart/index.en.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Stacked Bar Chart 3 | order: 1 4 | --- 5 | 6 | Description about this component. 7 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Bar/Stacked_Bar_Chart/index.zh.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 堆叠条形图 3 | order: 1 4 | --- 5 | 6 | 堆叠条形图是基础条形图的扩展形式,将每个条形进行分割,以显示大类目下的细分类目占比情况。堆叠条形图可以展示更多维度的数据:大类目之间的数值比较、大类目下各细分类目的占比情况、不同大类目下同一细分类目的横向数值比较。 7 | 8 | 堆叠条形图的一个缺点是堆叠太多时会导致数据很难区分对比,同时很难对比不同分类下相同维度的数据,因为它们不是按照同一基准线对齐的。 9 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Column/Grouped_Column_Chart.razor: -------------------------------------------------------------------------------- 1 | @page "/Grouped_Column_Chart" 2 | 3 | 4 | 5 | 动手实验 6 | 7 | 8 | 9 | 10 | @code{ 11 | 12 | public IChartComponent chart; 13 | DynamicExample example; 14 | 15 | protected override void OnAfterRender(bool firstRender) 16 | { 17 | base.OnAfterRender(firstRender); 18 | example.Chart = chart; 19 | } 20 | 21 | #region 示例1 22 | 23 | object[] data1 = new object[] { 24 | new { 25 | name= "London", 26 | 月份= "Jan.", 27 | 月均降雨量= 18.9, 28 | }, 29 | new { 30 | name= "London", 31 | 月份= "Feb.", 32 | 月均降雨量= 28.8, 33 | }, 34 | new { 35 | name= "London", 36 | 月份= "Mar.", 37 | 月均降雨量= 39.3, 38 | }, 39 | new { 40 | name= "London", 41 | 月份= "Apr.", 42 | 月均降雨量= 81.4, 43 | }, 44 | new { 45 | name= "London", 46 | 月份= "May", 47 | 月均降雨量= 47, 48 | }, 49 | new { 50 | name= "London", 51 | 月份= "Jun.", 52 | 月均降雨量= 20.3, 53 | }, 54 | new { 55 | name= "London", 56 | 月份= "Jul.", 57 | 月均降雨量= 24, 58 | }, 59 | new { 60 | name= "London", 61 | 月份= "Aug.", 62 | 月均降雨量= 35.6, 63 | }, 64 | new { 65 | name= "Berlin", 66 | 月份= "Jan.", 67 | 月均降雨量= 12.4, 68 | }, 69 | new { 70 | name= "Berlin", 71 | 月份= "Feb.", 72 | 月均降雨量= 23.2, 73 | }, 74 | new { 75 | name= "Berlin", 76 | 月份= "Mar.", 77 | 月均降雨量= 34.5, 78 | }, 79 | new { 80 | name= "Berlin", 81 | 月份= "Apr.", 82 | 月均降雨量= 99.7, 83 | }, 84 | new { 85 | name= "Berlin", 86 | 月份= "May", 87 | 月均降雨量= 52.6, 88 | }, 89 | new { 90 | name= "Berlin", 91 | 月份= "Jun.", 92 | 月均降雨量= 35.5, 93 | }, 94 | new { 95 | name= "Berlin", 96 | 月份= "Jul.", 97 | 月均降雨量= 37.4, 98 | }, 99 | new { 100 | name= "Berlin", 101 | 月份= "Aug.", 102 | 月均降雨量= 42.4, 103 | }, 104 | }; 105 | 106 | ColumnConfig config1 = new ColumnConfig() 107 | { 108 | IsGroup = true, 109 | XField = "月份", 110 | YField = "月均降雨量", 111 | YAxis = new ValueAxis() 112 | { 113 | Min = 0, 114 | }, 115 | Label = new ColumnViewConfigLabel() 116 | { 117 | Visible = true, 118 | }, 119 | SeriesField = "name", 120 | Color = new string[] { "#1ca9e6", "#f88c24" }, 121 | }; 122 | 123 | 124 | #endregion 示例1 125 | 126 | } 127 | 128 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Column/Histogram_Chart.razor: -------------------------------------------------------------------------------- 1 | @page "/Histogram_Chart" 2 | 3 | 4 | 5 | 动手实验 6 | 7 | 8 | 9 | 10 | @code{ 11 | 12 | public IChartComponent chart; 13 | DynamicExample example; 14 | 15 | protected override void OnAfterRender(bool firstRender) 16 | { 17 | base.OnAfterRender(firstRender); 18 | example.Chart = chart; 19 | } 20 | 21 | #region 示例1 22 | 23 | object[] data1 = new object[] { 24 | new { value= 1.2 }, 25 | new { value= 3.4 }, 26 | new { value= 3.7 }, 27 | new { value= 4.3 }, 28 | new { value= 5.2 }, 29 | new { value= 5.8 }, 30 | new { value= 6.1 }, 31 | new { value= 6.5 }, 32 | new { value= 6.8 }, 33 | new { value= 7.1 }, 34 | new { value= 7.3 }, 35 | new { value= 7.7 }, 36 | new { value= 8.3 }, 37 | new { value= 8.6 }, 38 | new { value= 8.8 }, 39 | new { value= 9.1 }, 40 | new { value= 9.2 }, 41 | new { value= 9.4 }, 42 | new { value= 9.5 }, 43 | new { value= 9.7 }, 44 | new { value= 10.5 }, 45 | new { value= 10.7 }, 46 | new { value= 10.8 }, 47 | new { value= 11.0 }, 48 | new { value= 11.0 }, 49 | new { value= 11.1 }, 50 | new { value= 11.2 }, 51 | new { value= 11.3 }, 52 | new { value= 11.4 }, 53 | new { value= 11.4 }, 54 | new { value= 11.7 }, 55 | new { value= 12.0 }, 56 | new { value= 12.9 }, 57 | new { value= 12.9 }, 58 | new { value= 13.3 }, 59 | new { value= 13.7 }, 60 | new { value= 13.8 }, 61 | new { value= 13.9 }, 62 | new { value= 14.0 }, 63 | new { value= 14.2 }, 64 | new { value= 14.5 }, 65 | new { value= 15 }, 66 | new { value= 15.2 }, 67 | new { value= 15.6 }, 68 | new { value= 16.0 }, 69 | new { value= 16.3 }, 70 | new { value= 17.3 }, 71 | new { value= 17.5 }, 72 | new { value= 17.9 }, 73 | new { value= 18.0 }, 74 | new { value= 18.0 }, 75 | new { value= 20.6 }, 76 | new { value= 21 }, 77 | new { value= 23.4 }, 78 | }; 79 | 80 | HistogramConfig config1 = new HistogramConfig() 81 | { 82 | Padding = "auto", 83 | BinField = "value", 84 | BinNumber = 10, 85 | Color = new string[] { "#1079a0" }, 86 | }; 87 | 88 | #endregion 示例1 89 | 90 | 91 | } 92 | 93 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Column/Ranged_Column_Chart.razor: -------------------------------------------------------------------------------- 1 | @page "/Ranged_Column_Chart" 2 | 3 | 4 | 5 | 动手实验 6 | 7 | 8 | 9 | 10 | @code{ 11 | 12 | public IChartComponent chart; 13 | DynamicExample example; 14 | 15 | protected override void OnAfterRender(bool firstRender) 16 | { 17 | base.OnAfterRender(firstRender); 18 | example.Chart = chart; 19 | } 20 | 21 | 22 | #region 示例1 23 | 24 | object[] data1 = new object[] { 25 | new { type= "分类一", values= new int[]{76, 100 } }, 26 | new { type= "分类二", values= new int[]{56, 108 } }, 27 | new { type= "分类三", values= new int[]{38, 129 } }, 28 | new { type= "分类四", values= new int[]{58, 155 } }, 29 | new { type= "分类五", values= new int[]{45, 120 } }, 30 | new { type= "分类六", values= new int[]{23, 99 } }, 31 | new { type= "分类七", values= new int[]{18, 56 } }, 32 | new { type= "分类八", values= new int[]{18, 34 } }, 33 | }; 34 | 35 | ColumnConfig config1 = new ColumnConfig() 36 | { 37 | XField = "type", 38 | YField = "values", 39 | IsRange = true, 40 | Label = new ColumnViewConfigLabel() 41 | { 42 | Position = "middle", 43 | Layout = new [] 44 | { 45 | new LayoutType() 46 | { 47 | Type = "adjust-color" 48 | } 49 | } 50 | } 51 | }; 52 | 53 | #endregion 示例1 54 | 55 | 56 | } 57 | 58 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Column/Stacked_Column_Chart.razor: -------------------------------------------------------------------------------- 1 | @page "/Stacked_Column_Chart" 2 | @inject NavigationManager NavigationManager 3 | @inject HttpClient HttpClient 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 动手实验 14 | 15 | 16 | 17 | 18 | @code{ 19 | 20 | public IChartComponent chart; 21 | DynamicExample example; 22 | 23 | protected override void OnAfterRender(bool firstRender) 24 | { 25 | base.OnAfterRender(firstRender); 26 | example.Chart = chart; 27 | } 28 | 29 | private async void OnFirstRender(IChartComponent chart1) 30 | { 31 | var data1 = await DemoData.StackColumnDataAsync(NavigationManager, HttpClient); 32 | await chart1.ChangeData(data1); 33 | } 34 | 35 | #region 示例1 36 | ColumnConfig config1 = new ColumnConfig() 37 | { 38 | Padding = "auto", 39 | IsStack = true, 40 | XField = "year", 41 | YField = "value", 42 | SeriesField = "type", 43 | Label = new ColumnViewConfigLabel() 44 | { 45 | Position = "middle", 46 | Layout = new [] 47 | { 48 | new LayoutType() 49 | { 50 | Type = "interval-adjust-position" 51 | }, 52 | new LayoutType() 53 | { 54 | Type = "interval-hide-overlap" 55 | }, 56 | new LayoutType() 57 | { 58 | Type = "adjust-color" 59 | } 60 | } 61 | } 62 | }; 63 | #endregion 64 | } 65 | 66 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Column/Waterfall_Chart.razor: -------------------------------------------------------------------------------- 1 | @page "/Waterfall_Chart" 2 | 3 | 4 | 5 | 动手实验 6 | 7 | 8 | 9 | 10 | @code{ 11 | 12 | public IChartComponent chart; 13 | DynamicExample example; 14 | 15 | protected override void OnAfterRender(bool firstRender) 16 | { 17 | base.OnAfterRender(firstRender); 18 | example.Chart = chart; 19 | } 20 | 21 | 22 | #region 示例1 23 | 24 | object[] data1 = new object[] { 25 | new { type= "日用品", money= 120 }, 26 | new { type= "伙食费", money= 900 }, 27 | new { type= "交通费", money= 200 }, 28 | new { type= "水电费", money= 300 }, 29 | new { type= "房租", money= 1200 }, 30 | new { type= "商场消费", money= 1000 }, 31 | new { type= "应酬红包", money= -2000 }, 32 | }; 33 | 34 | WaterfallConfig config1 = new WaterfallConfig() 35 | { 36 | Padding = "auto", 37 | XField = "type", 38 | YField = "money", 39 | Meta = new 40 | { 41 | Type = new 42 | { 43 | Alias = "类别", 44 | }, 45 | Money = new 46 | { 47 | Alias = "金额", 48 | Formatter = "(v) => `${v} 元`", 49 | }, 50 | }, 51 | }; 52 | 53 | 54 | #endregion 示例1 55 | 56 | } 57 | 58 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Combo/Column_Line_Chart.razor: -------------------------------------------------------------------------------- 1 | @page "/Column_Line_Chart" 2 | @inject IJSRuntime JS; 3 | 4 | 5 | 6 | 动手实验 7 | 8 | 9 | 10 | 11 | @code{ 12 | 13 | public IChartComponent chart; 14 | DynamicExample example; 15 | 16 | protected override void OnAfterRender(bool firstRender) 17 | { 18 | base.OnAfterRender(firstRender); 19 | example.Chart = chart; 20 | } 21 | 22 | 23 | #region 示例1 24 | 25 | object data1 = new object[] 26 | { 27 | new { time = "2019-03", value = 350, count = 800 }, 28 | new { time = "2019-04", value = 900, count = 600 }, 29 | new { time = "2019-05", value = 300, count = 400 }, 30 | new { time = "2019-06", value = 450, count = 380 }, 31 | new { time = "2019-07", value = 470, count = 220 }, 32 | }; 33 | 34 | DualAxesConfig config1 = new DualAxesConfig() 35 | { 36 | XField = "time", 37 | YField = new string[] { "value", "count" }, 38 | GeometryOptions = new object[] 39 | { 40 | new 41 | { 42 | Geometry = "column", 43 | ColorFunction ="({sales})=>{ console.log(sales); return sales > 50 ? '#5B8FF9' : '#5AD8A6'; }" 44 | }, 45 | new 46 | { 47 | Geometry = "line", 48 | LineStyle = new 49 | { 50 | LineWidth = 2, 51 | }, 52 | }, 53 | }, 54 | }; 55 | 56 | #endregion 示例1 57 | 58 | } 59 | 60 | 61 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Combo/DualLine_Combo_Chart.razor: -------------------------------------------------------------------------------- 1 | @page "/DualLine_Combo_Chart" 2 | @inject IJSRuntime JS; 3 | 4 | 5 | 6 | 动手实验 7 | 8 | 9 | 10 | 11 | @code{ 12 | 13 | public IChartComponent chart; 14 | DynamicExample example; 15 | 16 | protected override void OnAfterRender(bool firstRender) 17 | { 18 | base.OnAfterRender(firstRender); 19 | example.Chart = chart; 20 | } 21 | 22 | 23 | #region 示例1 24 | 25 | object data1 = new object[]{ 26 | new { year = "1991", value = 3 }, 27 | new { year= "1992", value= 4 }, 28 | new { year= "1993", value= 3.5 }, 29 | new { year= "1994", value= 5 }, 30 | new { year= "1995", value= 4.9 }, 31 | new { year= "1996", value= 6 }, 32 | new { year= "1997", value= 7 }, 33 | new { year= "1998", value= 9 }, 34 | new { year= "1999", value= 13 }, 35 | }; 36 | 37 | object data2 = new object[]{ 38 | new { year = "1991", count = 10 }, 39 | new { year= "1992", count= 4 }, 40 | new { year= "1993", count= 5 }, 41 | new { year= "1994", count= 5 }, 42 | new { year= "1995", count= 4.9 }, 43 | new { year= "1996", count= 35 }, 44 | new { year= "1997", count= 7 }, 45 | new { year= "1998", count= 1 }, 46 | new { year= "1999", count= 20 }, 47 | }; 48 | 49 | DualAxesConfig config1 = new DualAxesConfig() 50 | { 51 | XField = "year", 52 | YField = new string[] { "value", "count" }, 53 | YAxis = new { 54 | count= new { max= 300} 55 | }, 56 | GeometryOptions = new object[] { 57 | new { 58 | Geometry= "line", 59 | Color= "#5B8FF9", 60 | }, 61 | 62 | new { 63 | Geometry= "line", 64 | Color= "#5AD8A6", 65 | Label=new Label{ 66 | Formatter = "(a)=>{ console.log(a); return a.count; }", 67 | }, 68 | }, 69 | }, 70 | }; 71 | 72 | #endregion 示例1 73 | 74 | } 75 | 76 | 77 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Combo/Grouped_Column_Line_Chart.razor: -------------------------------------------------------------------------------- 1 | @page "/Grouped_Column_Line" 2 | @inject IJSRuntime JS; 3 | 4 | 5 | 6 | 动手实验 7 | 8 | 9 | 10 | 11 | @code{ 12 | 13 | public IChartComponent chart; 14 | DynamicExample example; 15 | 16 | protected override void OnAfterRender(bool firstRender) 17 | { 18 | base.OnAfterRender(firstRender); 19 | example.Chart = chart; 20 | } 21 | 22 | 23 | #region 示例1 24 | 25 | object uvBillData = new object[] 26 | { 27 | new { time = "2019-03", value = 350, type = "uv" }, 28 | new { time = "2019-04", value = 900, type = "uv" }, 29 | new { time = "2019-05", value = 300, type = "uv" }, 30 | new { time = "2019-06", value = 450, type = "uv" }, 31 | new { time = "2019-07", value = 470, type = "uv" }, 32 | new { time = "2019-03", value = 220, type = "bill" }, 33 | new { time = "2019-04", value = 300, type = "bill" }, 34 | new { time = "2019-05", value = 250, type = "bill" }, 35 | new { time = "2019-06", value = 220, type = "bill" }, 36 | new { time = "2019-07", value = 362, type = "bill" }, 37 | }; 38 | 39 | object transformData = new object[] 40 | { 41 | new { time = "2019-03", count = 800 }, 42 | new { time = "2019-04", count = 600 }, 43 | new { time = "2019-05", count = 400 }, 44 | new { time = "2019-06", count = 380 }, 45 | new { time = "2019-07", count = 220 }, 46 | }; 47 | 48 | DualAxesConfig config1 = new DualAxesConfig() 49 | { 50 | XField = "time", 51 | YField = new string[] { "value", "count" }, 52 | GeometryOptions = new object[] 53 | { 54 | new 55 | { 56 | Geometry = "column", 57 | IsGroup = true, 58 | seriesField = "type" 59 | }, 60 | new 61 | { 62 | Geometry = "line", 63 | LineStyle = new 64 | { 65 | LineWidth = 2 66 | } 67 | }, 68 | }, 69 | }; 70 | 71 | #endregion 示例1 72 | 73 | } 74 | 75 | 76 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Combo/Stacked_Column_Line_Chart.razor: -------------------------------------------------------------------------------- 1 | @page "/Stacked_Column_Line" 2 | @inject IJSRuntime JS; 3 | 4 | 5 | 6 | 动手实验 7 | 8 | 9 | 10 | 11 | @code{ 12 | 13 | public IChartComponent chart; 14 | DynamicExample example; 15 | 16 | protected override void OnAfterRender(bool firstRender) 17 | { 18 | base.OnAfterRender(firstRender); 19 | example.Chart = chart; 20 | } 21 | 22 | 23 | #region 示例1 24 | 25 | object uvBillData = new object[] 26 | { 27 | new { time = "2019-03", value = 350, type = "uv" }, 28 | new { time = "2019-04", value = 900, type = "uv" }, 29 | new { time = "2019-05", value = 300, type = "uv" }, 30 | new { time = "2019-06", value = 450, type = "uv" }, 31 | new { time = "2019-07", value = 470, type = "uv" }, 32 | new { time = "2019-03", value = 220, type = "bill" }, 33 | new { time = "2019-04", value = 300, type = "bill" }, 34 | new { time = "2019-05", value = 250, type = "bill" }, 35 | new { time = "2019-06", value = 220, type = "bill" }, 36 | new { time = "2019-07", value = 362, type = "bill" }, 37 | }; 38 | 39 | object transformData = new object[] 40 | { 41 | new { time = "2019-03", count = 800 }, 42 | new { time = "2019-04", count = 600 }, 43 | new { time = "2019-05", count = 400 }, 44 | new { time = "2019-06", count = 380 }, 45 | new { time = "2019-07", count = 220 }, 46 | }; 47 | 48 | DualAxesConfig config1 = new DualAxesConfig() 49 | { 50 | XField = "time", 51 | YField = new string[] { "value", "count" }, 52 | GeometryOptions = new object[] 53 | { 54 | new 55 | { 56 | Geometry = "column", 57 | IsStack = true, 58 | seriesField = "type" 59 | }, 60 | new 61 | { 62 | Geometry = "line", 63 | }, 64 | }, 65 | }; 66 | 67 | #endregion 示例1 68 | 69 | } 70 | 71 | 72 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Funnel/Funnel_Chart.razor: -------------------------------------------------------------------------------- 1 | @page "/Funnel_Chart" 2 | 3 | 4 | 5 | 动手实验 6 | 7 | 8 | 9 | 10 | @code{ 11 | 12 | public IChartComponent chart; 13 | DynamicExample example; 14 | 15 | protected override void OnAfterRender(bool firstRender) 16 | { 17 | base.OnAfterRender(firstRender); 18 | example.Chart = chart; 19 | } 20 | 21 | 22 | #region 示例1 23 | 24 | object[] data1 = new object[] { 25 | new { action= "浏览网站", pv= 50000 }, 26 | new { action= "放入购物车", pv= 35000 }, 27 | new { action= "生成订单", pv= 25000 }, 28 | new { action= "支付", pv= 15000 }, 29 | new { action= "成交", pv= 8500 }, 30 | }; 31 | 32 | FunnelConfig config1 = new FunnelConfig() 33 | { 34 | XField = "action", 35 | YField = "pv", 36 | Transpose = true 37 | }; 38 | 39 | #endregion 示例1 40 | 41 | 42 | } 43 | 44 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/GeneralConfigration/Axis.razor: -------------------------------------------------------------------------------- 1 | @page "/Axis" 2 | @inject NavigationManager NavigationManager 3 | @inject HttpClient HttpClient 4 | 5 | 6 | 7 | @code{ 8 | 9 | #region 示例1 10 | 11 | private async Task onChart1_FirstRender(IChartComponent chart) 12 | { 13 | var data1 = await DemoData.FertilityItemAsync(NavigationManager, HttpClient); 14 | await chart.ChangeData(data1); 15 | } 16 | 17 | LineConfig config1 = new LineConfig() 18 | { 19 | Padding = "auto", 20 | XField = "year", 21 | YField = "value", 22 | SeriesField = "country", 23 | XAxis = new ValueCatTimeAxis() 24 | { 25 | Visible = true 26 | }, 27 | }; 28 | 29 | #endregion 示例1 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/GeneralConfigration/Dark_Mode.razor: -------------------------------------------------------------------------------- 1 | @page "/Dark_Mode" 2 | 3 | 4 | 5 | @code{ 6 | #region 示例1 7 | 8 | object[] data1 = new object[] { 9 | new { 10 | year= "1991", 11 | value= 31, 12 | }, 13 | new { 14 | year= "1992", 15 | value= 41, 16 | }, 17 | new { 18 | year= "1993", 19 | value= 35, 20 | }, 21 | new { 22 | year= "1994", 23 | value= 55, 24 | }, 25 | new { 26 | year= "1995", 27 | value= 49, 28 | }, 29 | new { 30 | year= "1996", 31 | value= 15, 32 | }, 33 | new { 34 | year= "1997", 35 | value= 17, 36 | }, 37 | new { 38 | year= "1998", 39 | value= 29, 40 | }, 41 | new { 42 | year= "1999", 43 | value= 33, 44 | }, 45 | }; 46 | 47 | ColumnConfig config1 = new ColumnConfig() 48 | { 49 | Theme = "dark", 50 | XField = "year", 51 | YField = "value", 52 | }; 53 | 54 | 55 | #endregion 示例1 56 | 57 | 58 | } 59 | 60 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/GeneralConfigration/Event.razor: -------------------------------------------------------------------------------- 1 | @page "/Event" 2 | 3 | 4 | 5 | 6 |
    7 | @foreach (var item in events) 8 | { 9 |
  • @item
  • 10 | } 11 | 12 |
13 | 14 | @code{ 15 | 16 | List events = new List(); 17 | 18 | private void AddEvents(string eventName) 19 | { 20 | events.Insert(0, eventName); 21 | } 22 | 23 | 24 | #region 示例1 25 | 26 | object[] data1 = new object[] { 27 | new { 28 | name= "London", 29 | 月份= "Jan.", 30 | 月均降雨量= 18.9, 31 | }, 32 | new { 33 | name= "London", 34 | 月份= "Feb.", 35 | 月均降雨量= 28.8, 36 | }, 37 | new { 38 | name= "London", 39 | 月份= "Mar.", 40 | 月均降雨量= 39.3, 41 | }, 42 | new { 43 | name= "London", 44 | 月份= "Apr.", 45 | 月均降雨量= 81.4, 46 | }, 47 | new { 48 | name= "London", 49 | 月份= "May", 50 | 月均降雨量= 47, 51 | }, 52 | new { 53 | name= "London", 54 | 月份= "Jun.", 55 | 月均降雨量= 20.3, 56 | }, 57 | new { 58 | name= "London", 59 | 月份= "Jul.", 60 | 月均降雨量= 24, 61 | }, 62 | new { 63 | name= "London", 64 | 月份= "Aug.", 65 | 月均降雨量= 35.6, 66 | }, 67 | new { 68 | name= "Berlin", 69 | 月份= "Jan.", 70 | 月均降雨量= 12.4, 71 | }, 72 | new { 73 | name= "Berlin", 74 | 月份= "Feb.", 75 | 月均降雨量= 23.2, 76 | }, 77 | new { 78 | name= "Berlin", 79 | 月份= "Mar.", 80 | 月均降雨量= 34.5, 81 | }, 82 | new { 83 | name= "Berlin", 84 | 月份= "Apr.", 85 | 月均降雨量= 99.7, 86 | }, 87 | new { 88 | name= "Berlin", 89 | 月份= "May", 90 | 月均降雨量= 52.6, 91 | }, 92 | new { 93 | name= "Berlin", 94 | 月份= "Jun.", 95 | 月均降雨量= 35.5, 96 | }, 97 | new { 98 | name= "Berlin", 99 | 月份= "Jul.", 100 | 月均降雨量= 37.4, 101 | }, 102 | new { 103 | name= "Berlin", 104 | 月份= "Aug.", 105 | 月均降雨量= 42.4, 106 | }, 107 | }; 108 | 109 | ColumnConfig config1 = new ColumnConfig() 110 | { 111 | XField = "月份", 112 | YField = "月均降雨量", 113 | YAxis = new ValueAxis() 114 | { 115 | Min = 0, 116 | }, 117 | Label = new ColumnViewConfigLabel() 118 | { 119 | Visible = true, 120 | }, 121 | SeriesField = "name", 122 | Color = new string[] { "#1ca9e6", "#f88c24" }, 123 | }; 124 | 125 | 126 | #endregion 示例1 127 | 128 | } 129 | 130 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/GeneralConfigration/Guideline.razor: -------------------------------------------------------------------------------- 1 | @page "/Guideline" 2 | 3 | 4 | 5 | @code{ 6 | #region 示例1 7 | 8 | object[] data1 = new object[] { 9 | new { 10 | year= "1991", 11 | value= 31, 12 | }, 13 | new { 14 | year= "1992", 15 | value= 41, 16 | }, 17 | new { 18 | year= "1993", 19 | value= 35, 20 | }, 21 | new { 22 | year= "1994", 23 | value= 55, 24 | }, 25 | new { 26 | year= "1995", 27 | value= 49, 28 | }, 29 | new { 30 | year= "1996", 31 | value= 15, 32 | }, 33 | new { 34 | year= "1997", 35 | value= 17, 36 | }, 37 | new { 38 | year= "1998", 39 | value= 29, 40 | }, 41 | new { 42 | year= "1999", 43 | value= 33, 44 | }, 45 | }; 46 | 47 | ColumnConfig config1 = new ColumnConfig() 48 | { 49 | XField = "year", 50 | YField = "value", 51 | GuideLine = new GuideLineConfig[]{ 52 | new GuideLineConfig() { 53 | Type = "mean", // "max" | "min" | "median" | "mean" 54 | LineStyle =new LineStyle() { 55 | Stroke = "red", 56 | LineDash =new int[] {4, 2 }, 57 | }, 58 | Text =new GuideLineConfigText() 59 | { 60 | Position= "start", 61 | Content= "预警线", 62 | Style= new TextStyle() { 63 | Fill= "red", 64 | }, 65 | }, 66 | }, 67 | }, 68 | }; 69 | 70 | 71 | #endregion 示例1 72 | } 73 | 74 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/GeneralConfigration/Legend.razor: -------------------------------------------------------------------------------- 1 | @page "/Legend" 2 | 3 | 4 | 5 | @code{ 6 | #region 示例1 7 | 8 | object[] data1 = new object[] { 9 | new { 10 | time= "16 Q1", 11 | type= "移动游戏", 12 | value= 0, 13 | }, 14 | new { 15 | time= "16 Q1", 16 | type= "移动购物", 17 | value= 17.8, 18 | }, 19 | new { 20 | time= "16 Q1", 21 | type= "移动营销", 22 | value= 69.4, 23 | }, 24 | new { 25 | time= "16 Q1", 26 | type= "共享单车", 27 | value= 12.8, 28 | }, 29 | new { 30 | time= "16 Q2", 31 | type= "移动游戏", 32 | value= 0, 33 | }, 34 | new { 35 | time= "16 Q2", 36 | type= "移动购物", 37 | value= 18.1, 38 | }, 39 | new { 40 | time= "16 Q2", 41 | type= "移动营销", 42 | value= 70.7, 43 | }, 44 | new { 45 | time= "16 Q2", 46 | type= "共享单车", 47 | value= 11.2, 48 | }, 49 | new { 50 | time= "16 Q3", 51 | type= "移动游戏", 52 | value= 0, 53 | }, 54 | new { 55 | time= "16 Q3", 56 | type= "移动购物", 57 | value= 20.8, 58 | }, 59 | new { 60 | time= "16 Q3", 61 | type= "移动营销", 62 | value= 67.4, 63 | }, 64 | new { 65 | time= "16 Q3", 66 | type= "共享单车", 67 | value= 11.8, 68 | }, 69 | new { 70 | time= "16 Q4", 71 | type= "移动游戏", 72 | value= 0.1, 73 | }, 74 | new { 75 | time= "16 Q4", 76 | type= "移动购物", 77 | value= 20.3, 78 | }, 79 | new { 80 | time= "16 Q4", 81 | type= "移动营销", 82 | value= 69.2, 83 | }, 84 | new { 85 | time= "16 Q4", 86 | type= "共享单车", 87 | value= 10.4, 88 | }, 89 | new { 90 | time= "17 Q1", 91 | type= "移动游戏", 92 | value= 0.4, 93 | }, 94 | new { 95 | time= "17 Q1", 96 | type= "移动购物", 97 | value= 17.3, 98 | }, 99 | new { 100 | time= "17 Q1", 101 | type= "移动营销", 102 | value= 68.3, 103 | }, 104 | new { 105 | time= "17 Q1", 106 | type= "共享单车", 107 | value= 14, 108 | }, 109 | new { 110 | time= "17 Q2", 111 | type= "移动游戏", 112 | value= 1.2, 113 | }, 114 | new { 115 | time= "17 Q2", 116 | type= "移动购物", 117 | value= 18.3, 118 | }, 119 | new { 120 | time= "17 Q2", 121 | type= "移动营销", 122 | value= 68.6, 123 | }, 124 | new { 125 | time= "17 Q2", 126 | type= "共享单车", 127 | value= 11.9, 128 | }, 129 | }; 130 | 131 | ColumnConfig config1 = new ColumnConfig() 132 | { 133 | XField = "time", 134 | YField = "value", 135 | SeriesField = "type", 136 | Legend = new Charts.Legend() 137 | { 138 | Visible = true, 139 | Position = "left", 140 | }, 141 | }; 142 | 143 | 144 | #endregion 示例1 145 | 146 | 147 | } 148 | 149 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/GeneralConfigration/Set_Padding.razor: -------------------------------------------------------------------------------- 1 | @page "/Set_Padding" 2 | 3 | 4 | 5 | @code{ 6 | #region 示例1 7 | 8 | object[] data1 = new object[] { 9 | new { 10 | year= "1991", 11 | value= 31, 12 | }, 13 | new { 14 | year= "1992", 15 | value= 41, 16 | }, 17 | new { 18 | year= "1993", 19 | value= 35, 20 | }, 21 | new { 22 | year= "1994", 23 | value= 55, 24 | }, 25 | new { 26 | year= "1995", 27 | value= 49, 28 | }, 29 | new { 30 | year= "1996", 31 | value= 15, 32 | }, 33 | new { 34 | year= "1997", 35 | value= 17, 36 | }, 37 | new { 38 | year= "1998", 39 | value= 29, 40 | }, 41 | new { 42 | year= "1999", 43 | value= 33, 44 | }, 45 | }; 46 | 47 | ColumnConfig config1 = new ColumnConfig() 48 | { 49 | XField = "year", 50 | YField = "value", 51 | Padding = new int[] { 100, 100, 100, 100 }, 52 | }; 53 | 54 | 55 | #endregion 示例1 56 | 57 | 58 | } 59 | 60 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/GeneralConfigration/Set_State.razor: -------------------------------------------------------------------------------- 1 | @page "/Set_State" 2 | 3 | Not Finished 4 | 5 | 6 | 7 | @code{ 8 | 9 | #region 示例1 10 | 11 | object[] data1 = new object[] { 12 | new { 13 | year= "1991", 14 | value= 31, 15 | }, 16 | new { 17 | year= "1992", 18 | value= 41, 19 | }, 20 | new { 21 | year= "1993", 22 | value= 35, 23 | }, 24 | new { 25 | year= "1994", 26 | value= 55, 27 | }, 28 | new { 29 | year= "1995", 30 | value= 49, 31 | }, 32 | new { 33 | year= "1996", 34 | value= 15, 35 | }, 36 | new { 37 | year= "1997", 38 | value= 17, 39 | }, 40 | new { 41 | year= "1998", 42 | value= 29, 43 | }, 44 | new { 45 | year= "1999", 46 | value= 33, 47 | }, 48 | }; 49 | 50 | ColumnConfig config1 = new ColumnConfig() 51 | { 52 | XField = "year", 53 | YField = "value", 54 | }; 55 | 56 | public void onCreateAfter1(IChartComponent chart) 57 | { 58 | chart.SetActive(new { name = "year", exp = "1994" }, 59 | new 60 | { 61 | FillStyle = "#5AD8A6", 62 | FillOpacity = 0.8, 63 | }); 64 | } 65 | 66 | #endregion 示例1 67 | 68 | } 69 | 70 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/GeneralConfigration/Title_and_Description.razor: -------------------------------------------------------------------------------- 1 | @page "/Title_and_Description" 2 | 3 | 4 | 5 | @code{ 6 | #region 示例1 7 | 8 | object[] data1 = new object[] { 9 | new { 10 | year= "1991", 11 | value= 31, 12 | }, 13 | new { 14 | year= "1992", 15 | value= 41, 16 | }, 17 | new { 18 | year= "1993", 19 | value= 35, 20 | }, 21 | new { 22 | year= "1994", 23 | value= 55, 24 | }, 25 | new { 26 | year= "1995", 27 | value= 49, 28 | }, 29 | new { 30 | year= "1996", 31 | value= 15, 32 | }, 33 | new { 34 | year= "1997", 35 | value= 17, 36 | }, 37 | new { 38 | year= "1998", 39 | value= 29, 40 | }, 41 | new { 42 | year= "1999", 43 | value= 33, 44 | }, 45 | }; 46 | 47 | ColumnConfig config1 = new ColumnConfig() 48 | { 49 | XField = "year", 50 | YField = "value", 51 | }; 52 | 53 | 54 | #endregion 示例1 55 | 56 | 57 | } 58 | 59 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/GetStarted/Started.razor: -------------------------------------------------------------------------------- 1 | @page "/Started" 2 | @page "/" 3 | 4 | @inject IJSRuntime JS 5 | 6 | 介绍 7 | 8 | Ant Design Charts Blazor 图表库基于 G2Plot 开发 9 | 10 | 11 | 12 | 安装 13 | 14 |
    15 |
  • 16 | 进入应用的项目文件夹,安装 Nuget 包引用 17 |
  • 18 |
19 | $ dotnet add package AntDesign.Charts 20 |
    21 |
  • 22 | 在 wwwroot/index.html(WebAssembly) 或 Pages/_Host.razor(Server) 中引入静态文件: 23 |
  • 24 |
25 | @(@"") 26 | @(@"") 27 |
    28 |
  • 29 | 在 _Imports.razor 中加入命名空间 30 |
  • 31 |
32 | @(@"@using AntDesign.Charts") 33 |
    34 |
  • 35 | 最后就可以在.razor组件中引用啦! 36 |
  • 37 |
38 |
39 | 40 | 链接 41 | 42 | GitHub 43 |
44 | Blazor 官方文档 45 |
46 | G2Plot 官方文档 47 |
48 | 动手实验 49 | 50 | 51 | 52 | 53 | 54 | 55 | @code{ 56 | public IChartComponent chart; 57 | DynamicExample example; 58 | 59 | protected override void OnAfterRender(bool firstRender) 60 | { 61 | base.OnAfterRender(firstRender); 62 | example.Chart = chart; 63 | } 64 | 65 | 66 | string jsonConfig = @"{ 67 | ""forceFit"" : ""true"", 68 | ""xField"" : ""year"", 69 | ""yField"" : ""value"" 70 | }"; 71 | 72 | string jsConfig = @" { 73 | xField: 'year', 74 | yField: 'value', 75 | label: { 76 | // 可手动配置 label 数据标签位置 77 | position: 'middle', // 'top', 'bottom', 'middle', 78 | // 配置样式 79 | style: { 80 | fill: '#FFFFFF', 81 | opacity: 0.6, 82 | }, 83 | }, 84 | xAxis: { 85 | label: { 86 | autoHide: true, 87 | autoRotate: false, 88 | }, 89 | }, 90 | }"; 91 | 92 | string jsonData = @"[ 93 | { ""year"": ""1991"", ""value"": 3 }, 94 | { ""year"": ""1992"", ""value"": 4 }, 95 | { ""year"": ""1993"", ""value"": 3.5 }, 96 | { ""year"": ""1994"", ""value"": 5 }, 97 | { ""year"": ""1995"", ""value"": 4.9 }, 98 | { ""year"": ""1996"", ""value"": 6 }, 99 | { ""year"": ""1997"", ""value"": 7 }, 100 | { ""year"": ""1998"", ""value"": 9 }, 101 | { ""year"": ""1999"", ""value"": 13 } 102 | ]"; 103 | 104 | string jsData = @"[ 105 | { year: '1991', value: 3 }, 106 | { year: '1992', value: 4 }, 107 | { year: '1993', value: 3.5 }, 108 | { year: '1994', value: 5 }, 109 | { year: '1995', value: 4.9 }, 110 | { year: '1996', value: 6 }, 111 | { year: '1997', value: 7 }, 112 | { year: '1998', value: 9 }, 113 | { year: '1999', value: 13 } 114 | ]"; 115 | } 116 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Heatmap/DensityHeatmap_Chart.razor: -------------------------------------------------------------------------------- 1 | @page "/DensityHeatmap_Chart" 2 | @using OneOf 3 | @inject NavigationManager NavigationManager 4 | @inject HttpClient HttpClient 5 | 6 | 7 | 8 | 动手实验 9 | 10 | 11 | 12 | 13 | @code{ 14 | 15 | public IChartComponent chart; 16 | DynamicExample example; 17 | 18 | protected override void OnAfterRender(bool firstRender) 19 | { 20 | base.OnAfterRender(firstRender); 21 | example.Chart = chart; 22 | } 23 | 24 | #region 示例1 25 | 26 | private async Task onChart1_FirstRender(IChartComponent chart) 27 | { 28 | var data1 = await DemoData.HeadMapDataAsync(NavigationManager, HttpClient); 29 | await chart.ChangeData(data1); 30 | } 31 | 32 | HeatmapConfig config1 = new HeatmapConfig() 33 | { 34 | HeatMapType = "density", 35 | XField = "g", 36 | YField = "l", 37 | ColorField = "tmp", 38 | Color = new string[] { "#F51D27", "#FA541C", "#FF8C12", "#FFC838", "#FAFFA8", "#80FF73", "#12CCCC", "#1890FF", "#6E32C2" }, 39 | Legend = new MatrixLegendConfig() 40 | { 41 | Position = "bottom" 42 | }, 43 | Annotation = new [] 44 | { 45 | new ImageAnnotation() 46 | { 47 | Start = new[]{"min","max"}, 48 | End = new[]{"max","min"}, 49 | Src = "https://gw.alipayobjects.com/zos/rmsportal/NeUTMwKtPcPxIFNTWZOZ.png" 50 | } 51 | } 52 | }; 53 | 54 | 55 | #endregion 示例1 56 | 57 | } 58 | 59 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Heatmap/Heatmap_Chart.razor: -------------------------------------------------------------------------------- 1 | @page "/Heatmap_Chart" 2 | @inject NavigationManager NavigationManager 3 | @inject HttpClient HttpClient 4 | 5 | 6 | 7 | 动手实验 8 | 9 | 10 | 11 | 12 | @code{ 13 | 14 | public IChartComponent chart; 15 | DynamicExample example; 16 | 17 | protected override void OnAfterRender(bool firstRender) 18 | { 19 | base.OnAfterRender(firstRender); 20 | example.Chart = chart; 21 | } 22 | 23 | 24 | #region 示例1 25 | 26 | private async Task onChart1_FirstRender(IChartComponent chart) 27 | { 28 | var data1 = await DemoData.BasementProdAsync(NavigationManager, HttpClient); 29 | await chart.ChangeData(data1); 30 | } 31 | 32 | HeatmapConfig config1 = new HeatmapConfig() 33 | { 34 | AutoFit = false, 35 | Width = 650, 36 | Height = 500, 37 | XField = "month_of_Year", 38 | YField = "district", 39 | ColorField = "aqhi", 40 | ShapeType = "rect", 41 | Color = new string[] { "#174c83", "#7eb6d4", "#efefeb", "#efa759", "#9b4d16" }, 42 | Meta = new 43 | { 44 | Month_of_Year = new 45 | { 46 | Type = "cat", 47 | }, 48 | }, 49 | }; 50 | 51 | 52 | #endregion 示例1 53 | } 54 | 55 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Line/Marker_Point.razor: -------------------------------------------------------------------------------- 1 | @page "/Marker_Point" 2 | 3 | 4 | 5 | 动手实验 6 | 7 | 8 | 9 | 10 | @code{ 11 | 12 | public IChartComponent chart; 13 | DynamicExample example; 14 | 15 | protected override void OnAfterRender(bool firstRender) 16 | { 17 | base.OnAfterRender(firstRender); 18 | example.Chart = chart; 19 | } 20 | 21 | 22 | #region 示例1 23 | 24 | object[] data1 = new object[] { 25 | new { date= "2019-01-01", value= 3 }, 26 | new { date= "2019-02-01", value= 4 }, 27 | new { date= "2019-03-01", value= 3.5 }, 28 | new { date= "2019-04-01", value= 5 }, 29 | new { date= "2019-05-01", value= 4.9, festival= "劳动节" }, 30 | new { date= "2019-06-01", value= 6 }, 31 | new { date= "2019-07-01", value= 7 }, 32 | new { date= "2019-08-01", value= 9 }, 33 | new { date= "2019-09-01", value= 3 }, 34 | new { date= "2019-10-01", value= 13, festival= "国庆节" }, 35 | new { date= "2019-11-01", value= 6 }, 36 | new { date= "2019-12-01", value= 23 }, 37 | }; 38 | 39 | LineConfig config1 = new LineConfig() 40 | { 41 | Padding = "auto", 42 | XField = "date", 43 | YField = "value", 44 | YAxis = new ValueAxis() 45 | { 46 | Nice = true, 47 | }, 48 | Label = new Label() 49 | { 50 | Visible = false, 51 | }, 52 | }; 53 | 54 | object otherConfig1 = new 55 | { 56 | MarkerPoints = new object[] 57 | { 58 | new{ 59 | Visible = true, 60 | data =new object []{new { date = "2019-05-01", value = 4.9 },new { date = "2019-10-01" } }, 61 | Label = new 62 | { 63 | Visible = true, 64 | Field = "festival", 65 | }, 66 | }, 67 | }, 68 | }; 69 | 70 | #endregion 示例1 71 | } 72 | 73 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Liquid/Liquid_Chart.razor: -------------------------------------------------------------------------------- 1 | @page "/Liquid_Chart" 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 动手实验 21 | 22 | 23 | 24 | 25 | @code{ 26 | 27 | public IChartComponent chart; 28 | DynamicExample example; 29 | 30 | protected override void OnAfterRender(bool firstRender) 31 | { 32 | base.OnAfterRender(firstRender); 33 | example.Chart = chart; 34 | } 35 | 36 | #region 示例1 37 | 38 | LiquidConfig config1 = new LiquidConfig() 39 | { 40 | Percent = (decimal?)0.25, 41 | Outline = new LiquidOutline() 42 | { 43 | Border = 4, 44 | Distance = 8 45 | }, 46 | Wave = new LiquidWave() 47 | { 48 | Length = 128 49 | } 50 | }; 51 | 52 | #endregion 53 | 54 | #region 示例2 55 | 56 | LiquidConfig config2 = new LiquidConfig() 57 | { 58 | Percent = new decimal(0.25), 59 | Shape = "rect", 60 | Outline = new LiquidOutline() 61 | { 62 | Border = 2, 63 | Distance = 4 64 | }, 65 | Wave = new LiquidWave() 66 | { 67 | Length = 128 68 | } 69 | }; 70 | 71 | #endregion 72 | 73 | #region 示例3 74 | 75 | LiquidConfig config3 = new LiquidConfig() 76 | { 77 | Percent = new decimal(0.25), 78 | Shape = "diamond", 79 | Outline = new LiquidOutline() 80 | { 81 | Border = 4, 82 | Distance = 8 83 | }, 84 | Wave = new LiquidWave() 85 | { 86 | Length = 128 87 | } 88 | }; 89 | 90 | #endregion 91 | 92 | #region 示例4 93 | 94 | LiquidConfig config4 = new LiquidConfig() 95 | { 96 | Percent = new decimal(0.65), 97 | Shape = "diamond", 98 | Outline = new LiquidOutline() 99 | { 100 | Border = 4, 101 | Distance = 8 102 | }, 103 | Wave = new LiquidWave() 104 | { 105 | Length = 128 106 | }, 107 | Pattern = new 108 | { 109 | Type = "line" 110 | } 111 | }; 112 | 113 | #endregion 114 | } 115 | 116 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Pie/Donut_Chart.razor: -------------------------------------------------------------------------------- 1 | @page "/Donut_Chart" 2 | 3 | 4 | 5 | 动手实验 6 | 7 | 8 | 9 | 10 | @code{ 11 | 12 | public IChartComponent chart; 13 | DynamicExample example; 14 | 15 | protected override void OnAfterRender(bool firstRender) 16 | { 17 | base.OnAfterRender(firstRender); 18 | example.Chart = chart; 19 | } 20 | 21 | #region 示例1 22 | 23 | object[] data1 = new object[] { 24 | new { 25 | type= "分类一", 26 | value= 27, 27 | }, 28 | new { 29 | type= "分类二", 30 | value= 25, 31 | }, 32 | new { 33 | type= "分类三", 34 | value= 18, 35 | }, 36 | new { 37 | type= "分类四", 38 | value= 15, 39 | }, 40 | new { 41 | type= "分类五", 42 | value= 10, 43 | }, 44 | new { 45 | type= "其它", 46 | value= 5, 47 | }, 48 | }; 49 | 50 | PieConfig config1 = new PieConfig() 51 | { 52 | AppendPadding = 10, 53 | InnerRadius = 0.6, 54 | Radius = 0.8, 55 | Padding = "auto", 56 | AngleField = "value", 57 | ColorField = "type", 58 | }; 59 | 60 | 61 | #endregion 示例1 62 | 63 | 64 | } 65 | 66 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Pie/Pie_Chart.razor: -------------------------------------------------------------------------------- 1 | @page "/Pie_Chart" 2 | 3 | 4 | 5 | 动手实验 6 | 7 | 8 | 9 | 10 | @code{ 11 | 12 | public IChartComponent chart; 13 | DynamicExample example; 14 | 15 | protected override void OnAfterRender(bool firstRender) 16 | { 17 | base.OnAfterRender(firstRender); 18 | example.Chart = chart; 19 | } 20 | 21 | 22 | #region 示例1 23 | 24 | object[] data1 = new object[] { 25 | new { 26 | type= "分类一", 27 | value= 27, 28 | }, 29 | new { 30 | type= "分类二", 31 | value= 25, 32 | }, 33 | new { 34 | type= "分类三", 35 | value= 18, 36 | }, 37 | new { 38 | type= "分类四", 39 | value= 15, 40 | }, 41 | new { 42 | type= "分类五", 43 | value= 10, 44 | }, 45 | new { 46 | type= "其它", 47 | value= 5, 48 | }, 49 | }; 50 | 51 | PieConfig config1 = new PieConfig() 52 | { 53 | Radius = 0.8, 54 | AngleField = "value", 55 | ColorField = "type", 56 | Label = new PieLabelConfig() 57 | { 58 | Visible = true, 59 | Type = "inner", 60 | }, 61 | }; 62 | 63 | 64 | #endregion 示例1 65 | 66 | } 67 | 68 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Radar/Radar_Chart.razor: -------------------------------------------------------------------------------- 1 | @page "/Radar_Chart" 2 | 3 | 4 | 5 | 动手实验 6 | 7 | 8 | 9 | 10 | @code{ 11 | 12 | public IChartComponent chart; 13 | DynamicExample example; 14 | 15 | protected override void OnAfterRender(bool firstRender) 16 | { 17 | base.OnAfterRender(firstRender); 18 | example.Chart = chart; 19 | } 20 | 21 | #region 示例1 22 | 23 | object[] data1 = new object[] { 24 | new { 25 | item= "Design", 26 | score= 70, 27 | }, 28 | new { 29 | item= "Development", 30 | score= 60, 31 | }, 32 | new { 33 | item= "Marketing", 34 | score= 60, 35 | }, 36 | new { 37 | item= "Users", 38 | score= 40, 39 | }, 40 | new { 41 | item= "Test", 42 | score= 60, 43 | }, 44 | new { 45 | item= "Language", 46 | score= 70, 47 | }, 48 | new { 49 | item= "Technology", 50 | score= 50, 51 | }, 52 | new { 53 | item= "Support", 54 | score= 30, 55 | }, 56 | new { 57 | item= "Sales", 58 | score= 60, 59 | }, 60 | new { 61 | item= "UX", 62 | score= 50, 63 | }, 64 | }; 65 | RadarConfig config1 = new RadarConfig() 66 | { 67 | XField = "item", 68 | YField = "score", 69 | RadiusAxis = new ValueAxis() 70 | { 71 | Grid = new BaseAxisGrid() 72 | { 73 | AlternateColor = new string[] { "rgba(0, 0, 0, 0.04)", null }, 74 | }, 75 | }, 76 | Area = new RadarViewConfigArea() 77 | { 78 | Visible = false, 79 | }, 80 | Point = new RadarViewConfigPoint() 81 | { 82 | Visible = true, 83 | }, 84 | }; 85 | 86 | #endregion 示例1 87 | 88 | 89 | } 90 | 91 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Rose/Rose_Chart.razor: -------------------------------------------------------------------------------- 1 | @page "/Rose_Chart" 2 | 3 | 4 | 5 | 动手实验 6 | 7 | 8 | 9 | 10 | @code{ 11 | 12 | public IChartComponent chart; 13 | DynamicExample example; 14 | 15 | protected override void OnAfterRender(bool firstRender) 16 | { 17 | base.OnAfterRender(firstRender); 18 | example.Chart = chart; 19 | } 20 | 21 | #region 示例1 22 | 23 | object[] data1 = new object[] { 24 | new { 25 | type= "分类一", 26 | value= 27, 27 | }, 28 | new { 29 | type= "分类二", 30 | value= 25, 31 | }, 32 | new { 33 | type= "分类三", 34 | value= 18, 35 | }, 36 | new { 37 | type= "分类四", 38 | value= 15, 39 | }, 40 | new { 41 | type= "分类五", 42 | value= 10, 43 | }, 44 | new { 45 | type= "其它", 46 | value= 5, 47 | }, 48 | }; 49 | 50 | RoseConfig config1 = new RoseConfig() 51 | { 52 | Radius = 0.8, 53 | YField = "value", 54 | XField = "type", 55 | SeriesField = "type", 56 | Label = new RoseLabel() 57 | { 58 | Visible = true, 59 | @*content= (text) => text.value,*@ 60 | }, 61 | }; 62 | 63 | 64 | #endregion 示例1 65 | 66 | 67 | } 68 | 69 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Scatter/Scatter_Chart.razor: -------------------------------------------------------------------------------- 1 | @page "/Scatter_Chart" 2 | @inject NavigationManager NavigationManager 3 | @inject HttpClient HttpClient 4 | 5 | 6 | 7 | 8 | 动手实验 9 | 10 | 11 | 12 | 13 | @code{ 14 | 15 | public IChartComponent chart; 16 | DynamicExample example; 17 | 18 | protected override void OnAfterRender(bool firstRender) 19 | { 20 | base.OnAfterRender(firstRender); 21 | example.Chart = chart; 22 | } 23 | 24 | 25 | #region 示例1 26 | 27 | private async Task onChart1_FirstRender(IChartComponent chart) 28 | { 29 | var data1 = await DemoData.IMDBAsync(NavigationManager, HttpClient); 30 | await chart.ChangeData(data1); 31 | } 32 | 33 | ScatterConfig config1 = new ScatterConfig() 34 | { 35 | XField = "revenue", 36 | YField = "rating", 37 | Shape = "circle", 38 | ColorField = "genre", 39 | Size = 4, 40 | YAxis = new ValueTimeAxis() 41 | { 42 | Nice = true, 43 | Line = new BaseAxisLine() 44 | { 45 | Style = new LineStyle() 46 | { 47 | Stroke = "#aaa" 48 | } 49 | } 50 | }, 51 | XAxis = new ValueTimeAxis() 52 | { 53 | Min = -100, 54 | Grid = new BaseAxisGrid() 55 | { 56 | Line = new BaseAxisGridLine() 57 | { 58 | Style = new LineStyle() 59 | { 60 | Stroke = "#aaa" 61 | } 62 | } 63 | } 64 | } 65 | }; 66 | 67 | 68 | #endregion 示例1 69 | 70 | 71 | } 72 | 73 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Step/Basic_StepLine_Chart.razor: -------------------------------------------------------------------------------- 1 | @page "/Basic_StepLine_Chart" 2 | @inject NavigationManager NavigationManager 3 | @inject HttpClient HttpClient 4 | 5 | 6 | 7 | 动手实验 8 | 9 | 10 | 11 | 12 | @code{ 13 | 14 | public IChartComponent chart; 15 | DynamicExample example; 16 | 17 | protected override void OnAfterRender(bool firstRender) 18 | { 19 | base.OnAfterRender(firstRender); 20 | example.Chart = chart; 21 | } 22 | 23 | IChartComponent chart1; 24 | FireworksSalesItem[] data1; 25 | 26 | protected override async Task OnInitializedAsync() 27 | { 28 | data1 = await DemoData.FireworksSalesAsync(NavigationManager, HttpClient); 29 | await chart1.ChangeData(data1); 30 | 31 | await base.OnInitializedAsync(); 32 | } 33 | 34 | 35 | #region 示例1 36 | 37 | LineConfig config1 = new LineConfig() 38 | { 39 | StepType = LineConfig.StepTypeHV, 40 | Padding = "auto", 41 | XField = "Date", 42 | YField = "scales", 43 | 44 | }; 45 | 46 | #endregion 示例1 47 | 48 | 49 | } 50 | 51 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Temp.razor: -------------------------------------------------------------------------------- 1 | @page "/Temp" 2 | @using Title = AntDesign.Charts.Title 3 | 4 | 5 | 6 | @code{ 7 | readonly object[] data1 = 8 | { 9 | new {地区 = "华东", 销售额 = 4684506.442}, 10 | new {地区 = "中南", 销售额 = 4137415.0929999948}, 11 | new {地区 = "东北", 销售额 = 2681567.469000001}, 12 | new {地区 = "华北", 销售额 = 2447301.017000004}, 13 | new {地区 = "西南", 销售额 = 1303124.508000002}, 14 | new {地区 = "西北", 销售额 = 815039.5959999998} 15 | }; 16 | 17 | readonly BarConfig config1 = new BarConfig 18 | { 19 | XField = "销售额", 20 | YField = "地区", 21 | Label = new BarViewConfigLabel 22 | { 23 | Visible = true, 24 | } 25 | }; 26 | 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Treemap/Treemap_Chart.razor: -------------------------------------------------------------------------------- 1 | @page "/Treemap_Chart" 2 | 3 | 4 | 5 | 动手实验 6 | 7 | 8 | 9 | 10 | @code{ 11 | 12 | public IChartComponent chart; 13 | DynamicExample example; 14 | 15 | protected override void OnAfterRender(bool firstRender) 16 | { 17 | base.OnAfterRender(firstRender); 18 | example.Chart = chart; 19 | } 20 | 21 | #region 示例1 22 | 23 | Data data1 = new Data() 24 | { 25 | Name = "root", 26 | Children = new List { 27 | new TreemapDataItem() { Name= "分类 1", Value= 560 }, 28 | new TreemapDataItem() { Name= "分类 2", Value= 500 }, 29 | new TreemapDataItem() { Name= "分类 3", Value= 150 }, 30 | new TreemapDataItem() { Name= "分类 4", Value= 140 }, 31 | new TreemapDataItem() { Name= "分类 5", Value= 115 }, 32 | new TreemapDataItem() { Name= "分类 6", Value= 95 }, 33 | new TreemapDataItem() { Name= "分类 7", Value= 90 }, 34 | new TreemapDataItem() { Name= "分类 8", Value= 75 }, 35 | new TreemapDataItem() { Name= "分类 9", Value= 98 }, 36 | new TreemapDataItem() { Name= "分类 10", Value= 60 }, 37 | new TreemapDataItem() { Name= "分类 11", Value= 45 }, 38 | new TreemapDataItem() { Name= "分类 12", Value= 40 }, 39 | new TreemapDataItem() { Name= "分类 13", Value= 40 }, 40 | new TreemapDataItem() { Name= "分类 14", Value= 35 }, 41 | new TreemapDataItem() { Name= "分类 15", Value= 40 }, 42 | new TreemapDataItem() { Name= "分类 16", Value= 40 }, 43 | new TreemapDataItem() { Name= "分类 17", Value= 40 }, 44 | new TreemapDataItem() { Name= "分类 18", Value= 30 }, 45 | new TreemapDataItem() { Name= "分类 19", Value= 28 }, 46 | new TreemapDataItem() { Name= "分类 20", Value= 16 }, 47 | }, 48 | Value = 2237, 49 | }; 50 | 51 | TreemapConfig config1 = new TreemapConfig() 52 | { 53 | ColorField = "name", 54 | }; 55 | 56 | #endregion 示例1 57 | 58 | 59 | public class Data : ITreemapData 60 | { 61 | public string Name { get; set; } 62 | public IEnumerable Children { get; set; } 63 | public int Value { get; set; } 64 | } 65 | 66 | public class TreemapDataItem 67 | { 68 | public string Name { get; set; } 69 | public decimal Value { get; set; } 70 | } 71 | } 72 | 73 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Demos/Violin/Violin_Chart.razor: -------------------------------------------------------------------------------- 1 | @page "/Violin_Chart" 2 | @inject NavigationManager NavigationManager 3 | @inject HttpClient HttpClient 4 | @using Tooltip = AntDesign.Charts.Tooltip 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | @code { 26 | 27 | public IChartComponent Chart; 28 | private DynamicExample _example; 29 | private object[] Data { get; set; } 30 | 31 | private async Task onChart1_FirstRender(IChartComponent chart) 32 | { 33 | var data1 = await DemoData.ViolinDataAsync(NavigationManager, HttpClient); 34 | await chart.ChangeData(data1); 35 | } 36 | 37 | protected override void OnAfterRender(bool firstRender) 38 | { 39 | base.OnAfterRender(firstRender); 40 | _example.Chart = Chart; 41 | } 42 | 43 | #region Basic violin plot 44 | 45 | private readonly ViolinConfig _config1 = new ViolinConfig() 46 | { 47 | Height = 500, 48 | XField = "x", 49 | YField = "y" 50 | }; 51 | 52 | #endregion 53 | 54 | #region Grouped violin plot 55 | 56 | private readonly ViolinConfig _config2 = new ViolinConfig() 57 | { 58 | Height = 500, 59 | XField = "x", 60 | YField = "y", 61 | SeriesField = "species" 62 | }; 63 | 64 | #endregion 65 | 66 | #region Smooth/Hollow violin plot 67 | 68 | private readonly ViolinConfig _config3 = new ViolinConfig() 69 | { 70 | Height = 500, 71 | XField = "x", 72 | YField = "y", 73 | Shape = "hollow-smooth" 74 | }; 75 | 76 | #endregion 77 | 78 | #region Customize tooltip texts 79 | 80 | private readonly ViolinConfig _config4 = new ViolinConfig() 81 | { 82 | Height = 500, 83 | XField = "x", 84 | YField = "y", 85 | SeriesField = "species", 86 | Tooltip = new Tooltip() 87 | { 88 | Fields = new[] {"species", "high", "q1", "q3", "low"} 89 | }, 90 | Meta = @"{ 91 | high: { 92 | alias: '最大值', 93 | formatter: (v) => `${v.toFixed(2)} %`, 94 | }, 95 | low: { 96 | alias: '最小值', 97 | formatter: (v) => `${v.toFixed(2)} %`, 98 | }, 99 | q1: { 100 | alias: '上四分位数', 101 | formatter: (v) => `${v.toFixed(2)} %`, 102 | }, 103 | q3: { 104 | alias: '下四分位数', 105 | formatter: (v) => `${v.toFixed(2)} %`, 106 | }, 107 | species: { 108 | alias: '品类', 109 | }, 110 | }" 111 | }; 112 | 113 | #endregion 114 | 115 | } -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Pages/Index.razor: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Shared/DemoMenuItem.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign.Charts.Docs 2 | { 3 | public class DemoMenuItem 4 | { 5 | public int Order { get; set; } 6 | 7 | public string Title { get; set; } 8 | 9 | public string SubTitle { get; set; } 10 | 11 | public string Type { get; set; } 12 | 13 | public string Url { get; set; } 14 | 15 | public DemoMenuItem[] Children { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Shared/GithubButton.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Star 5 | 6 | @if (_starCount > 0) 7 | { 8 | @_starCount 9 | } 10 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Shared/GithubButton.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Net.Http; 2 | using System.Net.Http.Json; 3 | using System.Text.Json.Serialization; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Components; 6 | 7 | namespace AntDesign.Charts.Docs.Shared 8 | { 9 | public partial class GithubButton 10 | { 11 | private string _org = "ant-design-blazor"; 12 | private string _repo = "ant-design-charts-blazor"; 13 | private int _starCount = 0; 14 | 15 | [Parameter] 16 | public string Responsive { get; set; } 17 | 18 | [Inject] public HttpClient HttpClient { get; set; } 19 | 20 | protected override async Task OnInitializedAsync() 21 | { 22 | try 23 | { 24 | var res = await HttpClient.GetFromJsonAsync($"https://api.github.com/repos/{this._org}/{this._repo}"); 25 | this._starCount = res.StargazersCount; 26 | } 27 | catch 28 | { 29 | } 30 | } 31 | 32 | private class GithubResponse 33 | { 34 | [JsonPropertyName("stargazers_count")] 35 | public int StargazersCount { get; set; } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 | 4 |
5 |
6 | 7 |
8 |
9 | @Body 10 |
11 |
12 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Shared/NavMenu.razor: -------------------------------------------------------------------------------- 1 |  2 | @menuItemTemplate((MenuItems, 1)) 3 | 4 | 5 | 6 | @inject NavigationManager NavigationManager 7 | @inject HttpClient HttpClient 8 | 9 | @code { 10 | 11 | [Parameter] 12 | public bool IsCollapsed { get; set; } 13 | 14 | [Parameter] 15 | public DemoMenuItem[] MenuItems { get; set; } = { }; 16 | 17 | static readonly RenderFragment<(DemoMenuItem[] items, int level)> menuItemTemplate = context => 18 | @; 51 | 52 | protected override async Task OnInitializedAsync() 53 | { 54 | var baseUrl = NavigationManager.ToAbsoluteUri(NavigationManager.BaseUri); 55 | MenuItems = await HttpClient.GetFromJsonAsync(new Uri(baseUrl, "_content/AntDesign.Charts.Docs/menu.json").ToString()); 56 | 57 | StateHasChanged(); 58 | await base.OnInitializedAsync(); 59 | } 60 | } -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/Shared/TopMenu.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | Ant Design Chart Blazor 4 | 5 | 6 | @*
7 | 8 |
*@ 9 |
10 | -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using Microsoft.JSInterop 7 | @using AntDesign.Charts.Docs.Shared 8 | @using AntDesign -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/style/index.less: -------------------------------------------------------------------------------- 1 | @import './github-button.less'; -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/wwwroot/data/jobpaying.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ant-design-blazor/ant-design-charts-blazor/4d190332057bbb7351141f3c71d843aca6053014/src/AntDesign.Charts.Docs/wwwroot/data/jobpaying.json -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/wwwroot/data/revenue.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ant-design-blazor/ant-design-charts-blazor/4d190332057bbb7351141f3c71d843aca6053014/src/AntDesign.Charts.Docs/wwwroot/data/revenue.json -------------------------------------------------------------------------------- /src/AntDesign.Charts.Docs/wwwroot/data/stack-column-data.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "year": "1991", 4 | "value": 3, 5 | "type": "Lon" 6 | }, 7 | { 8 | "year": "1992", 9 | "value": 4, 10 | "type": "Lon" 11 | }, 12 | { 13 | "year": "1993", 14 | "value": 3.5, 15 | "type": "Lon" 16 | }, 17 | { 18 | "year": "1994", 19 | "value": 5, 20 | "type": "Lon" 21 | }, 22 | { 23 | "year": "1995", 24 | "value": 4.9, 25 | "type": "Lon" 26 | }, 27 | { 28 | "year": "1996", 29 | "value": 6, 30 | "type": "Lon" 31 | }, 32 | { 33 | "year": "1997", 34 | "value": 7, 35 | "type": "Lon" 36 | }, 37 | { 38 | "year": "1998", 39 | "value": 9, 40 | "type": "Lon" 41 | }, 42 | { 43 | "year": "1999", 44 | "value": 13, 45 | "type": "Lon" 46 | }, 47 | { 48 | "year": "1991", 49 | "value": 3, 50 | "type": "Bor" 51 | }, 52 | { 53 | "year": "1992", 54 | "value": 4, 55 | "type": "Bor" 56 | }, 57 | { 58 | "year": "1993", 59 | "value": 3.5, 60 | "type": "Bor" 61 | }, 62 | { 63 | "year": "1994", 64 | "value": 5, 65 | "type": "Bor" 66 | }, 67 | { 68 | "year": "1995", 69 | "value": 4.9, 70 | "type": "Bor" 71 | }, 72 | { 73 | "year": "1996", 74 | "value": 6, 75 | "type": "Bor" 76 | }, 77 | { 78 | "year": "1997", 79 | "value": 7, 80 | "type": "Bor" 81 | }, 82 | { 83 | "year": "1998", 84 | "value": 9, 85 | "type": "Bor" 86 | }, 87 | { 88 | "year": "1999", 89 | "value": 13, 90 | "type": "Bor" 91 | } 92 | ] -------------------------------------------------------------------------------- /src/AntDesign.Charts/AntDesign.Charts.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.1;net5.0;net6.0;net7.0;net8.0;net9.0 5 | 3.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Base/ChartEvent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace AntDesign.Charts 6 | { 7 | public class ChartEvent 8 | { 9 | public ChartEvent(IChartComponent sender, System.Text.Json.JsonElement data) 10 | { 11 | Sender = sender; 12 | Data = data; 13 | } 14 | 15 | public IChartComponent Sender { get; set; } 16 | 17 | public System.Text.Json.JsonElement Data { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/Annotation/AnnotationBackgroundCfg.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using OneOf; 3 | 4 | namespace AntDesign.Charts 5 | { 6 | public class AnnotationBackgroundCfg 7 | { 8 | [JsonPropertyName("style")] 9 | public IGraphicStyle Style { get; set; } 10 | [JsonIgnore] 11 | public OneOf Padding { get; set; } 12 | [JsonPropertyName("padding")] 13 | public object PaddingMapping => Padding.Value; 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/Annotation/AnnotationTextCfg.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using OneOf; 3 | 4 | namespace AntDesign.Charts 5 | { 6 | public class AnnotationTextCfg 7 | { 8 | [JsonPropertyName("content")] 9 | public string Content { get; set; } 10 | [JsonPropertyName("autoRotate")] 11 | public bool? AutoRotate { get; set; } 12 | [JsonPropertyName("offsetX")] 13 | public int? OffsetX { get; set; } 14 | [JsonPropertyName("offsetY")] 15 | public int? OffsetY { get; set; } 16 | [JsonPropertyName("style")] 17 | public IGraphicStyle Style { get; set; } 18 | [JsonIgnore] 19 | public OneOf Position { get; set; } 20 | [JsonPropertyName("position")] 21 | public object PositionMapping => Position.Value; 22 | } 23 | } 24 | 25 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/Annotation/ArcAnnotation.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using OneOf; 3 | 4 | namespace AntDesign.Charts 5 | { 6 | public class ArcAnnotation : IAnnotation 7 | { 8 | [JsonPropertyName("type")] 9 | public string Type { get; set; } = Annotation.TypeArc; 10 | [JsonPropertyName("style")] 11 | public IGraphicStyle Style { get; set; } 12 | [JsonIgnore] 13 | public OneOf Start { get; set; } 14 | [JsonPropertyName("start")] 15 | public object StartMapping => Start.Value; 16 | [JsonIgnore] 17 | public OneOf End { get; set; } 18 | [JsonPropertyName("end")] 19 | public object EndMapping => End.Value; 20 | } 21 | } 22 | 23 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/Annotation/DataMarkerAnnotation.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using OneOf; 3 | 4 | namespace AntDesign.Charts 5 | { 6 | public class DataMarkerAnnotation : IAnnotation 7 | { 8 | [JsonPropertyName("type")] 9 | public string Type { get; set; } = Annotation.TypeDataMarker; 10 | [JsonIgnore] 11 | public OneOf Position { get; set; } 12 | [JsonPropertyName("position")] 13 | public object PositionMapping => Position.Value; 14 | [JsonPropertyName("point")] 15 | public DataMarkerPointCfg Point { get; set; } 16 | [JsonPropertyName("line")] 17 | public DataMarkerLineCfg Line { get; set; } 18 | [JsonPropertyName("text")] 19 | public AnnotationTextCfg Text { get; set; } 20 | [JsonPropertyName("autoAdjust")] 21 | public bool? AutoAdjust { get; set; } 22 | [JsonPropertyName("direction")] 23 | public string Direction { get; set; } //todo need checking, incomplete antdesign documentation 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/Annotation/DataMarkerLineCfg.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace AntDesign.Charts 4 | { 5 | public class DataMarkerLineCfg 6 | { 7 | [JsonPropertyName("style")] 8 | public IGraphicStyle Style { get; set; } 9 | [JsonPropertyName("length")] 10 | public int? Length { get; set; } 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/Annotation/DataMarkerPointCfg.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace AntDesign.Charts 4 | { 5 | public class DataMarkerPointCfg 6 | { 7 | [JsonPropertyName("style")] 8 | public IGraphicStyle Style { get; set; } 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/Annotation/DataRegionAnnotation.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using OneOf; 3 | 4 | namespace AntDesign.Charts 5 | { 6 | public class DataRegionAnnotation : IAnnotation 7 | { 8 | [JsonPropertyName("type")] 9 | public string Type { get; set; } = Annotation.TypeDataRegion; 10 | [JsonIgnore] 11 | public OneOf Position { get; set; } 12 | [JsonPropertyName("position")] 13 | public object PositionMapping => Position.Value; 14 | [JsonPropertyName("lineLength")] 15 | public int? LineLength { get; set; } 16 | [JsonPropertyName("region")] 17 | public IStateConfig Region { get; set; } 18 | [JsonPropertyName("text")] 19 | public AnnotationTextCfg Text { get; set; } 20 | [JsonPropertyName("top")] 21 | public bool? Top { get; set; } 22 | [JsonPropertyName("offsetX")] 23 | public int? OffsetX { get; set; } 24 | [JsonPropertyName("offsetY")] 25 | public int? OffsetY { get; set; } 26 | [JsonPropertyName("animate")] 27 | public bool? Animate { get; set; } 28 | [JsonPropertyName("animateOption")] 29 | public IAnimation AnimateOption { get; set; } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/Annotation/HtmlAnnotation.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using OneOf; 3 | 4 | namespace AntDesign.Charts 5 | { 6 | public class HtmlAnnotation : IAnnotation 7 | { 8 | [JsonPropertyName("type")] 9 | public string Type { get; set; } = Annotation.TypeHtml; 10 | [JsonIgnore] 11 | public OneOf Html { get; set; } //todo incomplete/missing example 12 | [JsonPropertyName("htmlContent")] 13 | public object HtmlMapping => Html.Value; 14 | [JsonIgnore] 15 | public OneOf Container { get; set; } //todo incomplete/missing example 16 | [JsonPropertyName("container")] 17 | public object ContainerMapping => Container.Value; 18 | [JsonPropertyName("alignX")] 19 | public string AlignX { get; set; } 20 | [JsonPropertyName("alignY")] 21 | public string AlignY { get; set; } 22 | [JsonPropertyName("offsetX")] 23 | public int? OffsetX { get; set; } 24 | [JsonPropertyName("offsetY")] 25 | public int? OffsetY { get; set; } 26 | } 27 | } 28 | 29 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/Annotation/IAnnotation.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace AntDesign.Charts 4 | { 5 | [JsonDerivedType(typeof(Annotation))] 6 | [JsonDerivedType(typeof(TextAnnotation))] 7 | [JsonDerivedType(typeof(LineAnnotation))] 8 | [JsonDerivedType(typeof(ArcAnnotation))] 9 | [JsonDerivedType(typeof(ImageAnnotation))] 10 | [JsonDerivedType(typeof(RegionAnnotation))] 11 | [JsonDerivedType(typeof(DataMarkerAnnotation))] 12 | [JsonDerivedType(typeof(DataRegionAnnotation))] 13 | [JsonDerivedType(typeof(RegionFilterAnnotation))] 14 | [JsonDerivedType(typeof(HtmlAnnotation))] 15 | [JsonDerivedType(typeof(ShapeAnnotation))] 16 | public interface IAnnotation 17 | { 18 | [JsonPropertyName("type")] 19 | public string Type { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/Annotation/ImageAnnotation.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using OneOf; 3 | 4 | namespace AntDesign.Charts 5 | { 6 | public class ImageAnnotation : IAnnotation 7 | { 8 | [JsonPropertyName("type")] 9 | public string Type { get; set; } = Annotation.TypeImage; 10 | [JsonPropertyName("src")] 11 | public string Src { get; set; } 12 | [JsonPropertyName("style")] 13 | public IGraphicStyle Style { get; set; } 14 | [JsonIgnore] 15 | public OneOf Position { get; set; } 16 | [JsonPropertyName("position")] 17 | public object PositionMapping => Position.Value; 18 | [JsonIgnore] 19 | public OneOf Start { get; set; } 20 | [JsonPropertyName("start")] 21 | public object StartMapping => Start.Value; 22 | [JsonIgnore] 23 | public OneOf End { get; set; } 24 | [JsonPropertyName("end")] 25 | public object EndMapping => End.Value; 26 | [JsonPropertyName("top")] 27 | public bool? Top { get; set; } 28 | [JsonPropertyName("offsetX")] 29 | public int? OffsetX { get; set; } 30 | [JsonPropertyName("offsetY")] 31 | public int? OffsetY { get; set; } 32 | [JsonPropertyName("animate")] 33 | public bool? Animate { get; set; } 34 | [JsonPropertyName("animateOption")] 35 | public IAnimation AnimateOption { get; set; } 36 | } 37 | } -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/Annotation/LineAnnotation.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using OneOf; 3 | 4 | namespace AntDesign.Charts 5 | { 6 | public class LineAnnotation : IAnnotation 7 | { 8 | [JsonPropertyName("type")] 9 | public string Type { get; set; } = Annotation.TypeLine; 10 | [JsonPropertyName("style")] 11 | public IGraphicStyle Style { get; set; } 12 | [JsonIgnore] 13 | public OneOf Start { get; set; } 14 | [JsonPropertyName("start")] 15 | public object StartMapping => Start.Value; 16 | [JsonIgnore] 17 | public OneOf End { get; set; } 18 | [JsonPropertyName("end")] 19 | public object EndMapping => End.Value; 20 | [JsonPropertyName("text")] 21 | public AnnotationTextCfg Text { get; set; } 22 | [JsonPropertyName("top")] 23 | public bool? Top { get; set; } 24 | [JsonPropertyName("offsetX")] 25 | public int? OffsetX { get; set; } 26 | [JsonPropertyName("offsetY")] 27 | public int? OffsetY { get; set; } 28 | [JsonPropertyName("animate")] 29 | public bool? Animate { get; set; } 30 | [JsonPropertyName("animateOption")] 31 | public IAnimation AnimateOption { get; set; } 32 | } 33 | } -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/Annotation/RegionAnnotation.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using OneOf; 3 | 4 | namespace AntDesign.Charts 5 | { 6 | public class RegionAnnotation : IAnnotation 7 | { 8 | [JsonPropertyName("type")] 9 | public string Type { get; set; } = Annotation.TypeRegion; 10 | [JsonPropertyName("style")] 11 | public IGraphicStyle Style { get; set; } 12 | [JsonIgnore] 13 | public OneOf Start { get; set; } 14 | [JsonPropertyName("start")] 15 | public object StartMapping => Start.Value; 16 | [JsonIgnore] 17 | public OneOf End { get; set; } 18 | [JsonPropertyName("end")] 19 | public object EndMapping => End.Value; 20 | [JsonPropertyName("top")] 21 | public bool? Top { get; set; } 22 | [JsonPropertyName("offsetX")] 23 | public int? OffsetX { get; set; } 24 | [JsonPropertyName("offsetY")] 25 | public int? OffsetY { get; set; } 26 | [JsonPropertyName("animate")] 27 | public bool? Animate { get; set; } 28 | [JsonPropertyName("animateOption")] 29 | public IAnimation AnimateOption { get; set; } 30 | } 31 | } -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/Annotation/RegionFilterAnnotation.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using OneOf; 3 | 4 | namespace AntDesign.Charts 5 | { 6 | public class RegionFilterAnnotation : IAnnotation 7 | { 8 | [JsonPropertyName("type")] 9 | public string Type { get; set; } = Annotation.TypeRegionFilter; 10 | [JsonIgnore] 11 | public OneOf Start { get; set; } 12 | [JsonPropertyName("start")] 13 | public object StartMapping => Start.Value; 14 | [JsonIgnore] 15 | public OneOf End { get; set; } 16 | [JsonPropertyName("end")] 17 | public object EndMapping => End.Value; 18 | [JsonPropertyName("style")] 19 | public IGraphicStyle Style { get; set; } 20 | [JsonPropertyName("color")] 21 | public string Color { get; set; } 22 | [JsonPropertyName("apply")] 23 | public string[] Apply { get; set; } 24 | [JsonPropertyName("top")] 25 | public bool? Top { get; set; } 26 | [JsonPropertyName("offsetX")] 27 | public int? OffsetX { get; set; } 28 | [JsonPropertyName("offsetY")] 29 | public int? OffsetY { get; set; } 30 | [JsonPropertyName("animate")] 31 | public bool? Animate { get; set; } 32 | [JsonPropertyName("animateOption")] 33 | public IAnimation AnimateOption { get; set; } 34 | } 35 | } -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/Annotation/ShapeAnnotation.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using OneOf; 3 | 4 | namespace AntDesign.Charts 5 | { 6 | public class ShapeAnnotation : IAnnotation 7 | { 8 | [JsonPropertyName("type")] 9 | public string Type { get; set; } = Annotation.TypeShape; 10 | [JsonIgnore] 11 | public OneOf Render { get; set; }//todo incomplete/missing example 12 | [JsonPropertyName("render")] 13 | public object RenderMapping => Render.Value; 14 | [JsonPropertyName("top")] 15 | public bool? Top { get; set; } 16 | [JsonPropertyName("offsetX")] 17 | public int? OffsetX { get; set; } 18 | [JsonPropertyName("offsetY")] 19 | public int? OffsetY { get; set; } 20 | [JsonPropertyName("animate")] 21 | public bool? Animate { get; set; } 22 | [JsonPropertyName("animateOption")] 23 | public IAnimation AnimateOption { get; set; } 24 | } 25 | } -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/Annotation/TextAnnotation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text.Json.Serialization; 3 | using OneOf; 4 | 5 | namespace AntDesign.Charts 6 | { 7 | public class TextAnnotation : IAnnotation 8 | { 9 | [JsonPropertyName("type")] 10 | public string Type { get; set; } = Annotation.TypeText; 11 | [JsonPropertyName("style")] 12 | public IGraphicStyle Style { get; set; } 13 | [JsonIgnore] 14 | public OneOf Position { get; set; } 15 | [JsonPropertyName("position")] 16 | public object PositionMapping => Position.Value; 17 | [Obsolete("X is not recommended. Use Position instead")] 18 | public int? X { get; set; } 19 | [Obsolete("Y is not recommended. Use Position instead")] 20 | public int? Y { get; set; } 21 | [JsonPropertyName("content")] 22 | public string Content { get; set; } 23 | [JsonPropertyName("rotate")] 24 | public int? Rotate { get; set; } 25 | [JsonPropertyName("offsetX")] 26 | public int? OffsetX { get; set; } 27 | [JsonPropertyName("offsetY")] 28 | public int? OffsetY { get; set; } 29 | [JsonPropertyName("background")] 30 | public AnnotationBackgroundCfg Background { get; set; } 31 | [JsonPropertyName("maxLength")] 32 | public int? MaxLength { get; set; } 33 | [JsonPropertyName("autoEllipsis")] 34 | public bool? AutoEllipsis { get; set; } 35 | [JsonPropertyName("ellipsisPosition")] 36 | public object EllipsisPosition { get; set; } //todo: AntDesign documentation lacking example 37 | [JsonPropertyName("isVertical")] 38 | public bool? IsVertical { get; set; } 39 | } 40 | } -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/ArrowOptions.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace AntDesign.Charts 7 | { 8 | public class ArrowOptions 9 | { 10 | [JsonPropertyName("visible")] 11 | public bool? Visible { get; set; } 12 | [JsonPropertyName("headSize")] 13 | public int? HeadSize { get; set; } 14 | [JsonPropertyName("style")] 15 | public object Style { get; set; }//any 16 | } 17 | } 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/IAnimation.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace AntDesign.Charts 7 | { 8 | public interface IAnimation 9 | { 10 | [JsonPropertyName("appear")] 11 | public AnimationCfg Appear { get; set; } 12 | [JsonPropertyName("enter")] 13 | public AnimationCfg Enter { get; set; } 14 | [JsonPropertyName("update")] 15 | public AnimationCfg Update { get; set; } 16 | [JsonPropertyName("leave")] 17 | public AnimationCfg Leave { get; set; } 18 | // [field: string]: any; 19 | } 20 | 21 | public class AnimationCfg 22 | { 23 | /// 24 | /// 动画模式,延伸or缩放 25 | /// 26 | [JsonPropertyName("type")] 27 | public string Type { get; set; } 28 | [JsonPropertyName("duration")] 29 | public int? Duration { get; set; } 30 | [JsonPropertyName("easing")] 31 | public string Easing { get; set; } 32 | [JsonPropertyName("delay")] 33 | public int? Delay { get; set; } 34 | //callback?: (...args: any[]) => void; 35 | //[field: string]: any; 36 | 37 | 38 | [JsonPropertyName("animation")] 39 | public string Animation { get; set; }//补充 40 | } 41 | 42 | public class Animation : IAnimation 43 | { 44 | [JsonPropertyName("appear")] 45 | public AnimationCfg Appear { get; set; } 46 | [JsonPropertyName("enter")] 47 | public AnimationCfg Enter { get; set; } 48 | [JsonPropertyName("update")] 49 | public AnimationCfg Update { get; set; } 50 | [JsonPropertyName("leave")] 51 | public AnimationCfg Leave { get; set; } 52 | } 53 | } 54 | 55 | 56 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/IBarAutoLabel.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | using OneOf; 6 | 7 | namespace AntDesign.Charts 8 | { 9 | public interface IBarAutoLabel : ILabel 10 | { 11 | /// 12 | /// column-auto 下暗色配置 13 | /// 14 | [JsonPropertyName("darkStyle")] 15 | public TextStyle DarkStyle { get; set; } 16 | /// 17 | /// column-auto 下亮色配置 18 | /// 19 | [JsonPropertyName("lightStyle")] 20 | public TextStyle LightStyle { get; set; } 21 | } 22 | 23 | public class BarAutoLabel : IBarAutoLabel 24 | { 25 | [JsonPropertyName("darkStyle")] 26 | public TextStyle DarkStyle { get; set; } 27 | [JsonPropertyName("lightStyle")] 28 | public TextStyle LightStyle { get; set; } 29 | [JsonPropertyName("visible")] 30 | public bool? Visible { get; set; } 31 | [JsonPropertyName("type")] 32 | public string Type { get; set; } 33 | [JsonPropertyName("precision")] 34 | public int? Precision { get; set; } 35 | [JsonPropertyName("suffix")] 36 | public string Suffix { get; set; } 37 | [JsonPropertyName("style")] 38 | public TextStyle Style { get; set; } 39 | [JsonIgnore] 40 | public OneOf Offset { get; set; } 41 | [JsonPropertyName("offset")] 42 | public object OffsetMapping => Offset.Value; 43 | [JsonPropertyName("offsetX")] 44 | public int? OffsetX { get; set; } 45 | [JsonPropertyName("offsetY")] 46 | public int? OffsetY { get; set; } 47 | [JsonPropertyName("position")] 48 | public string Position { get; set; } 49 | [JsonPropertyName("adjustColor")] 50 | public bool? AdjustColor { get; set; } 51 | [JsonPropertyName("adjustPosition")] 52 | public bool? AdjustPosition { get; set; } 53 | [JsonPropertyName("autoRotate")] 54 | public bool? AutoRotate { get; set; } 55 | [JsonPropertyName("field")] 56 | public string Field { get; set; } 57 | 58 | [JsonPropertyName("formatter")] 59 | public string Formatter { get; set; } 60 | } 61 | } 62 | 63 | 64 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/IBarLabel.cs: -------------------------------------------------------------------------------- 1 | using OneOf; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | using System.Text.Json.Serialization; 6 | 7 | namespace AntDesign.Charts 8 | { 9 | public interface IBarLabel : ILabel 10 | { 11 | public static string PositionLeft = "left"; 12 | public static string PositionMiddle = "middle"; 13 | public static string PositionRight = "right"; 14 | 15 | [JsonPropertyName("layout")] 16 | public LayoutType[] Layout { get; set; } 17 | } 18 | 19 | public class BarLabel : IBarLabel 20 | { 21 | [JsonPropertyName("position")] 22 | public string Position { get; set; } 23 | [JsonPropertyName("adjustPosition")] 24 | public bool? AdjustPosition { get; set; } 25 | [JsonPropertyName("adjustColor")] 26 | public bool? AdjustColor { get; set; } 27 | [JsonPropertyName("visible")] 28 | public bool? Visible { get; set; } 29 | [JsonPropertyName("type")] 30 | public string Type { get; set; } 31 | [JsonPropertyName("precision")] 32 | public int? Precision { get; set; } 33 | [JsonPropertyName("suffix")] 34 | public string Suffix { get; set; } 35 | [JsonPropertyName("style")] 36 | public TextStyle Style { get; set; } 37 | [JsonIgnore] 38 | public OneOf Offset { get; set; } 39 | [JsonPropertyName("offset")] 40 | public object OffsetMapping => Offset.Value; 41 | [JsonPropertyName("offsetX")] 42 | public int? OffsetX { get; set; } 43 | [JsonPropertyName("offsetY")] 44 | public int? OffsetY { get; set; } 45 | [JsonPropertyName("autoRotate")] 46 | public bool? AutoRotate { get; set; } 47 | [JsonPropertyName("field")] 48 | public string Field { get; set; } 49 | [JsonPropertyName("layout")] 50 | public LayoutType[] Layout { get; set; } 51 | 52 | [JsonPropertyName("formatter")] 53 | public string Formatter { get; set; } 54 | } 55 | } 56 | 57 | 58 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/ICatAxis.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace AntDesign.Charts 7 | { 8 | public interface ICatAxis : IBaseAxis 9 | { 10 | } 11 | 12 | public class CatAxis : ICatAxis 13 | { 14 | /// 15 | /// 'cat' 16 | /// 17 | [JsonPropertyName("type")] 18 | public string Type { get; set; } 19 | public static string TypeCat = "cat"; 20 | [JsonPropertyName("visible")] 21 | public bool? Visible { get; set; } 22 | 23 | /// 24 | /// scale 自定义 tickMethod 25 | /// 26 | [JsonPropertyName("tickMethod")] 27 | public string TickMethod { get; set; } 28 | 29 | [JsonPropertyName("tickMethodFunction")] 30 | public string TickMethodFunction { get; set; } 31 | 32 | [JsonPropertyName("line")] 33 | public BaseAxisLine Line { get; set; } 34 | [JsonPropertyName("grid")] 35 | public BaseAxisGrid Grid { get; set; } 36 | [JsonPropertyName("label")] 37 | public BaseAxisLabel Label { get; set; } 38 | [JsonPropertyName("title")] 39 | public BaseAxisTitle Title { get; set; } 40 | [JsonPropertyName("tickLine")] 41 | public BaseAxisTickLine TickLine { get; set; } 42 | [JsonPropertyName("offsetX")] 43 | public int? OffsetX { get; set; } 44 | [JsonPropertyName("offsetY")] 45 | public int? OffsetY { get; set; } 46 | } 47 | } 48 | 49 | 50 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/IConversionTagOptions.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | using OneOf; 6 | 7 | namespace AntDesign.Charts 8 | { 9 | public interface IConversionTagOptions 10 | { 11 | [JsonPropertyName("visible")] 12 | public bool? Visible { get; set; } 13 | [JsonPropertyName("size")] 14 | public int? Size { get; set; } 15 | [JsonPropertyName("spacing")] 16 | public int? Spacing { get; set; } 17 | [JsonIgnore] 18 | public OneOf Offset { get; set; } 19 | [JsonPropertyName("offset")] 20 | public object OffsetMapping => Offset.Value; 21 | [JsonPropertyName("arrow")] 22 | public ArrowOptions Arrow { get; set; } 23 | [JsonPropertyName("value")] 24 | public ValueOptions Value { get; set; } 25 | [JsonPropertyName("animation")] 26 | public OneOf Animation { get; set; }//any 27 | [JsonPropertyName("transpose")] 28 | public bool? Transpose { get; set; } 29 | } 30 | 31 | public class ConversionTagOptions : IConversionTagOptions 32 | { 33 | [JsonPropertyName("visible")] 34 | public bool? Visible { get; set; } 35 | [JsonPropertyName("size")] 36 | public int? Size { get; set; } 37 | [JsonPropertyName("spacing")] 38 | public int? Spacing { get; set; } 39 | [JsonIgnore] 40 | public OneOf Offset { get; set; } 41 | [JsonPropertyName("offset")] 42 | public object OffsetMapping => Offset.Value; 43 | [JsonPropertyName("arrow")] 44 | public ArrowOptions Arrow { get; set; } 45 | [JsonPropertyName("value")] 46 | public ValueOptions Value { get; set; } 47 | [JsonIgnore] 48 | public OneOf Animation { get; set; } 49 | [JsonPropertyName("animation")] 50 | public object AnimationMapping => Animation.Value; 51 | [JsonPropertyName("transpose")] 52 | public bool? Transpose { get; set; } 53 | } 54 | } 55 | 56 | 57 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/IDataItem.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | //using System; 3 | //using System.Collections.Generic; 4 | //using System.Text; 5 | 6 | //namespace AntDesign.Charts 7 | //{ 8 | // public interface IDataItem 9 | // { 10 | // // [field: string]: string | number | number[] | null | undefined; 11 | // } 12 | //} 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/IDescription.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace AntDesign.Charts 7 | { 8 | public interface IDescription 9 | { 10 | [JsonPropertyName("visible")] 11 | public bool? Visible { get; set; } 12 | [JsonPropertyName("text")] 13 | public string Text { get; set; } 14 | [JsonPropertyName("style")] 15 | public TextStyle Style { get; set; } 16 | [JsonPropertyName("alignTo")] 17 | public string AlignTo { get; set; } 18 | } 19 | 20 | public class Description : IDescription 21 | { 22 | [JsonPropertyName("visible")] 23 | public bool? Visible { get; set; } 24 | [JsonPropertyName("text")] 25 | public string Text { get; set; } 26 | [JsonPropertyName("style")] 27 | public TextStyle Style { get; set; } 28 | /// 29 | /// 'left','right','middle' 30 | /// 31 | [JsonPropertyName("alignTo")] 32 | public string AlignTo { get; set; } 33 | public static string AlignToLeft = "left"; 34 | public static string AlignToMiddle = "middle"; 35 | public static string AlignToRight = "right"; 36 | } 37 | } 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/IGraphicStyle.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace AntDesign.Charts 7 | { 8 | [JsonDerivedType(typeof(TextStyle))] 9 | [JsonDerivedType(typeof(LegendMarkerStyle))] 10 | [JsonDerivedType(typeof(GraphicStyle))] 11 | [JsonDerivedType(typeof(GaugeStyle))] 12 | public interface IGraphicStyle 13 | { 14 | [JsonPropertyName("fill")] 15 | public string Fill { get; set; } 16 | [JsonPropertyName("fillOpacity")] 17 | public decimal? FillOpacity { get; set; } 18 | [JsonPropertyName("stroke")] 19 | public string Stroke { get; set; } 20 | [JsonPropertyName("lineWidth")] 21 | public int? LineWidth { get; set; } 22 | [JsonPropertyName("lineDash")] 23 | public int[] LineDash { get; set; } 24 | [JsonPropertyName("lineOpacity")] 25 | public int? LineOpacity { get; set; } 26 | [JsonPropertyName("opacity")] 27 | public double? Opacity { get; set; } 28 | [JsonPropertyName("shadowColor")] 29 | public string ShadowColor { get; set; } 30 | [JsonPropertyName("shadowBlur")] 31 | public int? ShadowBlur { get; set; } 32 | [JsonPropertyName("shadowOffsetX")] 33 | public int? ShadowOffsetX { get; set; } 34 | [JsonPropertyName("shadowOffsetY")] 35 | public int? ShadowOffsetY { get; set; } 36 | [JsonPropertyName("cursor")] 37 | public string Cursor { get; set; } 38 | [JsonPropertyName("width")] 39 | public int? Width { get; set; } 40 | [JsonPropertyName("height")] 41 | public int? Height { get; set; } 42 | // [field: string]: any; 43 | } 44 | 45 | public class GraphicStyle : IGraphicStyle 46 | { 47 | [JsonPropertyName("fill")] 48 | public string Fill { get; set; } 49 | [JsonPropertyName("fillOpacity")] 50 | public decimal? FillOpacity { get; set; } 51 | [JsonPropertyName("stroke")] 52 | public string Stroke { get; set; } 53 | [JsonPropertyName("lineWidth")] 54 | public int? LineWidth { get; set; } 55 | [JsonPropertyName("lineDash")] 56 | public int[] LineDash { get; set; } 57 | [JsonPropertyName("lineOpacity")] 58 | public int? LineOpacity { get; set; } 59 | [JsonPropertyName("opacity")] 60 | public double? Opacity { get; set; } 61 | [JsonPropertyName("shadowColor")] 62 | public string ShadowColor { get; set; } 63 | [JsonPropertyName("shadowBlur")] 64 | public int? ShadowBlur { get; set; } 65 | [JsonPropertyName("shadowOffsetX")] 66 | public int? ShadowOffsetX { get; set; } 67 | [JsonPropertyName("shadowOffsetY")] 68 | public int? ShadowOffsetY { get; set; } 69 | [JsonPropertyName("cursor")] 70 | public string Cursor { get; set; } 71 | [JsonPropertyName("width")] 72 | public int? Width { get; set; } 73 | [JsonPropertyName("height")] 74 | public int? Height { get; set; } 75 | } 76 | } 77 | 78 | 79 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/IGuideLineConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace AntDesign.Charts 7 | { 8 | public interface IGuideLineConfig 9 | { 10 | [JsonPropertyName("type")] 11 | public string Type { get; set; } 12 | [JsonPropertyName("start")] 13 | public object[] Start { get; set; }//any[] 14 | [JsonPropertyName("end")] 15 | public object[] End { get; set; }//any[] 16 | [JsonPropertyName("lineStyle")] 17 | public LineStyle LineStyle { get; set; } 18 | [JsonPropertyName("text")] 19 | public GuideLineConfigText Text { get; set; } 20 | } 21 | 22 | public class GuideLineConfigText 23 | { 24 | /// 25 | /// 'start','center','end' 26 | /// 27 | [JsonPropertyName("position")] 28 | public string Position { get; set; } 29 | public static string PositionStart = "start"; 30 | public static string PositionCenter = "center"; 31 | public static string PositionEnd = "end"; 32 | 33 | [JsonPropertyName("content")] 34 | public string Content { get; set; } 35 | [JsonPropertyName("offsetX")] 36 | public int? OffsetX { get; set; } 37 | [JsonPropertyName("offsetY")] 38 | public int? OffsetY { get; set; } 39 | [JsonPropertyName("style")] 40 | public TextStyle Style { get; set; } 41 | } 42 | 43 | public class GuideLineConfig : IGuideLineConfig 44 | { 45 | [JsonPropertyName("type")] 46 | public string Type { get; set; } 47 | [JsonPropertyName("start")] 48 | public object[] Start { get; set; } 49 | [JsonPropertyName("end")] 50 | public object[] End { get; set; } 51 | [JsonPropertyName("lineStyle")] 52 | public LineStyle LineStyle { get; set; } 53 | [JsonPropertyName("text")] 54 | public GuideLineConfigText Text { get; set; } 55 | } 56 | 57 | } 58 | 59 | 60 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/IInteraction.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace AntDesign.Charts 7 | { 8 | public interface IInteraction 9 | { 10 | [JsonPropertyName("type")] 11 | public string Type { get; set; } 12 | [JsonPropertyName("cfg")] 13 | public object Cfg { get; set; }// [field: string]: any; 14 | [JsonPropertyName("enable")] 15 | public bool? Enable { get; set; } 16 | } 17 | 18 | public class Interaction : IInteraction 19 | { 20 | [JsonPropertyName("type")] 21 | public string Type { get; set; } 22 | [JsonPropertyName("cfg")] 23 | public object Cfg { get; set; } 24 | [JsonPropertyName("enable")] 25 | public bool? Enable { get; set; } 26 | } 27 | 28 | } 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/ILayerConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace AntDesign.Charts 7 | { 8 | public interface ILayerConfig 9 | { /// 10 | /// @ignore 11 | /// 12 | [JsonPropertyName("id")] 13 | public string Id { get; set; } 14 | /// 15 | /// @ignore 16 | /// 17 | [JsonPropertyName("x")] 18 | public int? X { get; set; } 19 | /// 20 | /// @ignore 21 | /// 22 | [JsonPropertyName("y")] 23 | public int? Y { get; set; } 24 | /// 25 | /// layer width 26 | /// 27 | [JsonPropertyName("width")] 28 | public int? Width { get; set; } 29 | /// 30 | /// layer height 31 | /// 32 | [JsonPropertyName("height")] 33 | public int? Height { get; set; } 34 | /// 35 | /// @ignore 36 | /// 37 | [JsonPropertyName("parent")] 38 | public object Parent { get; set; }//any 39 | /// 40 | /// @ignore 41 | /// 42 | [JsonPropertyName("canvas")] 43 | public object Canvas { get; set; }//ICanvas 44 | [JsonPropertyName("name")] 45 | public string Name { get; set; } 46 | } 47 | } 48 | 49 | 50 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/ILegendMarkerStyle.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace AntDesign.Charts 7 | { 8 | public interface ILegendMarkerStyle : IGraphicStyle 9 | { 10 | [JsonPropertyName("r")] 11 | public int? R { get; set; } 12 | } 13 | 14 | public class LegendMarkerStyle : ILegendMarkerStyle 15 | { 16 | [JsonPropertyName("r")] 17 | public int? R { get; set; } 18 | [JsonPropertyName("fill")] 19 | public string Fill { get; set; } 20 | [JsonPropertyName("fillOpacity")] 21 | public decimal? FillOpacity { get; set; } 22 | [JsonPropertyName("stroke")] 23 | public string Stroke { get; set; } 24 | [JsonPropertyName("lineWidth")] 25 | public int? LineWidth { get; set; } 26 | [JsonPropertyName("lineDash")] 27 | public int[] LineDash { get; set; } 28 | [JsonPropertyName("lineOpacity")] 29 | public int? LineOpacity { get; set; } 30 | [JsonPropertyName("opacity")] 31 | public double? Opacity { get; set; } 32 | [JsonPropertyName("shadowColor")] 33 | public string ShadowColor { get; set; } 34 | [JsonPropertyName("shadowBlur")] 35 | public int? ShadowBlur { get; set; } 36 | [JsonPropertyName("shadowOffsetX")] 37 | public int? ShadowOffsetX { get; set; } 38 | [JsonPropertyName("shadowOffsetY")] 39 | public int? ShadowOffsetY { get; set; } 40 | [JsonPropertyName("cursor")] 41 | public string Cursor { get; set; } 42 | [JsonPropertyName("width")] 43 | public int? Width { get; set; } 44 | [JsonPropertyName("height")] 45 | public int? Height { get; set; } 46 | } 47 | } 48 | 49 | 50 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/ILineStyle.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace AntDesign.Charts 7 | { 8 | public interface ILineStyle 9 | { 10 | [JsonPropertyName("stroke")] 11 | public string Stroke { get; set; } 12 | [JsonPropertyName("strokeOpacity")] 13 | public double? StrokeOpacity { get; set; } 14 | [JsonPropertyName("lineWidth")] 15 | public int? LineWidth { get; set; } 16 | [JsonPropertyName("lineDash")] 17 | public int[] LineDash { get; set; } 18 | [Obsolete("No Longer Supported, use strokeOpacity instead")] 19 | [JsonPropertyName("lineOpacity")] 20 | public int? LineOpacity { get; set; } 21 | [JsonPropertyName("shadowColor")] 22 | public string ShadowColor { get; set; } 23 | [JsonPropertyName("shadowBlur")] 24 | public int? ShadowBlur { get; set; } 25 | [JsonPropertyName("shadowOffsetX")] 26 | public int? ShadowOffsetX { get; set; } 27 | [JsonPropertyName("shadowOffsetY")] 28 | public int? ShadowOffsetY { get; set; } 29 | [JsonPropertyName("cursor")] 30 | public string Cursor { get; set; } 31 | // [field: string]: any; 32 | } 33 | 34 | public class LineStyle : ILineStyle 35 | { 36 | [JsonPropertyName("stroke")] 37 | public string Stroke { get; set; } 38 | [JsonPropertyName("strokeOpacity")] 39 | public double? StrokeOpacity { get; set; } 40 | [JsonPropertyName("lineWidth")] 41 | public int? LineWidth { get; set; } 42 | [JsonPropertyName("lineDash")] 43 | public int[] LineDash { get; set; } 44 | [Obsolete("No Longer Supported, use strokeOpacity instead")] 45 | [JsonPropertyName("lineOpacity")] 46 | public int? LineOpacity { get; set; } 47 | [JsonPropertyName("shadowColor")] 48 | public string ShadowColor { get; set; } 49 | [JsonPropertyName("shadowBlur")] 50 | public int? ShadowBlur { get; set; } 51 | [JsonPropertyName("shadowOffsetX")] 52 | public int? ShadowOffsetX { get; set; } 53 | [JsonPropertyName("shadowOffsetY")] 54 | public int? ShadowOffsetY { get; set; } 55 | [JsonPropertyName("cursor")] 56 | public string Cursor { get; set; } 57 | } 58 | } 59 | 60 | 61 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/ILooseMap.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace AntDesign.Charts 7 | { 8 | public interface ILooseMap 9 | { 10 | /* 11 | export interface LooseMap { 12 | [key: string]: T; 13 | } 14 | */ 15 | } 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/IMeta.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace AntDesign.Charts 7 | { 8 | public interface IMeta 9 | { 10 | [JsonPropertyName("alias")] 11 | public string Alias { get; set; } 12 | // formatter?: (v: any) => string; 13 | [JsonPropertyName("values")] 14 | public string[] Values { get; set; } 15 | [JsonPropertyName("range")] 16 | public int[] Range { get; set; } 17 | [JsonPropertyName("type")] 18 | public string Type { get; set; } 19 | 20 | 21 | } 22 | 23 | public class Meta : IMeta 24 | { 25 | [JsonPropertyName("alias")] 26 | public string Alias { get; set; } 27 | [JsonPropertyName("values")] 28 | public string[] Values { get; set; } 29 | [JsonPropertyName("range")] 30 | public int[] Range { get; set; } 31 | /// 32 | /// 'linear','time','timeCat','cat','pow','log' 33 | /// 34 | [JsonPropertyName("type")] 35 | public string Type { get; set; } 36 | public static string TypeLinear = "linear"; 37 | public static string TypeTime = "time"; 38 | public static string TypeTimeCat = "timeCat"; 39 | public static string TypeCat = "cat"; 40 | public static string TypePow = "pow"; 41 | public static string TypeLog = "log"; 42 | } 43 | } 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/IPlotConfig.cs: -------------------------------------------------------------------------------- 1 | using OneOf; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | using System.Text.Json.Serialization; 6 | 7 | 8 | namespace AntDesign.Charts 9 | { 10 | public interface IPlotConfig 11 | { 12 | [JsonIgnore] 13 | [Obsolete("No longer supported, use autoFit instead")] 14 | public bool? ForceFit { get; set; } 15 | [JsonPropertyName("width")] 16 | public int? Width { get; set; } 17 | [JsonPropertyName("renderer")] 18 | public string Renderer { get; set; } 19 | [JsonPropertyName("height")] 20 | public int? Height { get; set; } 21 | [JsonPropertyName("pixelRatio")] 22 | public int? PixelRatio { get; set; } 23 | public OneOf Theme { get; set; }//OneOf LooseMap: [key: string]: T; 24 | [JsonPropertyName("localRefresh")] 25 | public bool? LocalRefresh { get; set; } 26 | } 27 | 28 | } 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/IRangeBarLabelConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace AntDesign.Charts 7 | { 8 | public interface IRangeBarLabelConfig 9 | { 10 | [JsonPropertyName("visible")] 11 | public bool? Visible { get; set; } 12 | [JsonPropertyName("position")] 13 | public string Position { get; set; } 14 | // formatter?: (...args: any[]) => string; 15 | 16 | 17 | [JsonPropertyName("offsetX")] 18 | public int? OffsetX { get; set; } 19 | [JsonPropertyName("offsetY")] 20 | public int? OffsetY { get; set; } 21 | [JsonPropertyName("style")] 22 | public object Style { get; set; } 23 | [JsonPropertyName("leftStyle")] 24 | public object LeftStyle { get; set; } 25 | [JsonPropertyName("rightStyle")] 26 | public object RightStyle { get; set; } 27 | [JsonPropertyName("adjustColor")] 28 | public bool? AdjustColor { get; set; } 29 | [JsonPropertyName("adjustPosition")] 30 | public bool? AdjustPosition { get; set; } 31 | } 32 | 33 | public class RangeBarLabelConfig : IRangeBarLabelConfig 34 | { 35 | [JsonPropertyName("visible")] 36 | public bool? Visible { get; set; } 37 | /// 38 | /// 'outer','inner' 39 | /// 40 | [JsonPropertyName("position")] 41 | public string Position { get; set; } 42 | public static string PositionOuter = "outer"; 43 | public static string PositionInner = "inner"; 44 | [JsonPropertyName("offsetX")] 45 | public int? OffsetX { get; set; } 46 | [JsonPropertyName("offsetY")] 47 | public int? OffsetY { get; set; } 48 | [JsonPropertyName("style")] 49 | public object Style { get; set; } 50 | [JsonPropertyName("leftStyle")] 51 | public object LeftStyle { get; set; } 52 | [JsonPropertyName("rightStyle")] 53 | public object RightStyle { get; set; } 54 | [JsonPropertyName("adjustColor")] 55 | public bool? AdjustColor { get; set; } 56 | [JsonPropertyName("adjustPosition")] 57 | public bool? AdjustPosition { get; set; } 58 | } 59 | } 60 | 61 | 62 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/IScrollbar.cs: -------------------------------------------------------------------------------- 1 | using OneOf; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | using System.Text.Json.Serialization; 6 | 7 | namespace AntDesign.Charts 8 | { 9 | public interface IScrollbar 10 | { 11 | /// 12 | /// 'horizontal', 'vertical' 13 | /// 14 | [JsonPropertyName("type")] 15 | public string Type { get; set; } 16 | [JsonPropertyName("width")] 17 | public int? Width { get; set; } 18 | [JsonPropertyName("height")] 19 | public int? Height { get; set; } 20 | [JsonIgnore] 21 | public OneOf Padding { get; set; } 22 | [JsonPropertyName("padding")] 23 | public object PaddingMapping => Padding.Value; 24 | [JsonPropertyName("categorySize")] 25 | public int? CategorySize { get; set; } 26 | [JsonPropertyName("style")] 27 | public bool? Animate { get; set; } 28 | [JsonPropertyName("animate")] 29 | public ScrollbarStyle Style { get; set; } 30 | } 31 | 32 | public class Scrollbar : IScrollbar 33 | { 34 | /// 35 | /// 'horizontal', 'vertical' 36 | /// 37 | [JsonPropertyName("type")] 38 | public string Type { get; set; } 39 | [JsonPropertyName("width")] 40 | public int? Width { get; set; } 41 | [JsonPropertyName("height")] 42 | public int? Height{ get; set; } 43 | [JsonIgnore] 44 | public OneOf Padding { get; set; } 45 | [JsonPropertyName("padding")] 46 | public object PaddingMapping => Padding.Value; 47 | [JsonPropertyName("categorySize")] 48 | public int? CategorySize { get; set; } 49 | [JsonPropertyName("style")] 50 | public bool? Animate { get; set; } 51 | [JsonPropertyName("animate")] 52 | public ScrollbarStyle Style { get; set; } 53 | } 54 | 55 | public class ScrollbarStyle 56 | { 57 | [JsonPropertyName("trackColor")] 58 | public string TrackColor { get; set; } 59 | [JsonPropertyName("thumbColor")] 60 | public string ThumbColor { get; set; } 61 | [JsonPropertyName("thumbHighlightColor")] 62 | public string ThumbHighlightColor { get; set; } 63 | [JsonPropertyName("lineCap")] 64 | public string LineCap { get; set; } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/IStateConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace AntDesign.Charts 7 | { 8 | public interface IStateConfig 9 | { 10 | // condition: () => any | StateCondition; 11 | [JsonPropertyName("style")] 12 | public GraphicStyle Style { get; set; } 13 | [JsonPropertyName("related")] 14 | public string[] Related { get; set; } 15 | } 16 | 17 | public class StateConfig : IStateConfig 18 | { 19 | [JsonPropertyName("style")] 20 | public GraphicStyle Style { get; set; } 21 | [JsonPropertyName("related")] 22 | public string[] Related { get; set; } 23 | } 24 | } 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/ITimeAxis.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace AntDesign.Charts 7 | { 8 | public interface ITimeAxis 9 | { 10 | [JsonPropertyName("type")] 11 | public string Type { get; set; }// 'time' 12 | /// 13 | /// tick相关配置 14 | /// 15 | [JsonPropertyName("tickInterval")] 16 | public string TickInterval { get; set; } 17 | [JsonPropertyName("tickCount")] 18 | public int? TickCount { get; set; } 19 | [JsonPropertyName("mask")] 20 | public string Mask { get; set; } 21 | } 22 | } 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/ITitle.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace AntDesign.Charts 7 | { 8 | public interface ITitle 9 | { 10 | [JsonPropertyName("visible")] 11 | public bool? Visible { get; set; } 12 | [JsonPropertyName("text")] 13 | public string Text { get; set; } 14 | [JsonPropertyName("style")] 15 | public TextStyle Style { get; set; } 16 | [JsonPropertyName("alignTo")] 17 | public string AlignTo { get; set; } 18 | 19 | 20 | } 21 | 22 | public class Title : ITitle 23 | { 24 | [JsonPropertyName("visible")] 25 | public bool? Visible { get; set; } 26 | [JsonPropertyName("text")] 27 | public string Text { get; set; } 28 | [JsonPropertyName("style")] 29 | public TextStyle Style { get; set; } 30 | /// 31 | /// 'left','right','middle' 32 | /// 33 | [JsonPropertyName("alignTo")] 34 | public string AlignTo { get; set; } 35 | public static string AlignToLeft = "left"; 36 | public static string AlignToMiddle = "middle"; 37 | public static string AlignToRight = "right"; 38 | } 39 | } 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/IValueAxis.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Text.Json.Serialization; 5 | 6 | namespace AntDesign.Charts 7 | { 8 | public interface IValueAxis : IBaseAxis 9 | { 10 | /// 11 | /// tick相关配置 12 | /// 13 | [JsonPropertyName("nice")] 14 | public bool? Nice { get; set; } 15 | [JsonPropertyName("min")] 16 | public double? Min { get; set; } 17 | [JsonPropertyName("max")] 18 | public double? Max { get; set; } 19 | [JsonPropertyName("minLimit")] 20 | public int? MinLimit { get; set; } 21 | [JsonPropertyName("maxLimit")] 22 | public int? MaxLimit { get; set; } 23 | [JsonPropertyName("tickCount")] 24 | public int? TickCount { get; set; } 25 | [JsonPropertyName("tickInterval")] 26 | public int? TickInterval { get; set; } 27 | /// 28 | /// pow 指数 29 | /// 30 | [JsonPropertyName("exponent")] 31 | public int? Exponent { get; set; } 32 | /// 33 | /// log 基数 34 | /// 35 | [JsonPropertyName("base")] 36 | public int? Base { get; set; } 37 | 38 | } 39 | 40 | public class ValueAxis : IValueAxis 41 | { 42 | /// 43 | /// 'linear' , 'pow' , 'log' 44 | /// 45 | [JsonPropertyName("type")] 46 | public string Type { get; set; } 47 | public static string TypeLinear = "linear"; 48 | public static string TypePow = "pow"; 49 | public static string TypeLog = "log"; 50 | 51 | [JsonPropertyName("nice")] 52 | public bool? Nice { get; set; } 53 | [JsonPropertyName("min")] 54 | public double? Min { get; set; } 55 | [JsonPropertyName("max")] 56 | public double? Max { get; set; } 57 | [JsonPropertyName("minLimit")] 58 | public int? MinLimit { get; set; } 59 | [JsonPropertyName("maxLimit")] 60 | public int? MaxLimit { get; set; } 61 | [JsonPropertyName("tickCount")] 62 | public int? TickCount { get; set; } 63 | [JsonPropertyName("tickInterval")] 64 | public int? TickInterval { get; set; } 65 | [JsonPropertyName("exponent")] 66 | public int? Exponent { get; set; } 67 | [JsonPropertyName("base")] 68 | public int? Base { get; set; } 69 | [JsonPropertyName("visible")] 70 | public bool? Visible { get; set; } 71 | 72 | /// 73 | /// scale 自定义 tickMethod 74 | /// 75 | [JsonPropertyName("tickMethod")] 76 | public string TickMethod { get; set; } 77 | 78 | [JsonPropertyName("tickMethodFunction")] 79 | public string TickMethodFunction { get; set; }//OneOf number[])> 80 | [JsonPropertyName("line")] 81 | public BaseAxisLine Line { get; set; } 82 | [JsonPropertyName("grid")] 83 | public BaseAxisGrid Grid { get; set; } 84 | [JsonPropertyName("label")] 85 | public BaseAxisLabel Label { get; set; } 86 | [JsonPropertyName("title")] 87 | public BaseAxisTitle Title { get; set; } 88 | [JsonPropertyName("tickLine")] 89 | public BaseAxisTickLine TickLine { get; set; } 90 | } 91 | } 92 | 93 | 94 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/Label.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | using OneOf; 6 | 7 | namespace AntDesign.Charts 8 | { 9 | public interface ILabel 10 | { 11 | [JsonPropertyName("visible")] 12 | public bool? Visible { get; set; } 13 | [JsonPropertyName("type")] 14 | public string Type { get; set; } 15 | /// 16 | /// 精度配置,可通过自定义精度来固定数值类型 label 格式 17 | /// 18 | [JsonPropertyName("precision")] 19 | public int? Precision { get; set; } 20 | /// 21 | /// 添加后缀 22 | /// 23 | [JsonPropertyName("suffix")] 24 | public string Suffix { get; set; } 25 | [JsonPropertyName("style")] 26 | public TextStyle Style { get; set; } 27 | [JsonPropertyName("offset")] 28 | public OneOf Offset { get; set; } 29 | [JsonPropertyName("offsetX")] 30 | public int? OffsetX { get; set; } 31 | [JsonPropertyName("offsetY")] 32 | public int? OffsetY { get; set; } 33 | [JsonPropertyName("position")] 34 | public string Position { get; set; } 35 | [JsonPropertyName("adjustColor")] 36 | public bool? AdjustColor { get; set; } 37 | [JsonPropertyName("adjustPosition")] 38 | public bool? AdjustPosition { get; set; } 39 | [JsonPropertyName("autoRotate")] 40 | public bool? AutoRotate { get; set; } 41 | /// 42 | /// 标签对应字段 43 | /// 44 | [JsonPropertyName("field")] 45 | public string Field { get; set; } 46 | 47 | [JsonPropertyName("formatter")] 48 | public string Formatter { get; set; } 49 | } 50 | 51 | public class Label : ILabel 52 | { 53 | [JsonPropertyName("visible")] 54 | public bool? Visible { get; set; } 55 | [JsonPropertyName("type")] 56 | public string Type { get; set; } 57 | [JsonPropertyName("precision")] 58 | public int? Precision { get; set; } 59 | [JsonPropertyName("suffix")] 60 | public string Suffix { get; set; } 61 | [JsonPropertyName("style")] 62 | public TextStyle Style { get; set; } 63 | [JsonIgnore] 64 | public OneOf Offset { get; set; } 65 | [JsonPropertyName("offset")] 66 | public object OffsetMapping => Offset.Value; 67 | [JsonPropertyName("offsetX")] 68 | public int? OffsetX { get; set; } 69 | [JsonPropertyName("offsetY")] 70 | public int? OffsetY { get; set; } 71 | [JsonPropertyName("position")] 72 | public string Position { get; set; } 73 | [JsonPropertyName("adjustColor")] 74 | public bool? AdjustColor { get; set; } 75 | [JsonPropertyName("adjustPosition")] 76 | public bool? AdjustPosition { get; set; } 77 | [JsonPropertyName("autoRotate")] 78 | public bool? AutoRotate { get; set; } 79 | [JsonPropertyName("field")] 80 | public string Field { get; set; } 81 | 82 | [JsonPropertyName("text")] 83 | public string[] Text { get; set; } 84 | 85 | [JsonPropertyName("formatter")] 86 | public string Formatter { get; set; } 87 | } 88 | } 89 | 90 | 91 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/ValueCatTimeAxis.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace AntDesign.Charts 7 | { 8 | public class ValueCatTimeAxis : IValueAxis, ICatAxis, ITimeAxis 9 | { 10 | [JsonPropertyName("type")] 11 | public string Type { get; set; } 12 | [JsonPropertyName("nice")] 13 | public bool? Nice { get; set; } 14 | [JsonPropertyName("min")] 15 | public double? Min { get; set; } 16 | [JsonPropertyName("max")] 17 | public double? Max { get; set; } 18 | [JsonPropertyName("minLimit")] 19 | public int? MinLimit { get; set; } 20 | [JsonPropertyName("maxLimit")] 21 | public int? MaxLimit { get; set; } 22 | [JsonPropertyName("tickCount")] 23 | public int? TickCount { get; set; } 24 | [JsonPropertyName("tickInterval")] 25 | public int? TickInterval { get; set; } 26 | [JsonPropertyName("exponent")] 27 | public int? Exponent { get; set; } 28 | public int? Base { get; set; } 29 | [JsonPropertyName("visible")] 30 | public bool? Visible { get; set; } 31 | 32 | /// 33 | /// scale 自定义 tickMethod 34 | /// 35 | [JsonPropertyName("tickMethod")] 36 | public string TickMethod { get; set; } 37 | 38 | [JsonPropertyName("tickMethodFunction")] 39 | public string TickMethodFunction { get; set; } 40 | [JsonPropertyName("line")] 41 | public BaseAxisLine Line { get; set; } 42 | [JsonPropertyName("grid")] 43 | public BaseAxisGrid Grid { get; set; } 44 | [JsonPropertyName("label")] 45 | public BaseAxisLabel Label { get; set; } 46 | [JsonPropertyName("title")] 47 | public BaseAxisTitle Title { get; set; } 48 | [JsonPropertyName("tickLine")] 49 | public BaseAxisTickLine TickLine { get; set; } 50 | [JsonPropertyName("mask")] 51 | public string Mask { get; set; } 52 | string ITimeAxis.TickInterval { get; set; } 53 | 54 | [JsonPropertyName("range")] 55 | public int[]? Range { get; set; } 56 | } 57 | } 58 | 59 | 60 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/ValueOptions.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace AntDesign.Charts 4 | { 5 | public class ValueOptions 6 | { 7 | [JsonPropertyName("visible")] 8 | public bool? Visible { get; set; } 9 | [JsonPropertyName("style")] 10 | public object Style { get; set; }//any 11 | // formatter?: (valueUpper: any, valueLower: any) => string; 12 | } 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Configs/ValueTimeAxis.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace AntDesign.Charts 7 | { 8 | public class ValueTimeAxis : IValueAxis, ITimeAxis 9 | { 10 | [JsonPropertyName("type")] 11 | public string Type { get; set; } 12 | [JsonPropertyName("nice")] 13 | public bool? Nice { get; set; } 14 | [JsonPropertyName("min")] 15 | public double? Min { get; set; } 16 | [JsonPropertyName("max")] 17 | public double? Max { get; set; } 18 | [JsonPropertyName("minLimit")] 19 | public int? MinLimit { get; set; } 20 | [JsonPropertyName("maxLimit")] 21 | public int? MaxLimit { get; set; } 22 | [JsonPropertyName("tickCount")] 23 | public int? TickCount { get; set; } 24 | [JsonPropertyName("tickInterval")] 25 | public int? TickInterval { get; set; } 26 | [JsonPropertyName("exponent")] 27 | public int? Exponent { get; set; } 28 | public int? Base { get; set; } 29 | [JsonPropertyName("visible")] 30 | public bool? Visible { get; set; } 31 | [JsonPropertyName("tickMethod")] 32 | public string TickMethod { get; set; } 33 | [JsonPropertyName("tickMethodFunction")] 34 | public string TickMethodFunction { get; set; } 35 | [JsonPropertyName("line")] 36 | public BaseAxisLine Line { get; set; } 37 | [JsonPropertyName("grid")] 38 | public BaseAxisGrid Grid { get; set; } 39 | [JsonPropertyName("label")] 40 | public BaseAxisLabel Label { get; set; } 41 | [JsonPropertyName("title")] 42 | public BaseAxisTitle Title { get; set; } 43 | [JsonPropertyName("tickLine")] 44 | public BaseAxisTickLine TickLine { get; set; } 45 | [JsonPropertyName("mask")] 46 | public string Mask { get; set; } 47 | string ITimeAxis.TickInterval { get; set; } 48 | } 49 | } 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Area/Area.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesign.Charts 2 | 3 | @inherits ChartComponentBase 4 | 5 |
-------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Area/Area.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using Microsoft.AspNetCore.Components; 3 | using Microsoft.JSInterop; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | 7 | namespace AntDesign.Charts 8 | { 9 | public partial class Area : ChartComponentBase 10 | { 11 | public Area() : base("Area") 12 | { 13 | 14 | } 15 | } 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Bar/Bar.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesign.Charts 2 | 3 | @inherits ChartComponentBase 4 | 5 |
-------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Bar/Bar.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using Microsoft.AspNetCore.Components; 3 | using Microsoft.JSInterop; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | using System.Text.Json; 8 | using System.Threading.Tasks; 9 | 10 | namespace AntDesign.Charts 11 | { 12 | public partial class Bar : ChartComponentBase 13 | { 14 | public Bar() : base("Bar") 15 | { 16 | 17 | } 18 | } 19 | } 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Bar/IBarViewConfig.cs: -------------------------------------------------------------------------------- 1 | using OneOf; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | using System.Text.Json.Serialization; 6 | 7 | namespace AntDesign.Charts 8 | { 9 | public interface IBarViewConfig : IViewConfig 10 | { 11 | [JsonPropertyName("colorField")] 12 | public string ColorField { get; set; } 13 | [JsonPropertyName("barSize")] 14 | public int? BarSize { get; set; } 15 | [JsonPropertyName("barStyle")] 16 | public GraphicStyle BarStyle { get; set; }//OneOf GraphicStyle)> 17 | [JsonPropertyName("xAxis")] 18 | public new ValueAxis XAxis { get; set; } 19 | [JsonPropertyName("yAxis")] 20 | public new CatAxis YAxis { get; set; } 21 | [JsonPropertyName("label")] 22 | public new BarViewConfigLabel Label { get; set; }//OneOf 23 | [JsonPropertyName("conversionTag")] 24 | public ConversionTagOptions ConversionTag { get; set; } 25 | [JsonPropertyName("scrollbar")] 26 | public IScrollbar Scrollbar { get; set; } 27 | [JsonPropertyName("slider")] 28 | public ISlider Slider { get; set; } 29 | [JsonPropertyName("isStack")] 30 | public bool? IsStack { get; set; } 31 | [JsonPropertyName("isRange")] 32 | public bool? IsRange { get; set; } 33 | [JsonPropertyName("isPercent")] 34 | public bool? IsPercent { get; set; } 35 | } 36 | 37 | public class BarViewConfigLabel : IBarLabel, IBarAutoLabel 38 | { 39 | [JsonPropertyName("darkStyle")] 40 | public TextStyle DarkStyle { get; set; } 41 | [JsonPropertyName("lightStyle")] 42 | public TextStyle LightStyle { get; set; } 43 | [JsonPropertyName("visible")] 44 | public bool? Visible { get; set; } 45 | [JsonPropertyName("type")] 46 | public string Type { get; set; } 47 | [JsonPropertyName("precision")] 48 | public int? Precision { get; set; } 49 | [JsonPropertyName("suffix")] 50 | public string Suffix { get; set; } 51 | [JsonPropertyName("style")] 52 | public TextStyle Style { get; set; } 53 | [JsonIgnore] 54 | public OneOf Offset { get; set; } 55 | [JsonPropertyName("offset")] 56 | public object OffsetMapping => Offset.Value; 57 | [JsonPropertyName("offsetX")] 58 | public int? OffsetX { get; set; } 59 | [JsonPropertyName("offsetY")] 60 | public int? OffsetY { get; set; } 61 | [JsonPropertyName("position")] 62 | public string Position { get; set; } 63 | [JsonPropertyName("adjustColor")] 64 | public bool? AdjustColor { get; set; } 65 | [JsonPropertyName("adjustPosition")] 66 | public bool? AdjustPosition { get; set; } 67 | [JsonPropertyName("autoRotate")] 68 | public bool? AutoRotate { get; set; } 69 | [JsonPropertyName("field")] 70 | public string Field { get; set; } 71 | [JsonPropertyName("layout")] 72 | public LayoutType[] Layout { get; set; } 73 | 74 | [JsonPropertyName("formatter")] 75 | public string Formatter { get; set; } 76 | } 77 | } 78 | 79 | 80 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Box/Box.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesign.Charts 2 | 3 | @inherits ChartComponentBase 4 | 5 |
-------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Box/Box.razor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace AntDesign.Charts 8 | { 9 | public partial class Box : ChartComponentBase 10 | { 11 | public Box() : base("Box") 12 | { 13 | 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Bullet/Bullet.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesign.Charts 2 | 3 | @inherits ChartComponentBase 4 | 5 |
-------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Bullet/Bullet.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using Microsoft.AspNetCore.Components; 3 | using Microsoft.JSInterop; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | 7 | namespace AntDesign.Charts 8 | { 9 | public partial class Bullet : ChartComponentBase 10 | { 11 | public Bullet() : base("Bullet", isNoDataRender: true) 12 | { 13 | 14 | } 15 | } 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Column/Column.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesign.Charts 2 | 3 | @inherits ChartComponentBase 4 | 5 |
-------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Column/Column.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using Microsoft.AspNetCore.Components; 3 | using Microsoft.JSInterop; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | 7 | namespace AntDesign.Charts 8 | { 9 | public partial class Column : ChartComponentBase 10 | { 11 | public Column() : base("Column") 12 | { 13 | 14 | } 15 | } 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/DensityHeatmap/DensityHeatmap.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesign.Charts 2 | 3 | @inherits ChartComponentBase 4 | 5 |
-------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/DensityHeatmap/DensityHeatmap.razor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text.Json.Serialization; 3 | using Microsoft.AspNetCore.Components; 4 | using Microsoft.JSInterop; 5 | using System.Collections.Generic; 6 | using System.Threading.Tasks; 7 | 8 | namespace AntDesign.Charts 9 | { 10 | [Obsolete("No longer supported, use HeatMap Instead")] 11 | public partial class DensityHeatmap : ChartComponentBase 12 | { 13 | public DensityHeatmap() : base("DensityHeatmap") 14 | { 15 | 16 | } 17 | } 18 | } 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/DualAxes/DualAxes.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesign.Charts 2 | 3 | @inherits ChartComponentBase 4 | 5 |
-------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/DualAxes/DualAxes.razor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace AntDesign.Charts 8 | { 9 | public partial class DualAxes : ChartComponentBase 10 | { 11 | public DualAxes() : base("DualAxes") 12 | { 13 | 14 | } 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Funnel/Funnel.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesign.Charts 2 | 3 | @inherits ChartComponentBase 4 | 5 |
-------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Funnel/Funnel.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using Microsoft.AspNetCore.Components; 3 | using Microsoft.JSInterop; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | 7 | namespace AntDesign.Charts 8 | { 9 | public partial class Funnel : ChartComponentBase 10 | { 11 | public Funnel() : base("Funnel") 12 | { 13 | 14 | } 15 | } 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Gauge/Gauge.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesign.Charts 2 | 3 | @inherits ChartComponentBase 4 | 5 |
-------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Gauge/Gauge.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using Microsoft.AspNetCore.Components; 3 | using Microsoft.JSInterop; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | 7 | namespace AntDesign.Charts 8 | { 9 | public partial class Gauge : ChartComponentBase 10 | { 11 | public Gauge() : base("Gauge",isNoDataRender:true) 12 | { 13 | 14 | } 15 | } 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Heatmap/Heatmap.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesign.Charts 2 | 3 | @inherits ChartComponentBase 4 | 5 |
-------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Heatmap/Heatmap.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using Microsoft.AspNetCore.Components; 3 | using Microsoft.JSInterop; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | 7 | namespace AntDesign.Charts 8 | { 9 | public partial class Heatmap : ChartComponentBase 10 | { 11 | public Heatmap() : base("Heatmap") 12 | { 13 | 14 | } 15 | } 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Histogram/Histogram.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesign.Charts 2 | 3 | @inherits ChartComponentBase 4 | 5 |
-------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Histogram/Histogram.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using Microsoft.AspNetCore.Components; 3 | using Microsoft.JSInterop; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | 7 | namespace AntDesign.Charts 8 | { 9 | public partial class Histogram : ChartComponentBase 10 | { 11 | public Histogram() : base("Histogram") 12 | { 13 | 14 | } 15 | } 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Line/Line.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesign.Charts 2 | 3 | @inherits ChartComponentBase 4 | 5 | 6 |
-------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Line/Line.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using Microsoft.AspNetCore.Components; 3 | using Microsoft.JSInterop; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | 7 | namespace AntDesign.Charts 8 | { 9 | public partial class Line : ChartComponentBase 10 | { 11 | public Line() : base("Line") 12 | { 13 | 14 | } 15 | } 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Liquid/Liquid.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesign.Charts 2 | 3 | @inherits ChartComponentBase 4 | 5 |
-------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Liquid/Liquid.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using Microsoft.AspNetCore.Components; 3 | using Microsoft.JSInterop; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | 7 | namespace AntDesign.Charts 8 | { 9 | public partial class Liquid : ChartComponentBase 10 | { 11 | public Liquid() : base("Liquid",isNoDataRender:true) 12 | { 13 | } 14 | } 15 | } 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Pie/Pie.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesign.Charts 2 | 3 | @inherits ChartComponentBase 4 | 5 |
-------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Pie/Pie.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using Microsoft.AspNetCore.Components; 3 | using Microsoft.JSInterop; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | 7 | namespace AntDesign.Charts 8 | { 9 | public partial class Pie : ChartComponentBase 10 | { 11 | public Pie() : base("Pie") 12 | { 13 | 14 | } 15 | } 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Radar/Radar.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesign.Charts 2 | 3 | @inherits ChartComponentBase 4 | 5 |
-------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Radar/Radar.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using Microsoft.AspNetCore.Components; 3 | using Microsoft.JSInterop; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | 7 | namespace AntDesign.Charts 8 | { 9 | public partial class Radar : ChartComponentBase 10 | { 11 | public Radar() : base("Radar") 12 | { 13 | 14 | } 15 | } 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Rose/Rose.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesign.Charts 2 | 3 | @inherits ChartComponentBase 4 | 5 |
-------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Rose/Rose.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using Microsoft.AspNetCore.Components; 3 | using Microsoft.JSInterop; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | 7 | namespace AntDesign.Charts 8 | { 9 | public partial class Rose : ChartComponentBase 10 | { 11 | public Rose() : base("Rose") 12 | { 13 | 14 | } 15 | } 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Scatter/Scatter.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesign.Charts 2 | 3 | @inherits ChartComponentBase 4 | 5 |
-------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Scatter/Scatter.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using Microsoft.AspNetCore.Components; 3 | using Microsoft.JSInterop; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | 7 | namespace AntDesign.Charts 8 | { 9 | public partial class Scatter : ChartComponentBase 10 | { 11 | public Scatter() : base("Scatter") 12 | { 13 | 14 | } 15 | } 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Stock/Stock.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesign.Charts 2 | 3 | @inherits ChartComponentBase 4 | 5 |
-------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Stock/Stock.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using Microsoft.AspNetCore.Components; 3 | using Microsoft.JSInterop; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | 7 | namespace AntDesign.Charts 8 | { 9 | public partial class Stock : ChartComponentBase 10 | { 11 | public Stock() : base("Stock") 12 | { 13 | 14 | } 15 | } 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Treemap/ITreemapData.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace AntDesign.Charts 7 | { 8 | public interface ITreemapData 9 | { 10 | public IEnumerable Children { get; set; } 11 | /// 12 | /// 所有Children的Value合计 13 | /// 14 | public int Value { get; set; } 15 | } 16 | 17 | 18 | 19 | 20 | } 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Treemap/Treemap.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesign.Charts 2 | 3 | @inherits ChartComponentBase 4 | 5 |
-------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Treemap/Treemap.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using Microsoft.AspNetCore.Components; 3 | using Microsoft.JSInterop; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | 7 | namespace AntDesign.Charts 8 | { 9 | public partial class Treemap : ChartComponentBase 10 | { 11 | public Treemap() : base("Treemap") 12 | { 13 | 14 | } 15 | } 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Violin/Violin.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesign.Charts 2 | 3 | @inherits ChartComponentBase 4 | 5 |
-------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Violin/Violin.razor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace AntDesign.Charts 8 | { 9 | public partial class Violin : ChartComponentBase 10 | { 11 | public Violin() : base("Violin") 12 | { 13 | 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Waterfall/Waterfall.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesign.Charts 2 | 3 | @inherits ChartComponentBase 4 | 5 |
-------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Plots/Waterfall/Waterfall.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using Microsoft.AspNetCore.Components; 3 | using Microsoft.JSInterop; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | 7 | namespace AntDesign.Charts 8 | { 9 | public partial class Waterfall : ChartComponentBase 10 | { 11 | public Waterfall() : base("Waterfall") 12 | { 13 | 14 | } 15 | } 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Sparkline/Progress/Progress.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesign.Charts 2 | 3 | @inherits ChartComponentBase 4 | 5 |
-------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Sparkline/Progress/Progress.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using Microsoft.AspNetCore.Components; 3 | using Microsoft.JSInterop; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | 7 | namespace AntDesign.Charts 8 | { 9 | public partial class Progress : ChartComponentBase 10 | { 11 | public Progress() : base("Progress") 12 | { 13 | 14 | } 15 | 16 | protected override void SetIViewConfig(IViewConfig config) 17 | { 18 | base.SetIViewConfig(config); 19 | 20 | ((ProgressConfig)config).Percent = (double?)Data; 21 | } 22 | } 23 | } 24 | 25 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Sparkline/RingProgress/RingProgress.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesign.Charts 2 | @inherits ChartComponentBase 3 | 4 |
-------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Sparkline/RingProgress/RingProgress.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using Microsoft.AspNetCore.Components; 3 | using Microsoft.JSInterop; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | 7 | namespace AntDesign.Charts 8 | { 9 | public partial class RingProgress : ChartComponentBase 10 | { 11 | public RingProgress() : base("RingProgress") 12 | { 13 | 14 | } 15 | 16 | protected override void SetIViewConfig(IViewConfig config) 17 | { 18 | base.SetIViewConfig(config); 19 | 20 | ((RingProgressConfig)config).Percent = (double?)Data; 21 | } 22 | } 23 | } 24 | 25 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Sparkline/TinyArea/TinyArea.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesign.Charts 2 | 3 | @inherits ChartComponentBase 4 | 5 |
-------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Sparkline/TinyArea/TinyArea.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using Microsoft.AspNetCore.Components; 3 | using Microsoft.JSInterop; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | 7 | namespace AntDesign.Charts 8 | { 9 | public partial class TinyArea : ChartComponentBase 10 | { 11 | public TinyArea() : base("TinyArea") 12 | { 13 | 14 | } 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Sparkline/TinyColumn/TinyColumn.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesign.Charts 2 | 3 | @inherits ChartComponentBase 4 | 5 |
-------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Sparkline/TinyColumn/TinyColumn.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using Microsoft.AspNetCore.Components; 3 | using Microsoft.JSInterop; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | 7 | namespace AntDesign.Charts 8 | { 9 | public partial class TinyColumn : ChartComponentBase 10 | { 11 | public TinyColumn() : base("TinyColumn") 12 | { 13 | 14 | } 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Sparkline/TinyLine/TinyLine.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesign.Charts 2 | 3 | @inherits ChartComponentBase 4 | 5 |
-------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Sparkline/TinyLine/TinyLine.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using Microsoft.AspNetCore.Components; 3 | using Microsoft.JSInterop; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | 7 | namespace AntDesign.Charts 8 | { 9 | public partial class TinyLine : ChartComponentBase 10 | { 11 | public TinyLine() : base("TinyLine") 12 | { 13 | 14 | } 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Temp.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesign.Charts 2 | 3 | @inherits ChartComponentBase 4 | 5 |
-------------------------------------------------------------------------------- /src/AntDesign.Charts/Components/Temp.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using Microsoft.AspNetCore.Components; 3 | using Microsoft.JSInterop; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | 7 | namespace AntDesign.Charts 8 | { 9 | public partial class Temp : ChartComponentBase 10 | { 11 | public Temp() : base("Temp") 12 | { 13 | 14 | } 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/wwwroot/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | coverage/ 3 | .DS_Store 4 | *.log -------------------------------------------------------------------------------- /src/AntDesign.Charts/wwwroot/AntDesign.Charts.lib.module.js: -------------------------------------------------------------------------------- 1 | export function beforeWebStart() { 2 | loadScriptAndStyle(); 3 | } 4 | 5 | export function beforeStart(options, extensions) { 6 | loadScriptAndStyle(); 7 | } 8 | 9 | function loadScriptAndStyle() { 10 | const interopJS = "_content/AntDesign.Charts/ant-design-charts-blazor.js"; 11 | const cdnJS = "https://unpkg.com/@antv/g2plot@2.4.31/dist/g2plot.min.js"; 12 | const localJS = "_content/AntDesign.Charts/g2plot.min.js"; 13 | const cdnFlag = document.querySelector('[use-ant-design-charts-cdn]'); 14 | 15 | if (!document.querySelector(`[src="${interopJS}"]`) && !document.querySelector('[no-antblazor-charts-js]')) { 16 | const chartJS = cdnFlag ? cdnJS : localJS; 17 | const chartScript = document.createElement('script'); 18 | chartScript.setAttribute('src', chartJS); 19 | 20 | const jsMark = document.querySelector("script"); 21 | if (jsMark) { 22 | jsMark.before(chartScript); 23 | } 24 | else { 25 | document.body.appendChild(chartScript); 26 | } 27 | 28 | const interopScript = document.createElement('script'); 29 | interopScript.setAttribute('src', interopJS); 30 | chartScript.after(interopScript); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/AntDesign.Charts/wwwroot/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ant-design-charts-blazor", 3 | "version": "1.0.0", 4 | "description": "JavaScript tests for AntDesign Charts Blazor", 5 | "scripts": { 6 | "test": "jest", 7 | "test:watch": "jest --watch", 8 | "test:coverage": "jest --coverage", 9 | "test:ci": "jest --ci --coverage", 10 | "test:update": "jest --updateSnapshot", 11 | "test:clear": "jest --clearCache" 12 | }, 13 | "devDependencies": { 14 | "jest": "^29.7.0", 15 | "jest-environment-jsdom": "^29.7.0" 16 | }, 17 | "jest": { 18 | "testEnvironment": "jsdom", 19 | "setupFiles": [ 20 | "./tests/setup.js" 21 | ], 22 | "testMatch": [ 23 | "**/tests/**/*.test.js" 24 | ], 25 | "collectCoverageFrom": [ 26 | "ant-design-charts-blazor.js", 27 | "!**/node_modules/**", 28 | "!**/vendor/**" 29 | ], 30 | "coverageThreshold": { 31 | "global": { 32 | "branches": 80, 33 | "functions": 80, 34 | "lines": 80, 35 | "statements": 80 36 | } 37 | }, 38 | "coverageReporters": [ 39 | "text", 40 | "lcov", 41 | "json-summary" 42 | ], 43 | "verbose": true, 44 | "testTimeout": 10000 45 | } 46 | } -------------------------------------------------------------------------------- /src/AntDesign.Charts/wwwroot/tests/setup.js: -------------------------------------------------------------------------------- 1 | // Import original code 2 | const originalCode = require('../ant-design-charts-blazor.js'); 3 | 4 | // Export required functions and variables for tests 5 | global.isEmptyObj = originalCode.isEmptyObj; 6 | global.evalableKeys = originalCode.evalableKeys; 7 | global.deepObjectMerge = originalCode.deepObjectMerge; 8 | 9 | // Setup window object if not exists 10 | if (typeof window === 'undefined') { 11 | global.window = {}; 12 | } 13 | 14 | // Setup AntDesignCharts global object 15 | window.AntDesignCharts = originalCode.default || { 16 | chartsContainer: {}, 17 | interop: originalCode.interop || {} 18 | }; 19 | 20 | // Mock console methods 21 | const mockConsole = { 22 | log: jest.fn(), 23 | error: jest.fn(), 24 | warn: jest.fn() 25 | }; 26 | 27 | // Only mock console methods if they haven't been mocked yet 28 | Object.keys(mockConsole).forEach(method => { 29 | if (!console[method]?.mock) { 30 | jest.spyOn(console, method).mockImplementation(mockConsole[method]); 31 | } 32 | }); -------------------------------------------------------------------------------- /src/AntDesign.Charts/wwwroot/tests/utils.test.js: -------------------------------------------------------------------------------- 1 | const { isEmptyObj } = require('../ant-design-charts-blazor.js'); 2 | 3 | describe('Utility Functions', () => { 4 | describe('isEmptyObj', () => { 5 | it('should return true for empty object', () => { 6 | expect(isEmptyObj({})).toBe(true); 7 | }); 8 | 9 | it('should return false for non-empty object', () => { 10 | expect(isEmptyObj({ a: 1 })).toBe(false); 11 | }); 12 | 13 | it('should handle non-object inputs', () => { 14 | expect(isEmptyObj(null)).toBe(true); 15 | expect(isEmptyObj(undefined)).toBe(true); 16 | expect(isEmptyObj([])).toBe(true); 17 | expect(isEmptyObj('')).toBe(true); 18 | expect(isEmptyObj(0)).toBe(true); 19 | }); 20 | }); 21 | }); --------------------------------------------------------------------------------