├── .gitattributes ├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .gitignore ├── CHANGELOG.md ├── ChartjsDemo ├── App.razor ├── ChartjsDemo.csproj ├── Data │ ├── AnimationExamples.cs │ ├── BarDataExamples.cs │ ├── BubbleDataExamples.cs │ ├── LineDataExamples.cs │ ├── PieDataExamples.cs │ ├── PolarDataExamples.cs │ ├── RadarDataExamples.cs │ ├── SampleColors.cs │ └── ScatterDataExamples.cs ├── GlobalUsings.cs ├── Models │ └── DataItem.cs ├── Pages │ ├── AnimationPage.razor │ ├── AreaSimple.razor │ ├── BarHorizontal.razor │ ├── BarSimple.razor │ ├── BubbleSimple.razor │ ├── CallbackPage.razor │ ├── Credits.razor │ ├── CrosshairPage.razor │ ├── CustomCode.razor │ ├── DoughnutSimple.razor │ ├── GroupedPage.razor │ ├── Index.razor │ ├── LineBar.razor │ ├── LineBreak.razor │ ├── LineMultiAxes.razor │ ├── LineSimple.razor │ ├── LineSimpleLabel.razor │ ├── MixedPage.razor │ ├── PieGauge.razor │ ├── PieMulti.razor │ ├── PieSimple.razor │ ├── PolarSimple.razor │ ├── RadarSimple.razor │ ├── ScatterMultiAxes.razor │ ├── ScatterSimple.razor │ ├── StackedBarSimple.razor │ ├── StepLinePage.razor │ └── ZoomPage.razor ├── Program.cs ├── Properties │ └── launchSettings.json ├── Shared │ ├── MainLayout.razor │ ├── MainLayout.razor.css │ ├── NavMenu.razor │ └── NavMenu.razor.css ├── _Imports.razor └── wwwroot │ ├── css │ ├── app.css │ ├── bootstrap │ │ ├── bootstrap.min.css │ │ └── bootstrap.min.css.map │ ├── loading.css │ └── open-iconic │ │ ├── FONT-LICENSE │ │ ├── ICON-LICENSE │ │ ├── README.md │ │ └── font │ │ ├── css │ │ └── open-iconic-bootstrap.min.css │ │ └── fonts │ │ ├── open-iconic.eot │ │ ├── open-iconic.otf │ │ ├── open-iconic.svg │ │ ├── open-iconic.ttf │ │ └── open-iconic.woff │ ├── favicon.ico │ ├── icon-192.png │ ├── icon-512.png │ ├── index.html │ ├── manifest.json │ ├── psc_logo.png │ ├── service-worker.js │ └── service-worker.published.js ├── FUNDING.yml ├── LICENSE ├── PSC.Blazor.Components.Chartjs.sln ├── README.md └── src ├── Chart.razor ├── Chart.razor.cs ├── Chart.razor.css ├── ChartJsInterop.cs ├── Enums ├── Axes.cs ├── ChartType.cs ├── TimeUnit.cs └── ZoomMode.cs ├── GlobalUsing.cs ├── Interfaces ├── IChartConfig.cs ├── IDataset.cs └── IOptions.cs ├── Models ├── AxesTimeFormats.cs ├── Bar │ ├── BarChartConfig.cs │ ├── BarData.cs │ └── BarDataset.cs ├── Bubble │ ├── BubbleChartConfig.cs │ ├── BubbleCoords.cs │ ├── BubbleData.cs │ └── BubbleDataset.cs ├── Common │ ├── Animations │ │ ├── Animation.cs │ │ ├── Animations.cs │ │ └── Tension.cs │ ├── Autocolors.cs │ ├── AxesTime.cs │ ├── AxesTitle.cs │ ├── Axis.cs │ ├── Callback │ │ ├── CallbackGenericContext.cs │ │ ├── Callbacks.cs │ │ └── TicksCallbackContext.cs │ ├── Colors.cs │ ├── Context │ │ ├── ClickValue.cs │ │ ├── HoverContext.cs │ │ ├── LegendClickContext.cs │ │ ├── LegendFilterContext.cs │ │ └── ZoomContext.cs │ ├── Crosshair.cs │ ├── CrosshairLine.cs │ ├── CustomDataset.cs │ ├── Data.cs │ ├── DataLabels.cs │ ├── Dataset.cs │ ├── Elements.cs │ ├── Font.cs │ ├── Grid.cs │ ├── Interaction.cs │ ├── Legend.cs │ ├── LegendItem.cs │ ├── LegendLabels.cs │ ├── Line.cs │ ├── Options.cs │ ├── Padding.cs │ ├── Parsing.cs │ ├── Plugins.cs │ ├── Scales.cs │ ├── StringEnums │ │ ├── Align.cs │ │ ├── AxisInteractions.cs │ │ ├── CrossAlign.cs │ │ ├── CubicInterpolationMode.cs │ │ ├── DatalabelsAlign.cs │ │ ├── DatalabelsAnchor.cs │ │ ├── DatalabelsTextAlign.cs │ │ ├── InteractionMode.cs │ │ ├── LegendPosition.cs │ │ ├── PointStyle.cs │ │ ├── Position.cs │ │ ├── StepMode.cs │ │ └── TextDirection.cs │ ├── Ticks.cs │ ├── Title.cs │ ├── Tooltip.cs │ └── Zoom │ │ ├── Drag.cs │ │ ├── Limits.cs │ │ ├── Pan.cs │ │ ├── Pinch.cs │ │ ├── ScaleLimits.cs │ │ ├── Wheel.cs │ │ ├── Zoom.cs │ │ └── ZoomOptions.cs ├── Doughnut │ ├── DoughnutChartConfig.cs │ ├── DoughnutData.cs │ └── DoughnutDataset.cs ├── Line │ ├── LineChartConfig.cs │ ├── LineData.cs │ ├── LineDataType.cs │ └── LineDataset.cs ├── Pie │ ├── PieChartConfig.cs │ ├── PieData.cs │ ├── PieDataset.cs │ └── PieOptions.cs ├── Polar │ ├── PolarChartConfig.cs │ ├── PolarData.cs │ └── PolarDataset.cs ├── Radar │ ├── RadarChartConfig.cs │ ├── RadarData.cs │ ├── RadarDataset.cs │ ├── RadarOptions.cs │ ├── RadarOptionsElements.cs │ ├── RadarOptionsElementsLine.cs │ ├── RadarOptionsScales.cs │ └── RadarOptionsScalesRadius.cs └── Scatter │ ├── ScatterChartConfig.cs │ ├── ScatterData.cs │ ├── ScatterDataset.cs │ └── ScatterXYValue.cs ├── PSC.Blazor.Components.Chartjs.csproj ├── _Imports.razor ├── libman.json ├── psc_ico.ico ├── psc_logo.png └── wwwroot ├── Chart.js └── lib ├── Chart.js ├── chart.cjs ├── chart.cjs.map ├── chart.esm.js ├── chart.esm.min.js ├── chart.js ├── chart.js.map ├── chart.min.js ├── chart.mjs ├── chart.umd.js ├── chart.umd.js.map ├── chunks │ ├── helpers.segment.cjs │ ├── helpers.segment.cjs.map │ ├── helpers.segment.js │ └── helpers.segment.js.map ├── controllers │ ├── controller.bar.d.ts │ ├── controller.bubble.d.ts │ ├── controller.doughnut.d.ts │ ├── controller.line.d.ts │ ├── controller.pie.d.ts │ ├── controller.polarArea.d.ts │ ├── controller.radar.d.ts │ ├── controller.scatter.d.ts │ └── index.d.ts ├── core │ ├── core.adapters.d.ts │ ├── core.animation.d.ts │ ├── core.animations.d.ts │ ├── core.animations.defaults.d.ts │ ├── core.animator.d.ts │ ├── core.config.d.ts │ ├── core.controller.d.ts │ ├── core.datasetController.d.ts │ ├── core.defaults.d.ts │ ├── core.element.d.ts │ ├── core.interaction.d.ts │ ├── core.layouts.d.ts │ ├── core.layouts.defaults.d.ts │ ├── core.plugins.d.ts │ ├── core.registry.d.ts │ ├── core.scale.autoskip.d.ts │ ├── core.scale.d.ts │ ├── core.scale.defaults.d.ts │ ├── core.ticks.d.ts │ ├── core.typedRegistry.d.ts │ └── index.d.ts ├── elements │ ├── element.arc.d.ts │ ├── element.bar.d.ts │ ├── element.line.d.ts │ ├── element.point.d.ts │ └── index.d.ts ├── helpers.cjs ├── helpers.cjs.map ├── helpers.esm.js ├── helpers.esm.min.js ├── helpers.js ├── helpers.js.map ├── helpers.mjs ├── helpers │ ├── helpers.canvas.d.ts │ ├── helpers.collection.d.ts │ ├── helpers.color.d.ts │ ├── helpers.config.d.ts │ ├── helpers.config.types.d.ts │ ├── helpers.core.d.ts │ ├── helpers.curve.d.ts │ ├── helpers.dom.d.ts │ ├── helpers.easing.d.ts │ ├── helpers.extras.d.ts │ ├── helpers.interpolation.d.ts │ ├── helpers.intl.d.ts │ ├── helpers.math.d.ts │ ├── helpers.options.d.ts │ ├── helpers.rtl.d.ts │ ├── helpers.segment.d.ts │ └── index.d.ts ├── index.d.ts ├── index.umd.d.ts ├── platform │ ├── index.d.ts │ ├── platform.base.d.ts │ ├── platform.basic.d.ts │ └── platform.dom.d.ts ├── plugins │ ├── index.d.ts │ ├── plugin.colors.d.ts │ ├── plugin.decimation.d.ts │ ├── plugin.filler │ │ ├── filler.drawing.d.ts │ │ ├── filler.helper.d.ts │ │ ├── filler.options.d.ts │ │ ├── filler.segment.d.ts │ │ ├── filler.target.d.ts │ │ ├── filler.target.stack.d.ts │ │ ├── index.d.ts │ │ └── simpleArc.d.ts │ ├── plugin.legend.d.ts │ ├── plugin.subtitle.d.ts │ ├── plugin.title.d.ts │ └── plugin.tooltip.d.ts ├── scales │ ├── index.d.ts │ ├── scale.category.d.ts │ ├── scale.linear.d.ts │ ├── scale.linearbase.d.ts │ ├── scale.logarithmic.d.ts │ ├── scale.radialLinear.d.ts │ ├── scale.time.d.ts │ └── scale.timeseries.d.ts ├── types.d.ts └── types │ ├── animation.d.ts │ ├── basic.d.ts │ ├── color.d.ts │ ├── geometric.d.ts │ ├── index.d.ts │ ├── layout.d.ts │ └── utils.d.ts ├── chartjs-adapter-moment ├── chartjs-adapter-moment.esm.js ├── chartjs-adapter-moment.esm.min.js ├── chartjs-adapter-moment.js └── chartjs-adapter-moment.min.js ├── chartjs-plugin-autocolors ├── chartjs-plugin-autocolors.cjs ├── chartjs-plugin-autocolors.cjs.map ├── chartjs-plugin-autocolors.esm.js ├── chartjs-plugin-autocolors.esm.js.map ├── chartjs-plugin-autocolors.min.js └── chartjs-plugin-autocolors.min.js.map ├── chartjs-plugin-datalabels ├── chartjs-plugin-datalabels.esm.js ├── chartjs-plugin-datalabels.esm.min.js ├── chartjs-plugin-datalabels.js └── chartjs-plugin-datalabels.min.js ├── chartjs-plugin-zoom ├── chartjs-plugin-zoom.esm.js ├── chartjs-plugin-zoom.esm.min.js ├── chartjs-plugin-zoom.js └── chartjs-plugin-zoom.min.js └── hammer.js ├── hammer.js ├── hammer.min.js ├── hammer.min.js.map └── hammer.min.map /.gitattributes: -------------------------------------------------------------------------------- 1 | *.razor linguist-language=C# 2 | *.cs linguist-language=C# 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /ChartjsDemo/App.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | Not found 8 | 9 |

Sorry, there's nothing at this address.

10 |
11 |
12 |
13 | -------------------------------------------------------------------------------- /ChartjsDemo/ChartjsDemo.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | service-worker-assets.js 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | true 27 | 28 | 29 | true 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /ChartjsDemo/Data/AnimationExamples.cs: -------------------------------------------------------------------------------- 1 | namespace ChartjsDemo.Data 2 | { 3 | public class AnimationExamples 4 | { 5 | public static List AnimationText = new List() { "January", "February", "March", "April", "May", "June", "July" }; 6 | public static List SimpleLine = new List() { 65, 59, 80, 81, 56, 55, 40 }; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /ChartjsDemo/Data/BarDataExamples.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | 3 | namespace ChartjsDemo.Data; 4 | 5 | public static class BarDataExamples 6 | { 7 | public static List SimpleBarText = new List() { "January", "February", "March", "April", "May", "June", "July" }; 8 | public static List SimpleBar = new List() { 9 | new DataItem() { Name = "January", Value = 65 }, 10 | new DataItem() { Name = "February", Value = 59 }, 11 | new DataItem() { Name = "March", Value = 80 }, 12 | new DataItem() { Name = "April", Value = 81 }, 13 | new DataItem() { Name = "May", Value = 56 }, 14 | new DataItem() { Name = "June", Value = 55 }, 15 | new DataItem() { Name = "July", Value = 40 } 16 | }; 17 | 18 | public static List GroupedLabels = new List() { "1900", "1950", "1999", "2050" }; 19 | public static List Grouped1 = new List() { 133, 221, 783, 2478 }; 20 | public static List Grouped2 = new List() { 408, 547, 675, 734 }; 21 | 22 | public static List CallbackLabels = new List() { "Q1", "Q2", "Q3", "Q4" }; 23 | public static List CallbackValues = new List { 50000, 60000, 70000, 1800000 }; 24 | } -------------------------------------------------------------------------------- /ChartjsDemo/Data/BubbleDataExamples.cs: -------------------------------------------------------------------------------- 1 | using PSC.Blazor.Components.Chartjs.Models.Bubble; 2 | 3 | namespace ChartjsDemo.Data 4 | { 5 | public static class BubbleDataExamples 6 | { 7 | public static List SimpleBubbleText = new List() { "First Dataset" }; 8 | public static List SimpleBubble = new List() { 9 | new BubbleCoords() { R = 15, X = 20, Y = 30 }, 10 | new BubbleCoords() { R = 10, X = 40, Y = 10 }, 11 | new BubbleCoords() { R = 14, X = 30, Y = 20 }, 12 | }; 13 | } 14 | } -------------------------------------------------------------------------------- /ChartjsDemo/Data/LineDataExamples.cs: -------------------------------------------------------------------------------- 1 | using PSC.Blazor.Components.Chartjs.Models.Common; 2 | 3 | namespace ChartjsDemo.Data 4 | { 5 | public static class LineDataExamples 6 | { 7 | public static List SimpleLineText = new List() { "January", "February", "March", "April", "May", "June", "July" }; 8 | public static List SimpleLine = new List() { 65, 59, 80, 81, 86, 55, 40 }; 9 | public static List SimpleLine2 = new List() { 33, 25, 35, 51, 54, 76, 60 }; 10 | public static List SimpleLine3 = new List() { 53, 91, 39, 61, 39, 87, 23 }; 11 | 12 | // stepped line 13 | public static List StepLineText = new List() { "Day 1", "Day 2", "Day 3", "Day 4", "Day 5", "Day 6" }; 14 | public static List StepLine = new List() { 65, 59, 80, 81, 86, 55, 40 }; 15 | 16 | // custom code 17 | public static List CustomLineText = new List() { "January", "February", "March", "April", "May", "June" }; 18 | public static List CustomLine = new List() { 60, 80, 81, 56, 55, 40 }; 19 | 20 | // multi axes 21 | public static List MultiAxesLineText = new List() { 22 | "January;2015", "February;2015;Y", "March;2015", 23 | "January;2016", "February;2016;Y", "March;2016" }; 24 | public static List MultiAxesLine = new List() { 12, 19, 3, 5, 2, 3 }; 25 | 26 | public static List BreakLine = new List() { 0, 20, 20, 60, 60, 120, null, 180, 120, 125, 105, 110, 170 }; 27 | public static List BreakLineText = new List() { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11" }; 28 | } 29 | } -------------------------------------------------------------------------------- /ChartjsDemo/Data/PieDataExamples.cs: -------------------------------------------------------------------------------- 1 | namespace ChartjsDemo.Data 2 | { 3 | public static class PieDataExamples 4 | { 5 | public static List SimplePieText = new List() { "January", "February", "March" }; 6 | public static List SimplePie = new List() { 300, 50, 100 }; 7 | 8 | public static List MultiPieText = new List() { "Overall Yay", "Overall Nay", "Group A Yay", "Group A Nay", "Group B Yay", "Group B Nay", "Group C Yay", "Group C Nay" }; 9 | public static List MultiPie1 = new List() { 21, 79 }; 10 | public static List MultiPie2 = new List() { 33, 67 }; 11 | public static List MultiPie3 = new List() { 20, 80 }; 12 | public static List MultiPie4 = new List() { 10, 90 }; 13 | 14 | public static List MultiPieBackground1 = new List() { "#AAA", "#777" }; 15 | public static List MultiPieBackground2 = new List() { "hsl(0, 100%, 60%)", "hsl(0, 100%, 35%)" }; 16 | public static List MultiPieBackground3 = new List() { "hsl(100, 100%, 60%)", "hsl(100, 100%, 35%)" }; 17 | public static List MultiPieBackground4 = new List() { "hsl(180, 100%, 60%)", "hsl(180, 100%, 35%)" }; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ChartjsDemo/Data/PolarDataExamples.cs: -------------------------------------------------------------------------------- 1 | namespace ChartjsDemo.Data 2 | { 3 | public static class PolarDataExamples 4 | { 5 | public static List SimplePolarText = new List() { "January", "February", "March", "April", "May" }; 6 | public static List SimplePolar = new List() { 11, 16, 7, 3, 14 }; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /ChartjsDemo/Data/RadarDataExamples.cs: -------------------------------------------------------------------------------- 1 | using PSC.Blazor.Components.Chartjs.Models.Radar; 2 | 3 | namespace ChartjsDemo.Data 4 | { 5 | public static class RadarDataExamples 6 | { 7 | /// 8 | /// The radar simple text 9 | /// 10 | public static List RadarSimpleText = new List() { 11 | "Eating", 12 | "Drinking", 13 | "Sleeping", 14 | "Designing", 15 | "Coding", 16 | "Cycling", 17 | "Running" 18 | }; 19 | 20 | /// 21 | /// The radar datasets 22 | /// 23 | public static List RadarDatasets = new List() { 24 | new RadarDataset() { 25 | Label = "My First Dataset", 26 | Data = new List() { 65, 59, 90, 81, 56, 55, 40 }, 27 | Fill = true, 28 | BackgroundColor = "rgba(255, 99, 132, 0.2)", 29 | BorderColor = "rgb(255, 99, 132)", 30 | PointBackgroundColor = "rgb(255, 99, 132)", 31 | PointBorderColor = "#fff", 32 | PointHoverBackgroundColor = "#fff", 33 | PointHoverBorderColor = "rgb(255, 99, 132)" 34 | }, 35 | new RadarDataset() { 36 | Label = "My Second Dataset", 37 | Data = new List() { 28, 48, 40, 19, 96, 27, 100 }, 38 | Fill = true, 39 | BackgroundColor = "rgba(54, 162, 235, 0.2)", 40 | BorderColor = "rgb(54, 162, 235)", 41 | PointBackgroundColor = "rgb(54, 162, 235)", 42 | PointBorderColor = "#fff", 43 | PointHoverBackgroundColor = "#fff", 44 | PointHoverBorderColor = "rgb(54, 162, 235)" 45 | } 46 | }; 47 | } 48 | } -------------------------------------------------------------------------------- /ChartjsDemo/Data/SampleColors.cs: -------------------------------------------------------------------------------- 1 | namespace ChartjsDemo.Data; 2 | 3 | public static class SampleColors 4 | { 5 | public static List Palette1 = new List() 6 | { 7 | "rgba(255, 99, 132, 0.2)", 8 | "rgba(255, 159, 64, 0.2)", 9 | "rgba(255, 205, 86, 0.2)", 10 | "rgba(75, 192, 192, 0.2)", 11 | "rgba(54, 162, 235, 0.2)", 12 | "rgba(153, 102, 255, 0.2)", 13 | "rgba(201, 203, 207, 0.2)" 14 | }; 15 | 16 | public static List PaletteBorder1 = new List() 17 | { 18 | "rgb(255, 99, 132)", 19 | "rgb(255, 159, 64)", 20 | "rgb(255, 205, 86)", 21 | "rgb(75, 192, 192)", 22 | "rgb(54, 162, 235)", 23 | "rgb(153, 102, 255)", 24 | "rgb(201, 203, 207)" 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /ChartjsDemo/Data/ScatterDataExamples.cs: -------------------------------------------------------------------------------- 1 | using PSC.Blazor.Components.Chartjs.Models.Scatter; 2 | 3 | namespace ChartjsDemo.Data 4 | { 5 | public static class ScatterDataExamples 6 | { 7 | public static string ScatterSimpleText = "Scatter Dataset"; 8 | public static List ScatterDatasets = new List() { 9 | new ScatterXYValue() { X = -10, Y = 0 }, 10 | new ScatterXYValue() { X = 0, Y = 10 }, 11 | new ScatterXYValue() { X = 10, Y = 5 }, 12 | new ScatterXYValue() { X = 0.5M, Y = 5.5M } 13 | }; 14 | public static string ScatterMultiAxes = "Scatter Multi Axes"; 15 | public static List ScatterMultiAxesDatasets = new List() { 16 | new ScatterXYValue() { X = -8, Y = 2 }, 17 | new ScatterXYValue() { X = 5, Y = 6 }, 18 | new ScatterXYValue() { X = 4, Y = 7 }, 19 | new ScatterXYValue() { X = 3.5M, Y = 3.5M } 20 | }; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ChartjsDemo/GlobalUsings.cs: -------------------------------------------------------------------------------- 1 | global using ChartjsDemo.Data; 2 | global using ChartjsDemo.Models; 3 | 4 | global using System.Text.Json.Serialization; -------------------------------------------------------------------------------- /ChartjsDemo/Models/DataItem.cs: -------------------------------------------------------------------------------- 1 | namespace ChartjsDemo.Models; 2 | 3 | public class DataItem 4 | { 5 | /// 6 | /// Gets or sets the group. 7 | /// 8 | /// 9 | /// The group. 10 | /// 11 | [JsonPropertyName("group")] 12 | public string? Group { get; set; } 13 | 14 | /// 15 | /// Gets or sets the name of the attribute 16 | /// 17 | /// 18 | /// The name of the attribute 19 | /// 20 | [JsonPropertyName("name")] 21 | public string? Name { get; set; } 22 | 23 | /// 24 | /// Gets or sets the value. 25 | /// 26 | /// 27 | /// The value 28 | /// 29 | [JsonPropertyName("value")] 30 | public decimal? Value { get; set; } 31 | } -------------------------------------------------------------------------------- /ChartjsDemo/Pages/BubbleSimple.razor: -------------------------------------------------------------------------------- 1 | @page "/bubbleSimple" 2 | 3 |

Bubble Simple

4 | 5 | 6 | 7 |
8 | 9 |

Code

10 | 11 |

12 | This is the component to add in your page. 13 |

14 | 15 | 16 | <Chart Config="_config1" @ref="_chart1"><Chart> 17 | 18 | 19 |

20 | Then, in the code section, add the following code: 21 |

22 | 23 | 24 | private BubbleChartConfig? _config1; 25 | private Chart? _chart1; 26 | 27 | protected override async Task OnInitializedAsync() 28 | { 29 | _config1 = new BubbleChartConfig() 30 | { 31 | }; 32 | 33 | _config1.Data.Labels = BubbleDataExamples.SimpleBubbleText; 34 | _config1.Data.Datasets.Add(new BubbleDataset() 35 | { 36 | Label = "My First Dataset", 37 | Data = BubbleDataExamples.SimpleBubble, 38 | BackgroundColor = Colors.PaletteBorder1.FirstOrDefault() 39 | }); 40 | } 41 | 42 | 43 | @code { 44 | private BubbleChartConfig? _config1; 45 | private Chart? _chart1; 46 | 47 | protected override async Task OnInitializedAsync() 48 | { 49 | _config1 = new BubbleChartConfig() 50 | { 51 | Options = new Options() 52 | { 53 | Responsive = true, 54 | MaintainAspectRatio = false 55 | } 56 | }; 57 | 58 | _config1.Data.Labels = BubbleDataExamples.SimpleBubbleText; 59 | _config1.Data.Datasets.Add(new BubbleDataset() 60 | { 61 | Label = "My First Dataset", 62 | Data = BubbleDataExamples.SimpleBubble, 63 | BackgroundColor = SampleColors.PaletteBorder1.FirstOrDefault() 64 | }); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /ChartjsDemo/Pages/Credits.razor: -------------------------------------------------------------------------------- 1 | @page "/credits" 2 | 3 |

Credits

4 | 5 |

Chart.js

6 | 7 |

8 | Chart.js is a free, open-source JavaScript library for data visualization, 9 | which supports eight chart types: bar, line, area, pie (doughnut), bubble, radar, polar, and scatter. 10 | Created by London-based web developer Nick Downie in 2013, now it is maintained by the community andis the second most popular 11 | JavaScript charting library on GitHub by the number of stars after D3.js, considered significantly easier to use though less 12 | customizable than the latter. 13 |

14 |

15 | Chart.js renders in HTML5 canvas and is widely covered as one of the best data visualization libraries. 16 | It is available under the MIT license. 17 |

18 | 19 |

Blazor component

20 | 21 |

22 | I, Enrico Rossini, started to create the component for Blazor that is a faced of Chart.js. 23 | Follow my blog PureSourceCode.com. 24 |

25 |

26 | A special thanks to Macias that added the crosshair line to the components. 27 |

28 |

29 | Thank you to Heitor Eleutério de Rezende for the migration to NET7 and adding: 30 |

    31 |
  • Legend Labels Filtering
  • 32 |
  • Support to Ticks' AutoSkip and Font properties
  • 33 |
  • Tooltip Callback Label problem fixed.
  • 34 |
  • Ticks callback
  • 35 |
36 |

37 |

38 | For the implementation of the implement Time Cartesian Axis, a big thank you to AnthoDingo for his work. 39 | Now, it is possible to add graphs with time-based data. 40 |

-------------------------------------------------------------------------------- /ChartjsDemo/Pages/CustomCode.razor: -------------------------------------------------------------------------------- 1 | @page "/customCode1" 2 | 3 |

Line Simple

4 | 5 | 6 | 7 |
8 | 9 |

Code

10 | 11 |

12 | This is the component to add in your page. 13 |

14 | 15 | 16 | <Chart Config="_config1" @ref="_chart1"><Chart> 17 | 18 | 19 |

20 | Then, in the code section, add the following code: 21 |

22 | 23 | 24 | private LineChartConfig? _config1; 25 | private Chart? _chart1; 26 | 27 | protected override async Task OnInitializedAsync() 28 | { 29 | _config1 = new LineChartConfig() 30 | { 31 | }; 32 | 33 | _config1.Data.Labels = LineDataExamples.SimpleLineText; 34 | _config1.Data.Datasets.Add(new LineDataset() 35 | { 36 | Label = "My First Dataset", 37 | Data = LineDataExamples.SimpleLine.ToList(), 38 | BorderColor = Colors.PaletteBorder1.FirstOrDefault(), 39 | Tension = 0.1M, 40 | Fill = false 41 | }); 42 | } 43 | 44 | 45 | @code { 46 | private LineChartConfig? _config1; 47 | private Chart? _chart1; 48 | 49 | protected override async Task OnInitializedAsync() 50 | { 51 | _config1 = new LineChartConfig() 52 | { 53 | }; 54 | 55 | _config1.Data.Labels = LineDataExamples.CustomLineText; 56 | _config1.Data.Datasets.Add(new LineDataset() 57 | { 58 | Data = LineDataExamples.CustomLine.ToList(), 59 | FillColor = "#79D1CF", 60 | StrokeColor = "#79D1CF" 61 | }); 62 | } 63 | } -------------------------------------------------------------------------------- /ChartjsDemo/Pages/PieSimple.razor: -------------------------------------------------------------------------------- 1 | @page "/pieSimple" 2 | 3 |

Pie Simple

4 | 5 | 6 | 7 |
8 | 9 |

Code

10 | 11 |

12 | This is the component to add in your page. 13 |

14 | 15 | 16 | <Chart Config="_config1" @ref="_chart1"><Chart> 17 | 18 | 19 |

20 | Then, in the code section, add the following code: 21 |

22 | 23 | 24 | private PieChartConfig _config1; 25 | private Chart _chart1; 26 | 27 | protected override async Task OnInitializedAsync() 28 | { 29 | _config1 = new PieChartConfig() 30 | { 31 | }; 32 | 33 | _config1.Data.Labels = PieDataExamples.SimplePieText; 34 | _config1.Data.Datasets.Add(new PieDataset() 35 | { 36 | Label = "My First Dataset", 37 | Data = PieDataExamples.SimplePie.ToList(), 38 | BackgroundColor = Colors.PaletteBorder1, 39 | HoverOffset = 4 40 | }); 41 | } 42 | 43 | 44 | @code { 45 | private PieChartConfig? _config1; 46 | private Chart? _chart1; 47 | 48 | protected override async Task OnInitializedAsync() 49 | { 50 | _config1 = new PieChartConfig() 51 | { 52 | Options = new PieOptions() 53 | { 54 | Responsive = true, 55 | MaintainAspectRatio = false 56 | } 57 | }; 58 | 59 | _config1.Data.Labels = PieDataExamples.SimplePieText; 60 | _config1.Data.Datasets.Add(new PieDataset() 61 | { 62 | Label = "My First Dataset", 63 | Data = PieDataExamples.SimplePie.ToList(), 64 | BackgroundColor = SampleColors.PaletteBorder1, 65 | HoverOffset = 4 66 | }); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /ChartjsDemo/Pages/PolarSimple.razor: -------------------------------------------------------------------------------- 1 | @page "/polarSimple" 2 | 3 |

Polar Simple

4 | 5 | 6 | 7 |
8 | 9 |

Code

10 | 11 |

12 | This is the component to add in your page. 13 |

14 | 15 | 16 | <Chart Config="_config1" @ref="_chart1"><Chart> 17 | 18 | 19 |

20 | Then, in the code section, add the following code: 21 |

22 | 23 | 24 | private PolarChartConfig? _config1; 25 | private Chart? _chart1; 26 | 27 | protected override async Task OnInitializedAsync() 28 | { 29 | _config1 = new PolarChartConfig() 30 | { 31 | Options = new Options() 32 | { 33 | Responsive = true, 34 | MaintainAspectRatio = false 35 | } 36 | }; 37 | 38 | _config1.Data.Labels = PolarDataExamples.SimplePolarText; 39 | _config1.Data.Datasets.Add(new PolarDataset() 40 | { 41 | Label = "Value", 42 | Data = PolarDataExamples.SimplePolar, 43 | BackgroundColor = Colors.Palette1, 44 | }); 45 | } 46 | 47 | 48 | @code { 49 | private PolarChartConfig? _config1; 50 | private Chart? _chart1; 51 | 52 | protected override async Task OnInitializedAsync() 53 | { 54 | _config1 = new PolarChartConfig() 55 | { 56 | Options = new Options() 57 | { 58 | Responsive = true, 59 | MaintainAspectRatio = false 60 | } 61 | }; 62 | 63 | _config1.Data.Labels = PolarDataExamples.SimplePolarText; 64 | _config1.Data.Datasets.Add(new PolarDataset() 65 | { 66 | Label = "Value", 67 | Data = PolarDataExamples.SimplePolar, 68 | BackgroundColor = SampleColors.Palette1, 69 | }); 70 | } 71 | } -------------------------------------------------------------------------------- /ChartjsDemo/Pages/RadarSimple.razor: -------------------------------------------------------------------------------- 1 | @page "/radarSimple" 2 | 3 |

Radar Simple

4 | 5 | 6 | 7 |
8 | 9 |

Code

10 | 11 |

12 | This is the component to add in your page. 13 |

14 | 15 | 16 | <Chart Config="_config1" @ref="_chart1"><Chart> 17 | 18 | 19 |

20 | Then, in the code section, add the following code: 21 |

22 | 23 | 24 | private RadarChartConfig? _config1; 25 | private Chart? _chart1; 26 | 27 | protected override async Task OnInitializedAsync() 28 | { 29 | _config1 = new RadarChartConfig() 30 | { 31 | }; 32 | 33 | _config1.Data.Labels = RadarDataExamples.RadarSimpleText; 34 | _config1.Data.Datasets.AddRange(RadarDataExamples.RadarDatasets); 35 | } 36 | 37 | 38 | @code { 39 | private RadarChartConfig? _config1; 40 | private Chart? _chart1; 41 | 42 | protected override async Task OnInitializedAsync() 43 | { 44 | _config1 = new RadarChartConfig() 45 | { 46 | Options = new RadarOptions() 47 | { 48 | Responsive = true, 49 | MaintainAspectRatio = false 50 | } 51 | }; 52 | 53 | _config1.Data.Labels = RadarDataExamples.RadarSimpleText; 54 | _config1.Data.Datasets.AddRange(RadarDataExamples.RadarDatasets); 55 | } 56 | } -------------------------------------------------------------------------------- /ChartjsDemo/Pages/ScatterSimple.razor: -------------------------------------------------------------------------------- 1 | @page "/scatterSimple" 2 | 3 |

Scatter Simple

4 | 5 | 6 | 7 |
8 | 9 |

Code

10 | 11 |

12 | This is the component to add in your page. 13 |

14 | 15 | 16 | <Chart Config="_config1" @ref="_chart1"><Chart> 17 | 18 | 19 |

20 | Then, in the code section, add the following code: 21 |

22 | 23 | 24 | private ScatterChartConfig? _config1; 25 | private Chart? _chart1; 26 | 27 | protected override async Task OnInitializedAsync() 28 | { 29 | _config1 = new ScatterChartConfig() 30 | { 31 | }; 32 | 33 | _config1.Data.Datasets.Add(new ScatterDataset() 34 | { 35 | BackgroundColor = "rgb(255, 99, 132)", 36 | Label = ScatterDataExamples.ScatterSimpleText, 37 | Data = ScatterDataExamples.ScatterDatasets 38 | }); 39 | } 40 | 41 | 42 | @code { 43 | private ScatterChartConfig? _config1; 44 | private Chart? _chart1; 45 | 46 | protected override async Task OnInitializedAsync() 47 | { 48 | _config1 = new ScatterChartConfig() 49 | { 50 | Options = new Options() 51 | { 52 | Responsive = true, 53 | MaintainAspectRatio = false 54 | } 55 | }; 56 | 57 | _config1.Data.Datasets.Add(new ScatterDataset() 58 | { 59 | BackgroundColor = "rgb(255, 99, 132)", 60 | Label = ScatterDataExamples.ScatterSimpleText, 61 | Data = ScatterDataExamples.ScatterDatasets 62 | }); 63 | } 64 | } -------------------------------------------------------------------------------- /ChartjsDemo/Pages/StepLinePage.razor: -------------------------------------------------------------------------------- 1 | @page "/linestep" 2 | 3 |

Step Line

4 | 5 | 6 | 7 |
8 | 9 |

Code

10 | 11 |

12 | This is the component to add in your page. 13 |

14 | 15 | 16 | <Chart Config="_config1" @ref="_chart1"><Chart> 17 | 18 | 19 |

20 | Then, in the code section, add the following code: 21 |

22 | 23 | 24 | private LineChartConfig? _config1; 25 | private Chart? _chart1; 26 | 27 | protected override async Task OnInitializedAsync() 28 | { 29 | _config1 = new LineChartConfig() 30 | { 31 | }; 32 | 33 | _config1.Data.Labels = LineDataExamples.StepLineText; 34 | _config1.Data.Datasets.Add(new LineDataset() 35 | { 36 | Label = "My First Dataset", 37 | Data = LineDataExamples.StepLine.ToList(), 38 | BorderColor = Colors.PaletteBorder1.FirstOrDefault(), 39 | Tension = 0.1M, 40 | Fill = false, 41 | PointRadius = 15, 42 | PointStyle = PointStyle.Cross, 43 | StepMode = PSC.Blazor.Components.Chartjs.Models.Common.StringEnums.StepMode.True 44 | }); 45 | } 46 | 47 | 48 | @code { 49 | private LineChartConfig? _config1; 50 | private Chart? _chart1; 51 | 52 | protected override async Task OnInitializedAsync() 53 | { 54 | _config1 = new LineChartConfig() 55 | { 56 | }; 57 | 58 | _config1.Data.Labels = LineDataExamples.StepLineText; 59 | _config1.Data.Datasets.Add(new LineDataset() 60 | { 61 | Label = "My First Dataset", 62 | Data = LineDataExamples.StepLine.ToList(), 63 | BorderColor = SampleColors.PaletteBorder1.FirstOrDefault(), 64 | Tension = 0.1M, 65 | Fill = false, 66 | PointRadius = 15, 67 | PointStyle = PointStyle.Cross, 68 | StepMode = PSC.Blazor.Components.Chartjs.Models.Common.StringEnums.StepMode.True 69 | }); 70 | } 71 | } -------------------------------------------------------------------------------- /ChartjsDemo/Program.cs: -------------------------------------------------------------------------------- 1 | using ChartjsDemo; 2 | using Microsoft.AspNetCore.Components.Web; 3 | using Microsoft.AspNetCore.Components.WebAssembly.Hosting; 4 | 5 | var builder = WebAssemblyHostBuilder.CreateDefault(args); 6 | builder.RootComponents.Add("#app"); 7 | builder.RootComponents.Add("head::after"); 8 | 9 | builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); 10 | 11 | await builder.Build().RunAsync(); 12 | -------------------------------------------------------------------------------- /ChartjsDemo/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:42921", 7 | "sslPort": 44364 8 | } 9 | }, 10 | "profiles": { 11 | "ChartjsDemo": { 12 | "commandName": "Project", 13 | "dotnetRunMessages": true, 14 | "launchBrowser": true, 15 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 16 | "applicationUrl": "https://localhost:7194;http://localhost:5194", 17 | "environmentVariables": { 18 | "ASPNETCORE_ENVIRONMENT": "Development" 19 | } 20 | }, 21 | "IIS Express": { 22 | "commandName": "IISExpress", 23 | "launchBrowser": true, 24 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 25 | "environmentVariables": { 26 | "ASPNETCORE_ENVIRONMENT": "Development" 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ChartjsDemo/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 |
4 | 7 | 8 |
9 |
10 | PureSourceCode.com 11 | Post 12 | Forum 13 |
14 | 15 |
16 | @Body 17 |
18 |
19 |
-------------------------------------------------------------------------------- /ChartjsDemo/Shared/MainLayout.razor.css: -------------------------------------------------------------------------------- 1 | .page { 2 | position: relative; 3 | display: flex; 4 | flex-direction: column; 5 | } 6 | 7 | main { 8 | flex: 1; 9 | } 10 | 11 | .sidebar { 12 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); 13 | } 14 | 15 | .top-row { 16 | background-color: #f7f7f7; 17 | border-bottom: 1px solid #d6d5d5; 18 | justify-content: flex-end; 19 | height: 3.5rem; 20 | display: flex; 21 | align-items: center; 22 | } 23 | 24 | .top-row ::deep a, .top-row ::deep .btn-link { 25 | white-space: nowrap; 26 | margin-left: 1.5rem; 27 | text-decoration: none; 28 | } 29 | 30 | .top-row ::deep a:hover, .top-row ::deep .btn-link:hover { 31 | text-decoration: underline; 32 | } 33 | 34 | .top-row ::deep a:first-child { 35 | overflow: hidden; 36 | text-overflow: ellipsis; 37 | } 38 | 39 | @media (max-width: 640.98px) { 40 | .top-row:not(.auth) { 41 | display: none; 42 | } 43 | 44 | .top-row.auth { 45 | justify-content: space-between; 46 | } 47 | 48 | .top-row ::deep a, .top-row ::deep .btn-link { 49 | margin-left: 0; 50 | } 51 | } 52 | 53 | @media (min-width: 641px) { 54 | .page { 55 | flex-direction: row; 56 | } 57 | 58 | .sidebar { 59 | width: 250px; 60 | height: 100vh; 61 | position: sticky; 62 | top: 0; 63 | } 64 | 65 | .top-row { 66 | position: sticky; 67 | top: 0; 68 | z-index: 1; 69 | } 70 | 71 | .top-row.auth ::deep a:first-child { 72 | flex: 1; 73 | text-align: right; 74 | width: 0; 75 | } 76 | 77 | .top-row, article { 78 | padding-left: 2rem !important; 79 | padding-right: 1.5rem !important; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /ChartjsDemo/Shared/NavMenu.razor.css: -------------------------------------------------------------------------------- 1 | .navbar-toggler { 2 | background-color: rgba(255, 255, 255, 0.1); 3 | } 4 | 5 | .top-row { 6 | height: 3.5rem; 7 | background-color: rgba(0,0,0,0.4); 8 | } 9 | 10 | .navbar-brand { 11 | font-size: 1.1rem; 12 | } 13 | 14 | .oi { 15 | width: 2rem; 16 | font-size: 1.1rem; 17 | vertical-align: text-top; 18 | top: -2px; 19 | } 20 | 21 | .nav-item { 22 | font-size: 0.9rem; 23 | padding-bottom: 0.5rem; 24 | } 25 | 26 | .nav-item:first-of-type { 27 | padding-top: 1rem; 28 | } 29 | 30 | .nav-item:last-of-type { 31 | padding-bottom: 1rem; 32 | } 33 | 34 | .nav-item ::deep a { 35 | color: #d7d7d7; 36 | border-radius: 4px; 37 | height: 3rem; 38 | display: flex; 39 | align-items: center; 40 | line-height: 3rem; 41 | } 42 | 43 | .nav-item ::deep a.active { 44 | background-color: rgba(255,255,255,0.25); 45 | color: white; 46 | } 47 | 48 | .nav-item ::deep a:hover { 49 | background-color: rgba(255,255,255,0.1); 50 | color: white; 51 | } 52 | 53 | @media (min-width: 641px) { 54 | .navbar-toggler { 55 | display: none; 56 | } 57 | 58 | .collapse { 59 | /* Never collapse the sidebar for wide screens */ 60 | display: block; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /ChartjsDemo/_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.AspNetCore.Components.Web.Virtualization 7 | @using Microsoft.AspNetCore.Components.WebAssembly.Http 8 | @using Microsoft.JSInterop 9 | @using ChartjsDemo 10 | @using ChartjsDemo.Shared 11 | 12 | @using PSC.Blazor.Components.CodeSnippet 13 | 14 | @using PSC.Blazor.Components.Chartjs 15 | @using PSC.Blazor.Components.Chartjs.Enums 16 | @using PSC.Blazor.Components.Chartjs.Models 17 | @using PSC.Blazor.Components.Chartjs.Models.Common 18 | @using PSC.Blazor.Components.Chartjs.Models.Bar 19 | @using PSC.Blazor.Components.Chartjs.Models.Bubble 20 | @using PSC.Blazor.Components.Chartjs.Models.Doughnut 21 | @using PSC.Blazor.Components.Chartjs.Models.Line 22 | @using PSC.Blazor.Components.Chartjs.Models.Pie 23 | @using PSC.Blazor.Components.Chartjs.Models.Polar 24 | @using PSC.Blazor.Components.Chartjs.Models.Radar 25 | @using PSC.Blazor.Components.Chartjs.Models.Scatter -------------------------------------------------------------------------------- /ChartjsDemo/wwwroot/css/open-iconic/ICON-LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Waybury 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /ChartjsDemo/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erossini/BlazorChartjs/57b7faab43a66df3b705223f151ac83af66134f2/ChartjsDemo/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /ChartjsDemo/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erossini/BlazorChartjs/57b7faab43a66df3b705223f151ac83af66134f2/ChartjsDemo/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /ChartjsDemo/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erossini/BlazorChartjs/57b7faab43a66df3b705223f151ac83af66134f2/ChartjsDemo/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /ChartjsDemo/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erossini/BlazorChartjs/57b7faab43a66df3b705223f151ac83af66134f2/ChartjsDemo/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /ChartjsDemo/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erossini/BlazorChartjs/57b7faab43a66df3b705223f151ac83af66134f2/ChartjsDemo/wwwroot/favicon.ico -------------------------------------------------------------------------------- /ChartjsDemo/wwwroot/icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erossini/BlazorChartjs/57b7faab43a66df3b705223f151ac83af66134f2/ChartjsDemo/wwwroot/icon-192.png -------------------------------------------------------------------------------- /ChartjsDemo/wwwroot/icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erossini/BlazorChartjs/57b7faab43a66df3b705223f151ac83af66134f2/ChartjsDemo/wwwroot/icon-512.png -------------------------------------------------------------------------------- /ChartjsDemo/wwwroot/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ChartjsDemo", 3 | "short_name": "ChartjsDemo", 4 | "start_url": "./", 5 | "display": "standalone", 6 | "background_color": "#ffffff", 7 | "theme_color": "#03173d", 8 | "prefer_related_applications": false, 9 | "icons": [ 10 | { 11 | "src": "icon-512.png", 12 | "type": "image/png", 13 | "sizes": "512x512" 14 | }, 15 | { 16 | "src": "icon-192.png", 17 | "type": "image/png", 18 | "sizes": "192x192" 19 | } 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /ChartjsDemo/wwwroot/psc_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erossini/BlazorChartjs/57b7faab43a66df3b705223f151ac83af66134f2/ChartjsDemo/wwwroot/psc_logo.png -------------------------------------------------------------------------------- /ChartjsDemo/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 | -------------------------------------------------------------------------------- /FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: erossini -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Enrico Rossini 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /PSC.Blazor.Components.Chartjs.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.0.31903.59 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PSC.Blazor.Components.Chartjs", "src\PSC.Blazor.Components.Chartjs.csproj", "{9B0704CA-1F56-4F1A-B9FB-FF11F80C6CF2}" 7 | EndProject 8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChartjsDemo", "ChartjsDemo\ChartjsDemo.csproj", "{F723C835-B603-4DC7-9B00-C1845BE8FA20}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {9B0704CA-1F56-4F1A-B9FB-FF11F80C6CF2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {9B0704CA-1F56-4F1A-B9FB-FF11F80C6CF2}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {9B0704CA-1F56-4F1A-B9FB-FF11F80C6CF2}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {9B0704CA-1F56-4F1A-B9FB-FF11F80C6CF2}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {F723C835-B603-4DC7-9B00-C1845BE8FA20}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {F723C835-B603-4DC7-9B00-C1845BE8FA20}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {F723C835-B603-4DC7-9B00-C1845BE8FA20}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {F723C835-B603-4DC7-9B00-C1845BE8FA20}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {1A152847-247F-4CD9-9F11-F64D39CC034F} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /src/Chart.razor: -------------------------------------------------------------------------------- 1 | @inject IJSRuntime JSRuntime 2 | 3 |
5 | 6 |
-------------------------------------------------------------------------------- /src/Chart.razor.css: -------------------------------------------------------------------------------- 1 | .chart-container { 2 | position: relative; 3 | } -------------------------------------------------------------------------------- /src/Enums/Axes.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Enums 2 | { 3 | /// 4 | /// Axes 5 | /// 6 | public struct Axes 7 | { 8 | /// 9 | /// The x 10 | /// 11 | public const string X = "x"; 12 | /// 13 | /// The y 14 | /// 15 | public const string Y = "y"; 16 | /// 17 | /// The default 18 | /// 19 | public const string Default = null; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Enums/ChartType.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Enums 2 | { 3 | /// 4 | /// Defines the chart types. 5 | /// 6 | public struct ChartType 7 | { 8 | /// 9 | /// The bar chart type. 10 | /// 11 | public const string Bar = "bar"; 12 | 13 | /// 14 | /// The line chart type. 15 | /// 16 | public const string Line = "line"; 17 | 18 | /// 19 | /// The pie chart type. 20 | /// 21 | public const string Pie = "pie"; 22 | 23 | /// 24 | /// The doughnut chart type. 25 | /// 26 | public const string Doughnut = "doughnut"; 27 | 28 | /// 29 | /// The radar chart type. 30 | /// 31 | public const string Radar = "radar"; 32 | 33 | /// 34 | /// The bubble chart type. 35 | /// 36 | public const string Bubble = "bubble"; 37 | 38 | /// 39 | /// The polar area chart type. 40 | /// 41 | public const string PolarArea = "polarArea"; 42 | 43 | /// 44 | /// The scatter chart type. 45 | /// 46 | public const string Scatter = "scatter"; 47 | } 48 | } -------------------------------------------------------------------------------- /src/Enums/TimeUnit.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Enums 2 | { 3 | 4 | /// 5 | /// TimeUnit 6 | /// 7 | public struct TimeUnit 8 | { 9 | 10 | /// 11 | /// Millisecond unit. 12 | /// 13 | public const string Millisecond = "millisecond"; 14 | 15 | /// 16 | /// Second unit. 17 | /// 18 | public const string Second = "second"; 19 | 20 | /// 21 | /// Minute unit. 22 | /// 23 | public const string Minute = "minute"; 24 | 25 | /// 26 | /// Hour unit. 27 | /// 28 | public const string Hour = "hour"; 29 | 30 | /// 31 | /// Day unit. 32 | /// 33 | public const string Day = "day"; 34 | 35 | /// 36 | /// Week unit. 37 | /// 38 | public const string Week = "week"; 39 | 40 | /// 41 | /// Month unit. 42 | /// 43 | public const string Month = "month"; 44 | 45 | /// 46 | /// Quarter unit. 47 | /// 48 | public const string Quarter = "quarter"; 49 | 50 | /// 51 | /// Year unit. 52 | /// 53 | public const string Year = "year"; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/Enums/ZoomMode.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Enums 2 | { 3 | /// 4 | /// Struct ZoomMode 5 | /// 6 | public struct ZoomMode 7 | { 8 | 9 | /// 10 | /// x mode. 11 | /// 12 | public const string X = "x"; 13 | 14 | /// 15 | /// y mode. 16 | /// 17 | public const string Y = "y"; 18 | 19 | /// 20 | /// xe mode. 21 | /// 22 | public const string XY = "xy"; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/GlobalUsing.cs: -------------------------------------------------------------------------------- 1 | global using PSC.Blazor.Components.Chartjs.Enums; 2 | global using PSC.Blazor.Components.Chartjs.Interfaces; 3 | global using PSC.Blazor.Components.Chartjs.Models.Common; 4 | global using System; 5 | global using System.Collections.Generic; 6 | global using System.Text.Json.Serialization; 7 | -------------------------------------------------------------------------------- /src/Interfaces/IChartConfig.cs: -------------------------------------------------------------------------------- 1 | using PSC.Blazor.Components.Chartjs.Models.Bar; 2 | using PSC.Blazor.Components.Chartjs.Models.Bubble; 3 | using PSC.Blazor.Components.Chartjs.Models.Doughnut; 4 | using PSC.Blazor.Components.Chartjs.Models.Line; 5 | using PSC.Blazor.Components.Chartjs.Models.Pie; 6 | using PSC.Blazor.Components.Chartjs.Models.Polar; 7 | using PSC.Blazor.Components.Chartjs.Models.Radar; 8 | using PSC.Blazor.Components.Chartjs.Models.Scatter; 9 | 10 | namespace PSC.Blazor.Components.Chartjs.Interfaces 11 | { 12 | public interface IChartConfig 13 | { 14 | string CanvasId { get; } 15 | string Type { get; set; } 16 | IOptions Options { get; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Interfaces/IDataset.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Interfaces 2 | { 3 | /// 4 | /// Interface IDataset 5 | /// 6 | public interface IDataset 7 | { 8 | /// 9 | /// Gets or sets the identifier. 10 | /// 11 | /// The identifier. 12 | string? Id { get; set; } 13 | 14 | /// 15 | /// Gets or sets the type. 16 | /// 17 | /// The type. 18 | ChartType Type { get; set; } 19 | } 20 | 21 | /// 22 | /// Interface IDataset 23 | /// Extends the 24 | /// Extends the 25 | /// 26 | /// 27 | /// 28 | /// 29 | public interface IDataset : IDataset, IList 30 | { 31 | /// 32 | /// Gets or sets the data. 33 | /// 34 | /// The data. 35 | List Data { get; set; } 36 | } 37 | } -------------------------------------------------------------------------------- /src/Interfaces/IOptions.cs: -------------------------------------------------------------------------------- 1 | using PSC.Blazor.Components.Chartjs.Models.Pie; 2 | using PSC.Blazor.Components.Chartjs.Models.Radar; 3 | 4 | namespace PSC.Blazor.Components.Chartjs.Interfaces 5 | { 6 | /// 7 | /// IOptions 8 | /// 9 | public interface IOptions 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Models/Bar/BarChartConfig.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Bar 2 | { 3 | /// 4 | /// Chart config for Bars 5 | /// 6 | public class BarChartConfig : IChartConfig 7 | { 8 | /// 9 | /// Gets the canvas identifier. 10 | /// 11 | /// 12 | /// The canvas identifier. 13 | /// 14 | [JsonIgnore] 15 | public string CanvasId { get; } = Guid.NewGuid().ToString(); 16 | 17 | /// 18 | /// Gets or sets the data. 19 | /// 20 | /// 21 | /// The data. 22 | /// 23 | [JsonPropertyName("data")] 24 | public Data Data { get; set; } = new Data(); 25 | 26 | /// 27 | /// Gets or sets the on animation complete. 28 | /// 29 | /// 30 | /// The on animation complete. 31 | /// 32 | /// 33 | [JsonPropertyName("onAnimationComplete")] 34 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 35 | public string OnAnimationComplete { get; set; } 36 | 37 | /// 38 | /// Gets or sets the options. 39 | /// 40 | /// 41 | /// The options. 42 | /// 43 | [JsonPropertyName("options")] 44 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 45 | public Options Options { get; set; } 46 | 47 | /// 48 | /// Gets the options. 49 | /// 50 | /// 51 | /// The options. 52 | /// 53 | IOptions IChartConfig.Options => this.Options; 54 | 55 | /// 56 | /// Gets or sets the type. 57 | /// 58 | /// 59 | /// The type. 60 | /// 61 | [JsonPropertyName("type")] 62 | public string Type { get; set; } = ChartType.Bar; 63 | } 64 | } -------------------------------------------------------------------------------- /src/Models/Bar/BarData.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Bar 2 | { 3 | public class BarData : Data 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/Models/Bubble/BubbleChartConfig.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Bubble 2 | { 3 | public class BubbleChartConfig : IChartConfig 4 | { 5 | /// 6 | /// Gets the canvas identifier. 7 | /// 8 | /// 9 | /// The canvas identifier. 10 | /// 11 | [JsonIgnore] 12 | public string CanvasId { get; } = Guid.NewGuid().ToString(); 13 | /// 14 | /// Gets or sets the data. 15 | /// 16 | /// 17 | /// The data. 18 | /// 19 | [JsonPropertyName("data")] 20 | public BubbleData Data { get; set; } = new BubbleData(); 21 | 22 | /// 23 | /// Gets or sets the on animation complete. 24 | /// 25 | /// 26 | /// The on animation complete. 27 | /// 28 | /// 29 | [JsonPropertyName("onAnimationComplete")] 30 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 31 | public string OnAnimationComplete { get; set; } 32 | 33 | /// 34 | /// Gets or sets the options. 35 | /// 36 | /// 37 | /// The options. 38 | /// 39 | [JsonPropertyName("options")] 40 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 41 | public Options Options { get; set; } 42 | 43 | /// 44 | /// Gets the options. 45 | /// 46 | /// 47 | /// The options. 48 | /// 49 | IOptions IChartConfig.Options => this.Options; 50 | 51 | /// 52 | /// Gets or sets the type. 53 | /// 54 | /// 55 | /// The type. 56 | /// 57 | [JsonPropertyName("type")] 58 | public string Type { get; set; } = ChartType.Bubble; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/Models/Bubble/BubbleCoords.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Bubble 2 | { 3 | /// 4 | /// Bubble Coords 5 | /// 6 | public class BubbleCoords 7 | { 8 | /// 9 | /// Gets or sets the x. 10 | /// 11 | /// 12 | /// The x. 13 | /// 14 | [JsonPropertyName("x")] 15 | public int X { get; set; } 16 | /// 17 | /// Gets or sets the y. 18 | /// 19 | /// 20 | /// The y. 21 | /// 22 | [JsonPropertyName("y")] 23 | public int Y { get; set; } 24 | /// 25 | /// Gets or sets the r. 26 | /// 27 | /// 28 | /// The r. 29 | /// 30 | [JsonPropertyName("r")] 31 | public int R { get; set; } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Models/Bubble/BubbleData.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Bubble 2 | { 3 | public class BubbleData : Data 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/Models/Bubble/BubbleDataset.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Bubble 2 | { 3 | public class BubbleDataset : CustomDataset 4 | { 5 | /// 6 | /// Gets or sets the color of the background. 7 | /// 8 | /// 9 | /// The color of the background. 10 | /// 11 | [JsonPropertyName("backgroundColor")] 12 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 13 | public string BackgroundColor { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /src/Models/Common/Animations/Animations.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | /// 4 | /// Animations 5 | /// 6 | public class Animations 7 | { 8 | /// 9 | /// Gets or sets the colors. 10 | /// 11 | /// 12 | /// Enables/Disables animation defined by the collection of 'colors' properties 13 | /// 14 | [JsonPropertyName("colors")] 15 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 16 | public bool? Colors { get; set; } 17 | 18 | /// 19 | /// Gets or sets the tension. 20 | /// 21 | /// 22 | /// The tension. 23 | /// 24 | [JsonPropertyName("tension")] 25 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 26 | public Tension? Tension { get; set; } 27 | 28 | /// 29 | /// Gets or sets the colors. 30 | /// 31 | /// 32 | /// Enables/Disables animation defined by the 'x' property 33 | /// 34 | [JsonPropertyName("x")] 35 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 36 | public bool? X { get; set; } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Models/Common/Animations/Tension.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | /// 4 | /// Tension 5 | /// 6 | public class Tension : Animation 7 | { 8 | /// 9 | /// Gets or sets from. 10 | /// 11 | /// 12 | /// From. 13 | /// 14 | [JsonPropertyName("from")] 15 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 16 | public int? From { get; set; } 17 | 18 | /// 19 | /// Gets or sets to. 20 | /// 21 | /// 22 | /// To. 23 | /// 24 | [JsonPropertyName("to")] 25 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 26 | public int? To { get; set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Models/Common/Autocolors.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | public class Autocolors 4 | { 5 | 6 | /// 7 | /// Enable or disable autocolors. 8 | /// 9 | /// 10 | /// The value. 11 | /// 12 | [JsonPropertyName("enabled")] 13 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 14 | public bool? Enabled { get; set; } 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Models/Common/AxesTitle.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | /// 4 | /// Axes Title 5 | /// 6 | public class AxesTitle 7 | { 8 | /// 9 | /// Gets or sets the align. 10 | /// 11 | /// The align. 12 | [JsonIgnore] 13 | public Align Align 14 | { 15 | get => _align; 16 | set 17 | { 18 | _align = value; 19 | AlignString = _align.Value; 20 | } 21 | } 22 | private Align _align; 23 | 24 | /// 25 | /// Gets or sets the align string. 26 | /// 27 | /// The align string. 28 | [JsonPropertyName("align")] 29 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 30 | public string AlignString { get; set; } 31 | 32 | /// 33 | /// Gets or sets the color. 34 | /// 35 | /// The color. 36 | [JsonPropertyName("color")] 37 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 38 | public string Color { get; set; } 39 | 40 | /// 41 | /// Gets or sets the font. 42 | /// 43 | /// The font. 44 | [JsonPropertyName("font")] 45 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 46 | public Font Font { get; set; } 47 | 48 | /// 49 | /// Gets or sets the display. 50 | /// 51 | /// 52 | /// The display. 53 | /// 54 | [JsonPropertyName("display")] 55 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 56 | public bool? Display { get; set; } 57 | 58 | /// 59 | /// Gets or sets the text. 60 | /// 61 | /// 62 | /// The text. 63 | /// 64 | [JsonPropertyName("text")] 65 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 66 | public string Text { get; set; } 67 | } 68 | } -------------------------------------------------------------------------------- /src/Models/Common/Callback/CallbackGenericContext.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | /// 4 | /// Callback Generic Context 5 | /// 6 | public readonly record struct CallbackGenericContext(int DatasetIndex, int DataIndex, decimal Value) 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Models/Common/Callback/Callbacks.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | /// 4 | /// Callbacks 5 | /// 6 | public sealed class Callbacks 7 | { 8 | // https://www.chartjs.org/docs/3.7.1/configuration/tooltip.html 9 | 10 | /// 11 | /// Gets a value indicating whether this instance has label. 12 | /// 13 | /// 14 | /// true if this instance has label; otherwise, false. 15 | /// 16 | [JsonInclude] 17 | [JsonPropertyName("hasLabel")] 18 | public bool HasLabel => Label != null; 19 | 20 | /// 21 | /// Gets or sets the label. 22 | /// 23 | /// 24 | /// The label. 25 | /// 26 | [JsonIgnore] 27 | public Func? Label { get; set; } 28 | 29 | /// 30 | /// Gets a value indicating whether this instance has custom title. 31 | /// 32 | /// true if this instance has custom title; otherwise, false. 33 | [JsonInclude] 34 | [JsonPropertyName("hasCustomTitle")] 35 | public bool HasCustomTitle => Title != null; 36 | 37 | /// 38 | /// Gets or sets the title. 39 | /// 40 | /// The title. 41 | [JsonIgnore] 42 | public Func? Title { get; set; } 43 | } 44 | } -------------------------------------------------------------------------------- /src/Models/Common/Callback/TicksCallbackContext.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common { 2 | /// 3 | /// Callback Generic Context 4 | /// 5 | public readonly record struct TicksCallbackContext(decimal Value, int Index, decimal[] Ticks) { 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Models/Common/Colors.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | /// 4 | /// Class Colors. 5 | /// 6 | public class Colors 7 | { 8 | 9 | /// 10 | /// Enable or disable autocolors. 11 | /// 12 | /// 13 | /// The value. 14 | /// 15 | [JsonPropertyName("enabled")] 16 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 17 | public bool? Enabled { get; set; } 18 | 19 | /// 20 | /// Enable or disable autocolors. 21 | /// 22 | /// 23 | /// The value. 24 | /// 25 | [JsonPropertyName("forceOverride")] 26 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 27 | public bool? ForceOverride { get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Models/Common/Context/ClickValue.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | /// 4 | /// Class ClickValue. 5 | /// 6 | public readonly record struct ClickValue(int DatasetIndex, int ValueIndex, decimal Value) 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Models/Common/Context/HoverContext.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | /// 4 | /// Hover Context 5 | /// 6 | public readonly record struct HoverContext(decimal DataX, decimal DataY) 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /src/Models/Common/Context/LegendClickContext.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 PSC.Blazor.Components.Chartjs.Models.Common 8 | { 9 | /// 10 | /// Legend Click Context. 11 | /// 12 | public readonly record struct LegendClickContext(int LegendIndex, string LegendText) 13 | { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Models/Common/Context/LegendFilterContext.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | public readonly record struct LegendFilterContext(LegendItem Item, Data Data) 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/Models/Common/Context/ZoomContext.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | /// 4 | /// Class ZoomContext. 5 | /// 6 | public readonly record struct ZoomContext(string id) 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /src/Models/Common/Crosshair.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | /// 4 | /// Crosshair 5 | /// 6 | public sealed class Crosshair 7 | { 8 | /// 9 | /// Gets or sets the cursor. 10 | /// 11 | /// 12 | /// The cursor. 13 | /// 14 | [JsonPropertyName("cursor")] 15 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 16 | public string? Cursor { get; set; } 17 | 18 | /// 19 | /// Gets or sets the horizontal. 20 | /// 21 | /// 22 | /// The horizontal. 23 | /// 24 | [JsonPropertyName("horizontal")] 25 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 26 | public CrosshairLine? Horizontal { get; set; } 27 | 28 | /// 29 | /// Gets or sets the vertical. 30 | /// 31 | /// 32 | /// The vertical. 33 | /// 34 | [JsonPropertyName("vertical")] 35 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 36 | public CrosshairLine? Vertical { get; set; } 37 | } 38 | } -------------------------------------------------------------------------------- /src/Models/Common/CrosshairLine.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | /// 4 | /// Crosshair line 5 | /// 6 | public sealed class CrosshairLine 7 | { 8 | /// 9 | /// Gets or sets the color. 10 | /// 11 | /// 12 | /// The color. 13 | /// 14 | [JsonPropertyName("color")] 15 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 16 | public string? Color { get; set; } 17 | 18 | /// 19 | /// Gets or sets the dash. 20 | /// 21 | /// 22 | /// The dash. 23 | /// 24 | [JsonPropertyName("dash")] 25 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 26 | public int[]? Dash { get; set; } 27 | 28 | /// 29 | /// Gets or sets the width. 30 | /// 31 | /// 32 | /// The width. 33 | /// 34 | [JsonPropertyName("width")] 35 | public int Width { get; set; } = 1; 36 | } 37 | } -------------------------------------------------------------------------------- /src/Models/Common/CustomDataset.cs: -------------------------------------------------------------------------------- 1 | using PSC.Blazor.Components.Chartjs.Models.Bubble; 2 | using PSC.Blazor.Components.Chartjs.Models.Scatter; 3 | 4 | namespace PSC.Blazor.Components.Chartjs.Models.Common 5 | { 6 | [JsonDerivedType(typeof(CustomDataset), typeDiscriminator: "base")] 7 | [JsonDerivedType(typeof(BubbleDataset), typeDiscriminator: "bubbleData")] 8 | [JsonDerivedType(typeof(ScatterDataset), typeDiscriminator: "scatterData")] 9 | public class CustomDataset 10 | { 11 | /// 12 | /// Gets or sets the label. 13 | /// 14 | /// 15 | /// The label. 16 | /// 17 | [JsonPropertyName("label")] 18 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 19 | public string Label { get; set; } 20 | } 21 | /// 22 | /// Datatset for charts 23 | /// 24 | public class CustomDataset : CustomDataset where T : class 25 | { 26 | /// 27 | /// Gets or sets the data. 28 | /// 29 | /// 30 | /// The data. 31 | /// 32 | [JsonPropertyName("data")] 33 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 34 | public virtual List Data { get; set; } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Models/Common/Data.cs: -------------------------------------------------------------------------------- 1 | using PSC.Blazor.Components.Chartjs.Models.Bar; 2 | using PSC.Blazor.Components.Chartjs.Models.Bubble; 3 | using PSC.Blazor.Components.Chartjs.Models.Doughnut; 4 | using PSC.Blazor.Components.Chartjs.Models.Line; 5 | using PSC.Blazor.Components.Chartjs.Models.Pie; 6 | using PSC.Blazor.Components.Chartjs.Models.Polar; 7 | using PSC.Blazor.Components.Chartjs.Models.Radar; 8 | using PSC.Blazor.Components.Chartjs.Models.Scatter; 9 | 10 | namespace PSC.Blazor.Components.Chartjs.Models.Common 11 | { 12 | /// 13 | /// Data for Charts 14 | /// 15 | [JsonDerivedType(typeof(Data), typeDiscriminator: "base")] 16 | [JsonDerivedType(typeof(BarData), typeDiscriminator: "barData")] 17 | [JsonDerivedType(typeof(DoughnutData), typeDiscriminator: "doughnutData")] 18 | [JsonDerivedType(typeof(LineData), typeDiscriminator: "lineData")] 19 | [JsonDerivedType(typeof(PieData), typeDiscriminator: "pieData")] 20 | [JsonDerivedType(typeof(PolarData), typeDiscriminator: "polarData")] 21 | [JsonDerivedType(typeof(RadarData), typeDiscriminator: "radarData")] 22 | [JsonDerivedType(typeof(BubbleData), typeDiscriminator: "bubbleData")] 23 | [JsonDerivedType(typeof(ScatterData), typeDiscriminator: "scatterData")] 24 | public class Data 25 | { 26 | /// 27 | /// Gets or sets the labels. 28 | /// 29 | /// 30 | /// The labels. 31 | /// 32 | [JsonPropertyName("labels")] 33 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 34 | public List Labels { get; set; } = new List(); 35 | } 36 | 37 | /// 38 | /// Data for Charts 39 | /// 40 | public class Data : Data where T : class 41 | { 42 | /// 43 | /// Gets or sets the datasets. 44 | /// 45 | /// 46 | /// The datasets. 47 | /// 48 | [JsonPropertyName("datasets")] 49 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 50 | public List Datasets { get; set; } = new List(); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/Models/Common/Elements.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | /// 4 | /// Elements 5 | /// 6 | public sealed class Elements 7 | { 8 | /// 9 | /// Gets or sets the line. 10 | /// 11 | /// 12 | /// The line. 13 | /// 14 | [JsonPropertyName("line")] 15 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 16 | public Line? Line { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /src/Models/Common/Font.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | /// 4 | /// Font 5 | /// 6 | public class Font 7 | { 8 | /// 9 | /// Gets or sets the family. 10 | /// 11 | /// 12 | /// Default font family for all text, follows CSS font-family options 13 | /// 14 | [JsonPropertyName("family")] 15 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 16 | public string? Family { get; set; } 17 | 18 | /// Gets or sets the height of the line. 19 | /// Height of an individual line of text (see MDN) 20 | [JsonPropertyName("lineHeight")] 21 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 22 | public string? LineHeight { get; set; } 23 | 24 | /// 25 | /// Gets or sets the size. 26 | /// 27 | /// 28 | /// Default font size (in px) for text. Does not apply to radialLinear scale point labels. 29 | /// 30 | [JsonPropertyName("size")] 31 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 32 | public int? Size { get; set; } 33 | 34 | /// 35 | /// Gets or sets the style. 36 | /// 37 | /// 38 | /// Default font style. Does not apply to tooltip title or footer. Does not apply to chart title. 39 | /// Follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit). 40 | /// 41 | [JsonPropertyName("style")] 42 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 43 | public string? Style { get; set; } 44 | 45 | /// Gets or sets the weight. 46 | /// Default font weight (boldness) (see MDN) 47 | [JsonPropertyName("weight")] 48 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 49 | public string? Weight { get; set; } 50 | } 51 | } -------------------------------------------------------------------------------- /src/Models/Common/Grid.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | /// 4 | /// Grid 5 | /// 6 | public class Grid 7 | { 8 | /// 9 | /// Gets or sets the color. 10 | /// 11 | /// 12 | /// The color. 13 | /// 14 | [JsonPropertyName("color")] 15 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 16 | public string? Color { get; set; } 17 | 18 | /// 19 | /// Gets or sets a value indicating whether this is display. 20 | /// 21 | /// 22 | /// true if display; otherwise, false. 23 | /// 24 | [JsonPropertyName("display")] 25 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 26 | public bool? Display { get; set; } 27 | 28 | /// 29 | /// Gets or sets a value indicating whether [draw border]. 30 | /// 31 | /// 32 | /// true if [draw border]; otherwise, false. 33 | /// 34 | [JsonPropertyName("drawBorder")] 35 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 36 | public bool? DrawBorder { get; set; } 37 | 38 | /// 39 | /// Gets or sets a value indicating whether [draw on chart area]. 40 | /// 41 | /// 42 | /// true if [draw on chart area]; otherwise, false. 43 | /// 44 | [JsonPropertyName("drawOnChartArea")] 45 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 46 | public bool? DrawOnChartArea { get; set; } 47 | 48 | /// 49 | /// Gets or sets a value indicating whether [draw ticks]. 50 | /// 51 | /// 52 | /// true if [draw ticks]; otherwise, false. 53 | /// 54 | [JsonPropertyName("drawTicks")] 55 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 56 | public bool? DrawTicks { get; set; } 57 | } 58 | } -------------------------------------------------------------------------------- /src/Models/Common/LegendItem.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | /// 4 | /// Legend Item 5 | /// 6 | public class LegendItem 7 | { 8 | //https://www.chartjs.org/docs/latest/configuration/legend.html#legend-item-interface 9 | 10 | [JsonPropertyName("text")] 11 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 12 | public string? Text { get; set; } 13 | [JsonPropertyName("borderRadius")] 14 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 15 | public decimal? BorderRadius { get; set; } 16 | [JsonPropertyName("datasetIndex")] 17 | public int DatasetIndex { get; set; } 18 | [JsonPropertyName("fillStyle")] 19 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 20 | public string? FillStyle { get; set; } 21 | [JsonPropertyName("fontColor")] 22 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 23 | public string? FontColor { get; set; } 24 | [JsonPropertyName("hidden")] 25 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 26 | public bool? Hidden { get; set; } 27 | [JsonPropertyName("lineCap")] 28 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 29 | public string? LineCap { get; set; } 30 | [JsonPropertyName("lineDash")] 31 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 32 | public List? LineDash { get; set; } 33 | [JsonPropertyName("lineDashOffset")] 34 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 35 | public decimal? LineDashOffset { get; set; } 36 | [JsonPropertyName("lineJoin")] 37 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 38 | public string? LineJoin { get; set; } 39 | [JsonPropertyName("lineWidth")] 40 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 41 | public decimal? LineWidth { get; set; } 42 | [JsonPropertyName("rotation")] 43 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 44 | public int? Rotation { get; set; } 45 | 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/Models/Common/LegendLabels.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | /// 4 | /// Legend Label Configuration 5 | /// 6 | public class LegendLabels 7 | { 8 | //https://www.chartjs.org/docs/latest/configuration/legend.html#legend-label-configuration 9 | 10 | /// 11 | /// Gets a value indicating whether this instance has filter. 12 | /// 13 | /// 14 | /// true if this instance has filter; otherwise, false. 15 | /// 16 | [JsonInclude] 17 | [JsonPropertyName("hasFilter")] 18 | public bool HasFilter => Filter != null; 19 | 20 | /// 21 | /// Gets or sets the filter. 22 | /// 23 | /// 24 | /// The filter. 25 | /// 26 | [JsonIgnore] 27 | public Func? Filter { get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Models/Common/Line.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | public sealed class Line 4 | { 5 | /// 6 | /// Gets or sets the color of the border. 7 | /// 8 | /// 9 | /// The color of the border. 10 | /// 11 | [JsonPropertyName("borderColor")] 12 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 13 | public string? BorderColor { get; set; } 14 | 15 | /// 16 | /// Gets or sets the width of the border. 17 | /// 18 | /// 19 | /// The width of the border. 20 | /// 21 | [JsonPropertyName("borderWidth")] 22 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 23 | public double? BorderWidth { get; set; } 24 | 25 | } 26 | } -------------------------------------------------------------------------------- /src/Models/Common/Parsing.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | /// 4 | /// Class Parsing. 5 | /// 6 | public class Parsing 7 | { 8 | /// 9 | /// Gets or sets the xAxisKey. 10 | /// 11 | /// 12 | /// The value. 13 | /// 14 | [JsonPropertyName("xAxisKey")] 15 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 16 | public string? xAxisKey { get; set; } 17 | 18 | 19 | /// 20 | /// Gets or sets the yAxisKey. 21 | /// 22 | /// 23 | /// The value. 24 | /// 25 | [JsonPropertyName("yAxisKey")] 26 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 27 | public string? yAxisKey { get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Models/Common/Plugins.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | /// 4 | /// Plugins 5 | /// 6 | public class Plugins 7 | { 8 | /// 9 | /// Gets or sets the data labels. 10 | /// 11 | /// The data labels. 12 | [JsonPropertyName("datalabels")] 13 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 14 | public DataLabels? DataLabels { get; set; } 15 | 16 | /// 17 | /// Gets or sets the legend. 18 | /// 19 | /// 20 | /// The legend. 21 | /// 22 | [JsonPropertyName("legend")] 23 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 24 | public Legend? Legend { get; set; } = new Legend(); 25 | 26 | /// 27 | /// Gets or sets the tooltip. 28 | /// 29 | /// 30 | /// The tooltip. 31 | /// 32 | [JsonPropertyName("tooltip")] 33 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 34 | public Tooltip? Tooltip { get; set; } 35 | 36 | /// 37 | /// Gets or sets the crosshair. 38 | /// 39 | /// 40 | /// The crosshair. 41 | /// 42 | [JsonPropertyName("crosshair")] 43 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 44 | public Crosshair? Crosshair { get; set; } 45 | 46 | /// 47 | /// Gets or sets the title. 48 | /// 49 | /// 50 | /// The title. 51 | /// 52 | [JsonPropertyName("title")] 53 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 54 | public Title? Title { get; set; } 55 | 56 | /// 57 | /// Gets or sets the zoom. 58 | /// 59 | /// 60 | /// The zoom. 61 | /// 62 | [JsonPropertyName("zoom")] 63 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 64 | public Zoom? Zoom { get; set; } 65 | } 66 | } -------------------------------------------------------------------------------- /src/Models/Common/Scales.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | /// 4 | /// Default scales identifiers for Bar 5 | /// 6 | public static class Scales 7 | { 8 | /// 9 | /// Gets the x axis identifier. 10 | /// 11 | /// 12 | /// The x axis identifier. 13 | /// 14 | public static string XAxisId => "x"; 15 | 16 | /// 17 | /// Gets the y axis identifier. 18 | /// 19 | /// 20 | /// The y axis identifier. 21 | /// 22 | public static string YAxisId => "y"; 23 | 24 | /// 25 | /// Gets the y2 axis identifier. 26 | /// 27 | /// 28 | /// The y axis identifier. 29 | /// 30 | public static string Y2AxisId => "y2"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Models/Common/StringEnums/Align.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | /// 4 | /// Class Align. 5 | /// 6 | public class Align 7 | { 8 | /// 9 | /// Initializes a new instance of the class. 10 | /// 11 | /// The value. 12 | private Align(string value) 13 | { Value = value; } 14 | 15 | /// 16 | /// Start 17 | /// 18 | /// 19 | /// Start 20 | /// 21 | public static Align Start 22 | { get { return new Align("start"); } } 23 | 24 | /// 25 | /// Center 26 | /// 27 | /// 28 | /// Center 29 | /// 30 | public static Align Center 31 | { get { return new Align("center"); } } 32 | 33 | /// 34 | /// End 35 | /// 36 | /// 37 | /// End 38 | /// 39 | public static Align End 40 | { get { return new Align("end"); } } 41 | 42 | /// 43 | /// Gets the value. 44 | /// 45 | /// 46 | /// The value. 47 | /// 48 | public string Value { get; private set; } 49 | } 50 | } -------------------------------------------------------------------------------- /src/Models/Common/StringEnums/AxisInteractions.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | /// 4 | /// Class AxisInteractions. 5 | /// 6 | public class AxisInteractions 7 | { 8 | /// 9 | /// Initializes a new instance of the class. 10 | /// 11 | /// The value. 12 | private AxisInteractions(string value) 13 | { Value = value; } 14 | 15 | /// 16 | /// Gets the r. 17 | /// 18 | /// The r. 19 | public static AxisInteractions R 20 | { get { return new AxisInteractions("r"); } } 21 | 22 | /// 23 | /// X 24 | /// 25 | /// 26 | /// X 27 | /// 28 | public static AxisInteractions X 29 | { get { return new AxisInteractions("x"); } } 30 | 31 | /// 32 | /// Gets the xy. 33 | /// 34 | /// The xy. 35 | public static AxisInteractions XY 36 | { get { return new AxisInteractions("xy"); } } 37 | 38 | /// 39 | /// Gets the y. 40 | /// 41 | /// The y. 42 | public static AxisInteractions Y 43 | { get { return new AxisInteractions("y"); } } 44 | /// 45 | /// Gets the value. 46 | /// 47 | /// The value. 48 | public string Value { get; private set; } 49 | } 50 | } -------------------------------------------------------------------------------- /src/Models/Common/StringEnums/CrossAlign.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models 2 | { 3 | /// 4 | /// Point Style 5 | /// 6 | public class CrossAlign 7 | { 8 | /// 9 | /// Initializes a new instance of the class. 10 | /// 11 | /// The value. 12 | private CrossAlign(string value) { Value = value; } 13 | 14 | /// 15 | /// Near 16 | /// 17 | /// 18 | /// Near 19 | /// 20 | public static CrossAlign Near { get { return new CrossAlign("near"); } } 21 | 22 | /// 23 | /// Center 24 | /// 25 | /// 26 | /// Center 27 | /// 28 | public static CrossAlign Center { get { return new CrossAlign("center"); } } 29 | 30 | /// 31 | /// Far 32 | /// 33 | /// 34 | /// Far 35 | /// 36 | public static CrossAlign Far { get { return new CrossAlign("far"); } } 37 | 38 | /// 39 | /// Gets the value. 40 | /// 41 | /// 42 | /// The value. 43 | /// 44 | public string Value { get; private set; } 45 | } 46 | } -------------------------------------------------------------------------------- /src/Models/Common/StringEnums/CubicInterpolationMode.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | /// 4 | /// Class CubicInterpolationMode. 5 | /// 6 | public class CubicInterpolationMode 7 | { 8 | /// 9 | /// Initializes a new instance of the class. 10 | /// 11 | /// The value. 12 | private CubicInterpolationMode(string value) { Value = value; } 13 | 14 | /// 15 | /// Gets the defaut. 16 | /// 17 | /// The defaut. 18 | public static CubicInterpolationMode Default { get { return new CubicInterpolationMode("default"); } } 19 | 20 | /// 21 | /// Gets the monotone. 22 | /// 23 | /// The monotone. 24 | public static CubicInterpolationMode Monotone { get { return new CubicInterpolationMode("monotone"); } } 25 | 26 | /// 27 | /// Gets the value. 28 | /// 29 | /// 30 | /// The value. 31 | /// 32 | public string Value { get; private set; } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Models/Common/StringEnums/DatalabelsAnchor.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | /// 4 | /// Class DatalabelsAnchor. 5 | /// 6 | public class DatalabelsAnchor 7 | { 8 | /// 9 | /// Initializes a new instance of the class. 10 | /// 11 | /// The value. 12 | private DatalabelsAnchor(string value) 13 | { Value = value; } 14 | 15 | /// 16 | /// Start 17 | /// 18 | /// 19 | /// Start 20 | /// 21 | public static DatalabelsAnchor Start 22 | { get { return new DatalabelsAnchor("start"); } } 23 | 24 | /// 25 | /// Center 26 | /// 27 | /// 28 | /// Center 29 | /// 30 | public static DatalabelsAnchor Center 31 | { get { return new DatalabelsAnchor("center"); } } 32 | 33 | /// 34 | /// End 35 | /// 36 | /// 37 | /// End 38 | /// 39 | public static DatalabelsAnchor End 40 | { get { return new DatalabelsAnchor("end"); } } 41 | 42 | /// 43 | /// Gets the value. 44 | /// 45 | /// 46 | /// The value. 47 | /// 48 | public string Value { get; private set; } 49 | } 50 | } -------------------------------------------------------------------------------- /src/Models/Common/StringEnums/DatalabelsTextAlign.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | /// 4 | /// Class DatalabelsAlign. 5 | /// 6 | public class DatalabelsTextAlign 7 | { 8 | /// 9 | /// Initializes a new instance of the class. 10 | /// 11 | /// The value. 12 | private DatalabelsTextAlign(string value) 13 | { Value = value; } 14 | 15 | /// 16 | /// Center 17 | /// 18 | /// 19 | /// Center 20 | /// 21 | public static DatalabelsTextAlign Center 22 | { get { return new DatalabelsTextAlign("center"); } } 23 | 24 | /// 25 | /// End 26 | /// 27 | /// 28 | /// End 29 | /// 30 | public static DatalabelsTextAlign End 31 | { get { return new DatalabelsTextAlign("end"); } } 32 | 33 | /// 34 | /// Gets the left. 35 | /// 36 | /// The left. 37 | public static DatalabelsTextAlign Left 38 | { get { return new DatalabelsTextAlign("left"); } } 39 | 40 | /// 41 | /// Gets the right. 42 | /// 43 | /// The right. 44 | public static DatalabelsTextAlign Right 45 | { get { return new DatalabelsTextAlign("right"); } } 46 | 47 | /// 48 | /// Start 49 | /// 50 | /// 51 | /// Start 52 | /// 53 | public static DatalabelsTextAlign Start 54 | { get { return new DatalabelsTextAlign("start"); } } 55 | 56 | /// 57 | /// Gets the value. 58 | /// 59 | /// 60 | /// The value. 61 | /// 62 | public string Value { get; private set; } 63 | } 64 | } -------------------------------------------------------------------------------- /src/Models/Common/StringEnums/InteractionMode.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | /// 4 | /// Class InteractionMode. 5 | /// 6 | public class InteractionMode 7 | { 8 | /// 9 | /// Initializes a new instance of the class. 10 | /// 11 | /// The value. 12 | private InteractionMode(string value) 13 | { Value = value; } 14 | 15 | /// 16 | /// Gets the dataset. 17 | /// 18 | /// The dataset. 19 | public static InteractionMode Dataset 20 | { get { return new InteractionMode("dataset"); } } 21 | 22 | /// 23 | /// Gets the index. 24 | /// 25 | /// The index. 26 | public static InteractionMode Index 27 | { get { return new InteractionMode("index"); } } 28 | 29 | /// 30 | /// Gets the nearest. 31 | /// 32 | /// The nearest. 33 | public static InteractionMode Nearest 34 | { get { return new InteractionMode("nearest"); } } 35 | 36 | /// 37 | /// Gets the point. 38 | /// 39 | /// The point. 40 | public static InteractionMode Point 41 | { get { return new InteractionMode("point"); } } 42 | /// 43 | /// Gets the x. 44 | /// 45 | /// The x. 46 | public static InteractionMode X 47 | { get { return new InteractionMode("x"); } } 48 | 49 | /// 50 | /// Gets the y. 51 | /// 52 | /// The y. 53 | public static InteractionMode Y 54 | { get { return new InteractionMode("y"); } } 55 | 56 | /// 57 | /// Gets the value. 58 | /// 59 | /// The value. 60 | public string Value { get; private set; } 61 | } 62 | } -------------------------------------------------------------------------------- /src/Models/Common/StringEnums/LegendPosition.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | public class LegendPosition 4 | { 5 | /// 6 | /// Initializes a new instance of the class. 7 | /// 8 | /// The value. 9 | private LegendPosition(string value) 10 | { Value = value; } 11 | 12 | /// 13 | /// Bar 14 | /// 15 | /// 16 | /// Bar 17 | /// 18 | public static LegendPosition Bar 19 | { get { return new LegendPosition("bar"); } } 20 | 21 | /// 22 | /// Bottom 23 | /// 24 | /// 25 | /// Bottom 26 | /// 27 | public static LegendPosition Bottom 28 | { get { return new LegendPosition("bottom"); } } 29 | 30 | /// 31 | /// Chart area 32 | /// 33 | /// 34 | /// Chart area 35 | /// 36 | public static LegendPosition ChartArea 37 | { get { return new LegendPosition("chartArea"); } } 38 | 39 | /// 40 | /// Left 41 | /// 42 | /// 43 | /// Left 44 | /// 45 | public static LegendPosition Left 46 | { get { return new LegendPosition("left"); } } 47 | 48 | /// 49 | /// Right. 50 | /// 51 | /// 52 | /// Right 53 | /// 54 | public static LegendPosition Right 55 | { get { return new LegendPosition("right"); } } 56 | 57 | /// 58 | /// Gets the value. 59 | /// 60 | /// 61 | /// The value. 62 | /// 63 | public string Value { get; private set; } 64 | } 65 | } -------------------------------------------------------------------------------- /src/Models/Common/StringEnums/Position.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | public class Position 4 | { 5 | /// 6 | /// Initializes a new instance of the class. 7 | /// 8 | /// The value. 9 | private Position(string value) { Value = value; } 10 | 11 | /// 12 | /// Gets the value. 13 | /// 14 | /// 15 | /// The value. 16 | /// 17 | public string Value { get; private set; } 18 | 19 | /// 20 | /// Top. 21 | /// 22 | /// 23 | /// Top. 24 | /// 25 | public static Position Top { get { return new Position("top"); } } 26 | 27 | /// 28 | /// Left. 29 | /// 30 | /// 31 | /// Left. 32 | /// 33 | public static Position Left { get { return new Position("left"); } } 34 | 35 | /// 36 | /// Bottom. 37 | /// 38 | /// 39 | /// Bottom. 40 | /// 41 | public static Position Bottom { get { return new Position("bottom"); } } 42 | 43 | /// 44 | /// Right. 45 | /// 46 | /// 47 | /// Right. 48 | /// 49 | public static Position Right { get { return new Position("right"); } } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/Models/Common/StringEnums/StepMode.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 PSC.Blazor.Components.Chartjs.Models.Common.StringEnums 8 | { 9 | /// 10 | /// Class StepMode. 11 | /// 12 | public class StepMode 13 | { 14 | /// 15 | /// Initializes a new instance of the class. 16 | /// 17 | /// The value. 18 | private StepMode(string value) { Value = value; } 19 | 20 | /// 21 | /// Gets the false (default). 22 | /// 23 | /// 24 | /// The false. 25 | /// 26 | public static StepMode False { get { return new StepMode("false"); } } 27 | 28 | /// 29 | /// Stepped line in default mode (Before). 30 | /// 31 | /// 32 | /// true. 33 | /// 34 | public static StepMode True { get { return new StepMode("true"); } } 35 | 36 | /// 37 | /// Line rises before the point. 38 | /// 39 | /// 40 | /// before. 41 | /// 42 | public static StepMode Before { get { return new StepMode("before"); } } 43 | 44 | /// 45 | /// Line rises after point. 46 | /// 47 | /// 48 | /// after. 49 | /// 50 | public static StepMode After { get { return new StepMode("after"); } } 51 | 52 | /// 53 | /// Line rises before and falls after the point. 54 | /// 55 | /// 56 | /// middle. 57 | /// 58 | public static StepMode Middle { get { return new StepMode("middle"); } } 59 | 60 | /// 61 | /// Gets the value. 62 | /// 63 | /// 64 | /// The value. 65 | /// 66 | public string Value { get; private set; } 67 | } 68 | } -------------------------------------------------------------------------------- /src/Models/Common/StringEnums/TextDirection.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | /// 4 | /// Class TextDirection. 5 | /// 6 | public class TextDirection 7 | { 8 | /// 9 | /// Initializes a new instance of the class. 10 | /// 11 | /// The value. 12 | private TextDirection(string value) 13 | { Value = value; } 14 | 15 | /// 16 | /// Gets the left to right. 17 | /// 18 | /// The LTR. 19 | public static TextDirection LTR 20 | { get { return new TextDirection("ltr"); } } 21 | 22 | /// 23 | /// Gets the right to left. 24 | /// 25 | /// The RTL. 26 | public static TextDirection RTL 27 | { get { return new TextDirection("rtl"); } } 28 | 29 | /// 30 | /// Gets the value. 31 | /// 32 | /// 33 | /// The value. 34 | /// 35 | public string Value { get; private set; } 36 | } 37 | } -------------------------------------------------------------------------------- /src/Models/Common/Tooltip.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | /// 4 | /// Tooltip 5 | /// 6 | public sealed class Tooltip 7 | { 8 | /// 9 | /// Gets or sets the callbacks. 10 | /// 11 | /// 12 | /// The callbacks. 13 | /// 14 | [JsonPropertyName("callbacks")] 15 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 16 | public Callbacks? Callbacks { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /src/Models/Common/Zoom/Limits.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | /// 4 | /// Limits 5 | /// 6 | public class Limits 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Models/Common/Zoom/Pan.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | /// 4 | /// Pan 5 | /// 6 | public class Pan 7 | { 8 | /// 9 | /// Gets or sets enable panning 10 | /// 11 | /// 12 | /// The enabled. 13 | /// 14 | [JsonPropertyName("enabled")] 15 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 16 | public bool? Enabled { get; set; } 17 | 18 | /// 19 | /// Gets or sets the mode how allowed panning directions 20 | /// 21 | /// 22 | /// The mode can have one of those values: x, y, xy (default) 23 | /// 24 | [JsonPropertyName("mode")] 25 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 26 | public string? Mode { get; set; } = "xy"; 27 | 28 | /// Gets or sets the modifier key. 29 | /// Modifier key required for panning with mouse 30 | /// The modifier key can have one of those values: ctrl, alt, shift, meta. Default: null 31 | [JsonPropertyName("modifierKey")] 32 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 33 | public string? ModifierKey { get; set; } 34 | 35 | /// 36 | /// Gets or sets the over scale mode. 37 | /// Which of the enabled panning directions should only be available when the mouse cursor is over a scale for that axis. 38 | /// 39 | /// 40 | /// The over scale mode can have one of those values: x, y, xy. Default: Undefined 41 | /// 42 | [JsonPropertyName("overScaleMode")] 43 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 44 | public string? OverScaleMode { get; set; } 45 | 46 | /// 47 | /// Gets or sets the threshold. 48 | /// 49 | /// 50 | /// The threshold. Default: 10 51 | /// 52 | [JsonPropertyName("threshold")] 53 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] 54 | public int Threshold { get; set; } = 10; 55 | } 56 | } -------------------------------------------------------------------------------- /src/Models/Common/Zoom/Pinch.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | /// 4 | /// Pinch 5 | /// 6 | public class Pinch 7 | { 8 | /// 9 | /// Gets or sets enable zooming via pinch 10 | /// 11 | /// 12 | /// The enabled. 13 | /// 14 | [JsonPropertyName("enabled")] 15 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 16 | public bool? Enabled { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Models/Common/Zoom/Wheel.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | /// 4 | /// Wheel 5 | /// 6 | public class Wheel 7 | { 8 | /// 9 | /// Gets or sets zooming via mouse wheel 10 | /// 11 | /// 12 | /// The enabled. 13 | /// 14 | [JsonPropertyName("enabled")] 15 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 16 | public bool? Enabled { get; set; } 17 | 18 | /// Gets or sets the modifier key. 19 | /// Modifier key required for panning with mouse 20 | /// The modifier key can have one of those values: ctrl, alt, shift, meta. Default: null 21 | [JsonPropertyName("modifierKey")] 22 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 23 | public string? ModifierKey { get; set; } 24 | 25 | /// 26 | /// Gets or sets the factor of zoom speed via mouse wheel 27 | /// 28 | /// 29 | /// The factor of zoom speed via mouse wheel. Default: 0.1M 30 | /// 31 | [JsonPropertyName("speed")] 32 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] 33 | public decimal Speed { get; set; } = 0.1M; 34 | } 35 | } -------------------------------------------------------------------------------- /src/Models/Common/Zoom/Zoom.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | /// 4 | /// Zoom 5 | /// 6 | public class Zoom 7 | { 8 | /// 9 | /// Gets or sets zooming via mouse wheel 10 | /// 11 | /// 12 | /// The enabled. 13 | /// 14 | [JsonPropertyName("enabled")] 15 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 16 | public bool? Enabled { get; set; } 17 | 18 | /// 19 | /// Gets or sets the limits. 20 | /// 21 | /// 22 | /// The limits. 23 | /// 24 | [JsonPropertyName("limits")] 25 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 26 | public Limits? Limits { get; set; } 27 | 28 | /// 29 | /// Gets or sets the zoom direction 30 | /// 31 | /// 32 | /// The mode. Values: x, y, xy 33 | /// 34 | [JsonPropertyName("mode")] 35 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 36 | public string? Mode { get; set; } = "xy"; 37 | 38 | /// 39 | /// Gets or sets the over scale mode. 40 | /// 41 | /// 42 | /// The over scale mode. Values: x, y, xy 43 | /// 44 | [JsonPropertyName("overScaleMode")] 45 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 46 | public string? OverScaleMode { get; set; } 47 | 48 | /// 49 | /// Gets or sets the pan. 50 | /// 51 | /// 52 | /// The pan. 53 | /// 54 | [JsonPropertyName("pan")] 55 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 56 | public Pan? Pan { get; set; } 57 | 58 | /// 59 | /// Gets or sets the zoom options. 60 | /// 61 | /// 62 | /// The zoom options. 63 | /// 64 | [JsonPropertyName("zoom")] 65 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 66 | public ZoomOptions? ZoomOptions { get; set; } 67 | } 68 | } -------------------------------------------------------------------------------- /src/Models/Common/Zoom/ZoomOptions.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Common 2 | { 3 | /// 4 | /// Zoom options 5 | /// 6 | public class ZoomOptions 7 | { 8 | /// 9 | /// Gets or sets the drag. 10 | /// 11 | /// 12 | /// The drag. 13 | /// 14 | [JsonPropertyName("drag")] 15 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 16 | public Drag? Drag { get; set; } 17 | 18 | /// 19 | /// Gets or sets the pinch. 20 | /// 21 | /// 22 | /// The pinch. 23 | /// 24 | [JsonPropertyName("pinch")] 25 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 26 | public Pinch? Pinch { get; set; } 27 | 28 | /// 29 | /// Gets or sets the wheel. 30 | /// 31 | /// 32 | /// The wheel. 33 | /// 34 | [JsonPropertyName("wheel")] 35 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 36 | public Wheel? Wheel { get; set; } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Models/Doughnut/DoughnutChartConfig.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Doughnut 2 | { 3 | public class DoughnutChartConfig : IChartConfig 4 | { 5 | /// 6 | /// Gets the canvas identifier. 7 | /// 8 | /// 9 | /// The canvas identifier. 10 | /// 11 | [JsonIgnore] 12 | public string CanvasId { get; } = Guid.NewGuid().ToString(); 13 | /// 14 | /// Gets or sets the data. 15 | /// 16 | /// 17 | /// The data. 18 | /// 19 | [JsonPropertyName("data")] 20 | public DoughnutData Data { get; set; } = new DoughnutData(); 21 | 22 | /// 23 | /// Gets or sets the on animation complete. 24 | /// 25 | /// 26 | /// The on animation complete. 27 | /// 28 | /// 29 | [JsonPropertyName("onAnimationComplete")] 30 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 31 | public string OnAnimationComplete { get; set; } 32 | 33 | /// 34 | /// Gets or sets the options. 35 | /// 36 | /// 37 | /// The options. 38 | /// 39 | [JsonPropertyName("options")] 40 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 41 | public Options Options { get; set; } 42 | 43 | /// 44 | /// Gets the options. 45 | /// 46 | /// 47 | /// The options. 48 | /// 49 | IOptions IChartConfig.Options => this.Options; 50 | 51 | /// 52 | /// Gets or sets the type. 53 | /// 54 | /// 55 | /// The type. 56 | /// 57 | [JsonPropertyName("type")] 58 | public string Type { get; set; } = ChartType.Doughnut; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/Models/Doughnut/DoughnutData.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Doughnut 2 | { 3 | public class DoughnutData : Data 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/Models/Doughnut/DoughnutDataset.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Doughnut 2 | { 3 | /// 4 | /// Doughnut Dataset 5 | /// 6 | /// 7 | public class DoughnutDataset : Dataset 8 | { 9 | /// 10 | /// Gets or sets the color of the background. 11 | /// 12 | /// 13 | /// The color of the background. 14 | /// 15 | [JsonPropertyName("backgroundColor")] 16 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 17 | public List BackgroundColor { get; set; } = new List(); 18 | 19 | /// 20 | /// Gets or sets the width of the border. 21 | /// 22 | /// 23 | /// The width of the border. 24 | /// 25 | [JsonPropertyName("borderWidth")] 26 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 27 | public int? BorderWidth { get; set; } 28 | 29 | /// 30 | /// Gets or sets the arc offset when hovered (in pixels) 31 | /// 32 | /// 33 | /// The hover offset. 34 | /// 35 | [JsonPropertyName("hoverOffset")] 36 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 37 | public int? HoverOffset { get; set; } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Models/Line/LineChartConfig.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Line 2 | { 3 | /// 4 | /// Chart config for Bars 5 | /// 6 | public class LineChartConfig : IChartConfig 7 | { 8 | /// 9 | /// Gets the canvas identifier. 10 | /// 11 | /// 12 | /// The canvas identifier. 13 | /// 14 | [JsonIgnore] 15 | public string CanvasId { get; } = Guid.NewGuid().ToString(); 16 | /// 17 | /// Gets or sets the data. 18 | /// 19 | /// 20 | /// The data. 21 | /// 22 | [JsonPropertyName("data")] 23 | public LineData Data { get; set; } = new LineData(); 24 | 25 | /// 26 | /// Gets or sets the options. 27 | /// 28 | /// 29 | /// The options. 30 | /// 31 | [JsonPropertyName("options")] 32 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 33 | public Options Options { get; set; } 34 | 35 | /// 36 | /// Gets the options. 37 | /// 38 | /// 39 | /// The options. 40 | /// 41 | IOptions IChartConfig.Options => this.Options; 42 | 43 | /// 44 | /// Gets or sets the type. 45 | /// 46 | /// 47 | /// The type. 48 | /// 49 | [JsonPropertyName("type")] 50 | public string Type { get; set; } = ChartType.Line; 51 | } 52 | } -------------------------------------------------------------------------------- /src/Models/Line/LineData.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Line 2 | { 3 | public class LineData : Data 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/Models/Line/LineDataType.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Line 2 | { 3 | /// 4 | /// Class LineDataType. 5 | /// 6 | public class LineDataType 7 | { 8 | /// 9 | /// Gets or sets the x value. 10 | /// 11 | /// 12 | /// x value 13 | /// 14 | [JsonPropertyName("x")] 15 | public string X { get; set; } = null; 16 | 17 | /// 18 | /// Gets or sets the x value. 19 | /// 20 | /// 21 | /// x value 22 | /// 23 | [JsonPropertyName("y")] 24 | public string Y { get; set; } = null; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Models/Pie/PieChartConfig.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Pie 2 | { 3 | public class PieChartConfig : IChartConfig 4 | { 5 | /// 6 | /// Gets the canvas identifier. 7 | /// 8 | /// 9 | /// The canvas identifier. 10 | /// 11 | [JsonIgnore] 12 | public string CanvasId { get; } = Guid.NewGuid().ToString(); 13 | /// 14 | /// Gets or sets the data. 15 | /// 16 | /// 17 | /// The data. 18 | /// 19 | [JsonPropertyName("data")] 20 | public PieData Data { get; set; } = new PieData(); 21 | 22 | /// 23 | /// Gets or sets the on animation complete. 24 | /// 25 | /// 26 | /// The on animation complete. 27 | /// 28 | /// 29 | [JsonPropertyName("onAnimationComplete")] 30 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 31 | public string OnAnimationComplete { get; set; } 32 | 33 | /// 34 | /// Gets or sets the options. 35 | /// 36 | /// 37 | /// The options. 38 | /// 39 | [JsonPropertyName("options")] 40 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 41 | public PieOptions Options { get; set; } 42 | 43 | /// 44 | /// Gets the options. 45 | /// 46 | /// 47 | /// The options. 48 | /// 49 | IOptions IChartConfig.Options => this.Options; 50 | 51 | /// 52 | /// Gets or sets the type. 53 | /// 54 | /// 55 | /// The type. 56 | /// 57 | [JsonPropertyName("type")] 58 | public string Type { get; set; } = ChartType.Pie; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/Models/Pie/PieData.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Pie 2 | { 3 | public class PieData : Data 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/Models/Pie/PieDataset.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Pie 2 | { 3 | /// 4 | /// Pie Dataset 5 | /// 6 | /// 7 | public class PieDataset : Dataset 8 | { 9 | /// 10 | /// Gets or sets the color of the background. 11 | /// 12 | /// 13 | /// The color of the background. 14 | /// 15 | [JsonPropertyName("backgroundColor")] 16 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 17 | public List BackgroundColor { get; set; } = new List(); 18 | 19 | /// 20 | /// Gets or sets the width of the border. 21 | /// 22 | /// 23 | /// The width of the border. 24 | /// 25 | [JsonPropertyName("borderWidth")] 26 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 27 | public int? BorderWidth { get; set; } 28 | 29 | /// 30 | /// Gets or sets the arc offset when hovered (in pixels) 31 | /// 32 | /// 33 | /// The hover offset. 34 | /// 35 | [JsonPropertyName("hoverOffset")] 36 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 37 | public int? HoverOffset { get; set; } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Models/Pie/PieOptions.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Pie 2 | { 3 | /// 4 | /// Pie Options 5 | /// 6 | /// 7 | /// 8 | public class PieOptions : Options, IOptions 9 | { 10 | /// 11 | /// Gets or sets the circumference. 12 | /// 13 | /// 14 | /// The circumference. 15 | /// 16 | [JsonPropertyName("circumference")] 17 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 18 | public int? Circumference { get; set; } 19 | 20 | /// 21 | /// Gets or sets the rotation. 22 | /// 23 | /// 24 | /// The rotation. 25 | /// 26 | [JsonPropertyName("rotation")] 27 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 28 | public int? Rotation { get; set; } 29 | } 30 | } -------------------------------------------------------------------------------- /src/Models/Polar/PolarChartConfig.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Polar 2 | { 3 | public class PolarChartConfig : IChartConfig 4 | { 5 | /// 6 | /// Gets the canvas identifier. 7 | /// 8 | /// 9 | /// The canvas identifier. 10 | /// 11 | [JsonIgnore] 12 | public string CanvasId { get; } = Guid.NewGuid().ToString(); 13 | /// 14 | /// Gets or sets the type. 15 | /// 16 | /// 17 | /// The type. 18 | /// 19 | [JsonPropertyName("type")] 20 | public string Type { get; set; } = ChartType.PolarArea; 21 | /// 22 | /// Gets or sets the data. 23 | /// 24 | /// 25 | /// The data. 26 | /// 27 | [JsonPropertyName("data")] 28 | public PolarData Data { get; set; } = new PolarData(); 29 | /// 30 | /// Gets or sets the options. 31 | /// 32 | /// 33 | /// The options. 34 | /// 35 | [JsonPropertyName("options")] 36 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 37 | public Options Options { get; set; } 38 | IOptions IChartConfig.Options => this.Options; 39 | /// 40 | /// Gets or sets the on animation complete. 41 | /// 42 | /// 43 | /// The on animation complete. 44 | /// 45 | /// 46 | [JsonPropertyName("onAnimationComplete")] 47 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 48 | public string OnAnimationComplete { get; set; } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/Models/Polar/PolarData.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Polar 2 | { 3 | /// 4 | /// Polar Data 5 | /// 6 | /// 7 | public class PolarData : Data 8 | { 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Models/Polar/PolarDataset.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Polar 2 | { 3 | public class PolarDataset : Dataset 4 | { 5 | /// 6 | /// Gets or sets the color of the background. 7 | /// 8 | /// 9 | /// The color of the background. 10 | /// 11 | [JsonPropertyName("backgroundColor")] 12 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 13 | public List BackgroundColor { get; set; } = new List(); 14 | 15 | /// 16 | /// Gets or sets the width of the border. 17 | /// 18 | /// 19 | /// The width of the border. 20 | /// 21 | [JsonPropertyName("borderWidth")] 22 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 23 | public int? BorderWidth { get; set; } 24 | } 25 | } -------------------------------------------------------------------------------- /src/Models/Radar/RadarChartConfig.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Radar 2 | { 3 | public class RadarChartConfig : IChartConfig 4 | { 5 | /// 6 | /// Gets the canvas identifier. 7 | /// 8 | /// 9 | /// The canvas identifier. 10 | /// 11 | [JsonIgnore] 12 | public string CanvasId { get; } = Guid.NewGuid().ToString(); 13 | /// 14 | /// Gets or sets the data. 15 | /// 16 | /// 17 | /// The data. 18 | /// 19 | [JsonPropertyName("data")] 20 | public RadarData Data { get; set; } = new RadarData(); 21 | 22 | /// 23 | /// Gets or sets the on animation complete. 24 | /// 25 | /// 26 | /// The on animation complete. 27 | /// 28 | /// 29 | [JsonPropertyName("onAnimationComplete")] 30 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 31 | public string OnAnimationComplete { get; set; } 32 | 33 | /// 34 | /// Gets or sets the options. 35 | /// 36 | /// 37 | /// The options. 38 | /// 39 | [JsonPropertyName("options")] 40 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 41 | public RadarOptions Options { get; set; } 42 | 43 | /// 44 | /// Gets the options. 45 | /// 46 | /// 47 | /// The options. 48 | /// 49 | IOptions IChartConfig.Options => this.Options; 50 | 51 | /// 52 | /// Gets or sets the type. 53 | /// 54 | /// 55 | /// The type. 56 | /// 57 | [JsonPropertyName("type")] 58 | public string Type { get; set; } = ChartType.Radar; 59 | } 60 | } -------------------------------------------------------------------------------- /src/Models/Radar/RadarData.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Radar 2 | { 3 | public class RadarData : Data 4 | { 5 | } 6 | } -------------------------------------------------------------------------------- /src/Models/Radar/RadarOptions.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Radar 2 | { 3 | /// 4 | /// Radar Options 5 | /// 6 | public class RadarOptions : IOptions 7 | { 8 | /// 9 | /// Gets or sets the options. 10 | /// 11 | /// 12 | /// The options. 13 | /// 14 | [JsonPropertyName("elements")] 15 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 16 | public RadarOptionsElements Elements { get; set; } 17 | 18 | /// 19 | /// Gets or sets a value indicating whether [maintain aspect ratio]. 20 | /// 21 | /// 22 | /// true if [maintain aspect ratio]; otherwise, false. 23 | /// 24 | [JsonPropertyName("maintainAspectRatio")] 25 | public bool MaintainAspectRatio { get; set; } = false; 26 | 27 | /// 28 | /// Gets or sets a value indicating whether this is responsive. 29 | /// 30 | /// 31 | /// true if responsive; otherwise, false. 32 | /// 33 | [JsonPropertyName("responsive")] 34 | public bool Responsive { get; set; } = true; 35 | 36 | /// 37 | /// Gets or sets the the scales 38 | /// 39 | /// 40 | /// The scales options 41 | /// 42 | [JsonPropertyName("scales")] 43 | public RadarOptionsScales Scales { get; set; } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/Models/Radar/RadarOptionsElements.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Radar 2 | { 3 | /// 4 | /// Radar Options Elements 5 | /// 6 | public class RadarOptionsElements 7 | { 8 | /// 9 | /// Gets or sets the radar options elements line. 10 | /// 11 | /// 12 | /// The radar options elements line. 13 | /// 14 | [JsonPropertyName("line")] 15 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 16 | public RadarOptionsElementsLine Line { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Models/Radar/RadarOptionsElementsLine.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Radar 2 | { 3 | /// 4 | /// Radar Options Elements Line 5 | /// 6 | public class RadarOptionsElementsLine 7 | { 8 | /// 9 | /// Gets or sets the width of the border. 10 | /// 11 | /// 12 | /// The width of the border. 13 | /// 14 | [JsonPropertyName("borderWidth")] 15 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] 16 | public int BorderWidth { get; set; } = 3; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Models/Radar/RadarOptionsScales.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 PSC.Blazor.Components.Chartjs.Models.Radar 8 | { 9 | /// 10 | /// Radar Options Scales 11 | /// 12 | public class RadarOptionsScales 13 | { 14 | /// 15 | /// Gets or sets the scale radius options 16 | /// 17 | /// 18 | /// The radius options 19 | /// 20 | public RadarOptionsScalesRadius? R { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Models/Radar/RadarOptionsScalesRadius.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 PSC.Blazor.Components.Chartjs.Models.Radar 8 | { 9 | /// 10 | /// Radar Scales Radius Options 11 | /// 12 | public class RadarOptionsScalesRadius 13 | { 14 | /// 15 | /// If true, scale will include 0 if it is not already included. 16 | /// 17 | /// 18 | /// The value if the chart need to start at zero 19 | /// 20 | [JsonPropertyName("beginAtZero")] 21 | public bool BeginAtZero { get; set; } = false; 22 | 23 | /// 24 | /// User defined maximum number for the scale, overrides maximum value from data. 25 | /// 26 | /// 27 | /// The value of the max value 28 | /// 29 | [JsonPropertyName("max")] 30 | public decimal? Max { get; set; } 31 | 32 | /// 33 | /// User defined minimum number for the scale, overrides minimum value from data. 34 | /// 35 | /// 36 | /// The value of the min value 37 | /// 38 | [JsonPropertyName("min")] 39 | public decimal? Min { get; set; } 40 | } 41 | } -------------------------------------------------------------------------------- /src/Models/Scatter/ScatterChartConfig.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Scatter 2 | { 3 | public class ScatterChartConfig : IChartConfig 4 | { 5 | /// 6 | /// Gets the canvas identifier. 7 | /// 8 | /// 9 | /// The canvas identifier. 10 | /// 11 | [JsonIgnore] 12 | public string CanvasId { get; } = Guid.NewGuid().ToString(); 13 | /// 14 | /// Gets or sets the data. 15 | /// 16 | /// 17 | /// The data. 18 | /// 19 | [JsonPropertyName("data")] 20 | public ScatterData Data { get; set; } = new ScatterData(); 21 | 22 | /// 23 | /// Gets or sets the on animation complete. 24 | /// 25 | /// 26 | /// The on animation complete. 27 | /// 28 | /// 29 | [JsonPropertyName("onAnimationComplete")] 30 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 31 | public string OnAnimationComplete { get; set; } 32 | 33 | /// 34 | /// Gets or sets the options. 35 | /// 36 | /// 37 | /// The options. 38 | /// 39 | [JsonPropertyName("options")] 40 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 41 | public Options Options { get; set; } 42 | 43 | /// 44 | /// Gets the options. 45 | /// 46 | /// 47 | /// The options. 48 | /// 49 | IOptions IChartConfig.Options => this.Options; 50 | 51 | /// 52 | /// Gets or sets the type. 53 | /// 54 | /// 55 | /// The type. 56 | /// 57 | [JsonPropertyName("type")] 58 | public string Type { get; set; } = ChartType.Scatter; 59 | } 60 | } -------------------------------------------------------------------------------- /src/Models/Scatter/ScatterData.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Scatter 2 | { 3 | /// 4 | /// Scatter Data 5 | /// 6 | /// 7 | public class ScatterData : Data 8 | { 9 | } 10 | } -------------------------------------------------------------------------------- /src/Models/Scatter/ScatterXYValue.cs: -------------------------------------------------------------------------------- 1 | namespace PSC.Blazor.Components.Chartjs.Models.Scatter 2 | { 3 | /// 4 | /// Scatter XY Value 5 | /// 6 | public class ScatterXYValue 7 | { 8 | /// 9 | /// Gets or sets the x. 10 | /// 11 | /// 12 | /// The x. 13 | /// 14 | [JsonPropertyName("x")] 15 | public decimal X { get; set; } 16 | /// 17 | /// Gets or sets the y. 18 | /// 19 | /// 20 | /// The y. 21 | /// 22 | [JsonPropertyName("y")] 23 | public decimal Y { get; set; } 24 | } 25 | } -------------------------------------------------------------------------------- /src/PSC.Blazor.Components.Chartjs.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | True 6 | ChartJs component for Blazor. Compatible with client-side and server-side Blazor applications. 7 | psc_logo.png 8 | psc_ico.ico 9 | README.md 10 | Add GroupYAxis - Minor bugs 11 | False 12 | Enrico Rossini - PureSourceCode.com 13 | git 14 | chartjs, blazor, c#, blazor-webassembly, blazor-server, blazor-component, wasm, asp.net 15 | https://www.puresourcecode.com/dotnet/blazor/blazor-component-for-chartjs/ 16 | https://github.com/erossini/BlazorChartjs 17 | ChartJs component for Blazor 18 | LICENSE 19 | True 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | True 29 | \ 30 | 31 | 32 | True 33 | \ 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | True 52 | \ 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /src/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Components.Web 2 | @using Microsoft.JSInterop 3 | 4 | @using PSC.Blazor.Components.Chartjs 5 | @using PSC.Blazor.Components.Chartjs.Models.Bar 6 | @using PSC.Blazor.Components.Chartjs.Models.Common 7 | @using PSC.Blazor.Components.Chartjs.Enums 8 | @using PSC.Blazor.Components.Chartjs.Models -------------------------------------------------------------------------------- /src/libman.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "defaultProvider": "cdnjs", 4 | "libraries": [ 5 | { 6 | "library": "Chart.js@3.9.1", 7 | "destination": "wwwroot/lib/Chart.js/" 8 | }, 9 | { 10 | "library": "chartjs-plugin-zoom@1.2.1", 11 | "destination": "wwwroot/lib/chartjs-plugin-zoom/" 12 | }, 13 | { 14 | "library": "hammer.js@2.0.8", 15 | "destination": "wwwroot/lib/hammer.js/" 16 | }, 17 | { 18 | "library": "chartjs-plugin-datalabels@2.2.0", 19 | "destination": "wwwroot/lib/chartjs-plugin-datalabels/" 20 | } 21 | ] 22 | } -------------------------------------------------------------------------------- /src/psc_ico.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erossini/BlazorChartjs/57b7faab43a66df3b705223f151ac83af66134f2/src/psc_ico.ico -------------------------------------------------------------------------------- /src/psc_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erossini/BlazorChartjs/57b7faab43a66df3b705223f151ac83af66134f2/src/psc_logo.png -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/controllers/controller.bar.d.ts: -------------------------------------------------------------------------------- 1 | export default class BarController extends DatasetController { 2 | static id: string; 3 | /** 4 | * @type {any} 5 | */ 6 | static overrides: any; 7 | /** 8 | * Overriding primitive data parsing since we support mixed primitive/array 9 | * data for float bars 10 | * @protected 11 | */ 12 | protected parsePrimitiveData(meta: any, data: any, start: any, count: any): any[]; 13 | /** 14 | * Overriding array data parsing since we support mixed primitive/array 15 | * data for float bars 16 | * @protected 17 | */ 18 | protected parseArrayData(meta: any, data: any, start: any, count: any): any[]; 19 | /** 20 | * Overriding object data parsing since we support mixed primitive/array 21 | * value-scale data for float bars 22 | * @protected 23 | */ 24 | protected parseObjectData(meta: any, data: any, start: any, count: any): any[]; 25 | update(mode: any): void; 26 | /** 27 | * Returns the stacks based on groups and bar visibility. 28 | * @param {number} [last] - The dataset index 29 | * @param {number} [dataIndex] - The data index of the ruler 30 | * @returns {string[]} The list of stack IDs 31 | * @private 32 | */ 33 | private _getStacks; 34 | /** 35 | * Returns the effective number of stacks based on groups and bar visibility. 36 | * @private 37 | */ 38 | private _getStackCount; 39 | /** 40 | * Returns the stack index for the given dataset based on groups and bar visibility. 41 | * @param {number} [datasetIndex] - The dataset index 42 | * @param {string} [name] - The stack name to find 43 | * @param {number} [dataIndex] 44 | * @returns {number} The stack index 45 | * @private 46 | */ 47 | private _getStackIndex; 48 | /** 49 | * @private 50 | */ 51 | private _getRuler; 52 | /** 53 | * Note: pixel values are not clamped to the scale area. 54 | * @private 55 | */ 56 | private _calculateBarValuePixels; 57 | /** 58 | * @private 59 | */ 60 | private _calculateBarIndexPixels; 61 | } 62 | import DatasetController from "../core/core.datasetController.js"; 63 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/controllers/controller.bubble.d.ts: -------------------------------------------------------------------------------- 1 | export default class BubbleController extends DatasetController { 2 | static id: string; 3 | /** 4 | * @type {any} 5 | */ 6 | static overrides: any; 7 | /** 8 | * Parse array of primitive values 9 | * @protected 10 | */ 11 | protected parsePrimitiveData(meta: any, data: any, start: any, count: any): any; 12 | /** 13 | * Parse array of arrays 14 | * @protected 15 | */ 16 | protected parseArrayData(meta: any, data: any, start: any, count: any): any; 17 | /** 18 | * Parse array of objects 19 | * @protected 20 | */ 21 | protected parseObjectData(meta: any, data: any, start: any, count: any): any; 22 | /** 23 | * @protected 24 | */ 25 | protected getMaxOverflow(): number; 26 | /** 27 | * @protected 28 | */ 29 | protected getLabelAndValue(index: any): { 30 | label: any; 31 | value: string; 32 | }; 33 | update(mode: any): void; 34 | } 35 | import DatasetController from "../core/core.datasetController.js"; 36 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/controllers/controller.doughnut.d.ts: -------------------------------------------------------------------------------- 1 | export default class DoughnutController extends DatasetController { 2 | static id: string; 3 | static descriptors: { 4 | _scriptable: (name: any) => boolean; 5 | _indexable: (name: any) => boolean; 6 | }; 7 | /** 8 | * @type {any} 9 | */ 10 | static overrides: any; 11 | constructor(chart: any, datasetIndex: any); 12 | innerRadius: number; 13 | outerRadius: number; 14 | offsetX: number; 15 | offsetY: number; 16 | /** 17 | * Override data parsing, since we are not using scales 18 | */ 19 | parse(start: any, count: any): void; 20 | /** 21 | * @private 22 | */ 23 | private _getRotation; 24 | /** 25 | * @private 26 | */ 27 | private _getCircumference; 28 | /** 29 | * Get the maximal rotation & circumference extents 30 | * across all visible datasets. 31 | */ 32 | _getRotationExtents(): { 33 | rotation: number; 34 | circumference: number; 35 | }; 36 | /** 37 | * @private 38 | */ 39 | private _circumference; 40 | calculateTotal(): number; 41 | calculateCircumference(value: any): number; 42 | getLabelAndValue(index: any): { 43 | label: any; 44 | value: string; 45 | }; 46 | getMaxBorderWidth(arcs: any): number; 47 | getMaxOffset(arcs: any): number; 48 | /** 49 | * Get radius length offset of the dataset in relation to the visible datasets weights. This allows determining the inner and outer radius correctly 50 | * @private 51 | */ 52 | private _getRingWeightOffset; 53 | /** 54 | * @private 55 | */ 56 | private _getRingWeight; 57 | /** 58 | * Returns the sum of all visible data set weights. 59 | * @private 60 | */ 61 | private _getVisibleDatasetWeightTotal; 62 | } 63 | export type Chart = import('../core/core.controller.js').default; 64 | import DatasetController from "../core/core.datasetController.js"; 65 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/controllers/controller.line.d.ts: -------------------------------------------------------------------------------- 1 | export default class LineController extends DatasetController { 2 | static id: string; 3 | /** 4 | * @type {any} 5 | */ 6 | static overrides: any; 7 | update(mode: any): void; 8 | /** 9 | * @protected 10 | */ 11 | protected getMaxOverflow(): any; 12 | } 13 | import DatasetController from "../core/core.datasetController.js"; 14 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/controllers/controller.pie.d.ts: -------------------------------------------------------------------------------- 1 | export default class PieController extends DoughnutController { 2 | } 3 | import DoughnutController from "./controller.doughnut.js"; 4 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/controllers/controller.polarArea.d.ts: -------------------------------------------------------------------------------- 1 | export default class PolarAreaController extends DatasetController { 2 | static id: string; 3 | /** 4 | * @type {any} 5 | */ 6 | static overrides: any; 7 | constructor(chart: any, datasetIndex: any); 8 | innerRadius: number; 9 | outerRadius: number; 10 | getLabelAndValue(index: any): { 11 | label: any; 12 | value: string; 13 | }; 14 | parseObjectData(meta: any, data: any, start: any, count: any): { 15 | r: unknown; 16 | }[]; 17 | update(mode: any): void; 18 | /** 19 | * @protected 20 | */ 21 | protected getMinMax(): { 22 | min: number; 23 | max: number; 24 | }; 25 | /** 26 | * @private 27 | */ 28 | private _updateRadius; 29 | countVisibleElements(): number; 30 | /** 31 | * @private 32 | */ 33 | private _computeAngle; 34 | } 35 | import DatasetController from "../core/core.datasetController.js"; 36 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/controllers/controller.radar.d.ts: -------------------------------------------------------------------------------- 1 | export default class RadarController extends DatasetController { 2 | static id: string; 3 | /** 4 | * @type {any} 5 | */ 6 | static overrides: any; 7 | /** 8 | * @protected 9 | */ 10 | protected getLabelAndValue(index: any): { 11 | label: any; 12 | value: string; 13 | }; 14 | parseObjectData(meta: any, data: any, start: any, count: any): { 15 | r: unknown; 16 | }[]; 17 | update(mode: any): void; 18 | } 19 | import DatasetController from "../core/core.datasetController.js"; 20 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/controllers/controller.scatter.d.ts: -------------------------------------------------------------------------------- 1 | export default class ScatterController extends DatasetController { 2 | static id: string; 3 | /** 4 | * @type {any} 5 | */ 6 | static overrides: any; 7 | /** 8 | * @protected 9 | */ 10 | protected getLabelAndValue(index: any): { 11 | label: any; 12 | value: string; 13 | }; 14 | update(mode: any): void; 15 | /** 16 | * @protected 17 | */ 18 | protected getMaxOverflow(): any; 19 | } 20 | import DatasetController from "../core/core.datasetController.js"; 21 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/controllers/index.d.ts: -------------------------------------------------------------------------------- 1 | export { default as BarController } from "./controller.bar.js"; 2 | export { default as BubbleController } from "./controller.bubble.js"; 3 | export { default as DoughnutController } from "./controller.doughnut.js"; 4 | export { default as LineController } from "./controller.line.js"; 5 | export { default as PolarAreaController } from "./controller.polarArea.js"; 6 | export { default as PieController } from "./controller.pie.js"; 7 | export { default as RadarController } from "./controller.radar.js"; 8 | export { default as ScatterController } from "./controller.scatter.js"; 9 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/core/core.animation.d.ts: -------------------------------------------------------------------------------- 1 | export default class Animation { 2 | constructor(cfg: any, target: any, prop: any, to: any); 3 | _active: boolean; 4 | _fn: any; 5 | _easing: any; 6 | _start: number; 7 | _duration: number; 8 | _total: number; 9 | _loop: boolean; 10 | _target: any; 11 | _prop: any; 12 | _from: unknown; 13 | _to: any; 14 | _promises: any[]; 15 | active(): boolean; 16 | update(cfg: any, to: any, date: any): void; 17 | cancel(): void; 18 | tick(date: any): void; 19 | wait(): Promise; 20 | _notify(resolved: any): void; 21 | } 22 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/core/core.animations.d.ts: -------------------------------------------------------------------------------- 1 | export default class Animations { 2 | constructor(chart: any, config: any); 3 | _chart: any; 4 | _properties: Map; 5 | configure(config: any): void; 6 | /** 7 | * Utility to handle animation of `options`. 8 | * @private 9 | */ 10 | private _animateOptions; 11 | /** 12 | * @private 13 | */ 14 | private _createAnimations; 15 | /** 16 | * Update `target` properties to new values, using configured animations 17 | * @param {object} target - object to update 18 | * @param {object} values - new target properties 19 | * @returns {boolean|undefined} - `true` if animations were started 20 | **/ 21 | update(target: object, values: object): boolean | undefined; 22 | } 23 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/core/core.animations.defaults.d.ts: -------------------------------------------------------------------------------- 1 | export function applyAnimationsDefaults(defaults: any): void; 2 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/core/core.animator.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @typedef { import('./core.animation.js').default } Animation 3 | * @typedef { import('./core.controller.js').default } Chart 4 | */ 5 | /** 6 | * Please use the module's default export which provides a singleton instance 7 | * Note: class is export for typedoc 8 | */ 9 | export class Animator { 10 | _request: any; 11 | _charts: Map; 12 | _running: boolean; 13 | _lastDate: number; 14 | /** 15 | * @private 16 | */ 17 | private _notify; 18 | /** 19 | * @private 20 | */ 21 | private _refresh; 22 | /** 23 | * @private 24 | */ 25 | private _update; 26 | /** 27 | * @private 28 | */ 29 | private _getAnims; 30 | /** 31 | * @param {Chart} chart 32 | * @param {string} event - event name 33 | * @param {Function} cb - callback 34 | */ 35 | listen(chart: Chart, event: string, cb: Function): void; 36 | /** 37 | * Add animations 38 | * @param {Chart} chart 39 | * @param {Animation[]} items - animations 40 | */ 41 | add(chart: Chart, items: Animation[]): void; 42 | /** 43 | * Counts number of active animations for the chart 44 | * @param {Chart} chart 45 | */ 46 | has(chart: Chart): boolean; 47 | /** 48 | * Start animating (all charts) 49 | * @param {Chart} chart 50 | */ 51 | start(chart: Chart): void; 52 | running(chart: any): boolean; 53 | /** 54 | * Stop all animations for the chart 55 | * @param {Chart} chart 56 | */ 57 | stop(chart: Chart): void; 58 | /** 59 | * Remove chart from Animator 60 | * @param {Chart} chart 61 | */ 62 | remove(chart: Chart): boolean; 63 | } 64 | declare const _default: Animator; 65 | export default _default; 66 | export type Animation = import('./core.animation.js').default; 67 | export type Chart = import('./core.controller.js').default; 68 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/core/core.element.d.ts: -------------------------------------------------------------------------------- 1 | import type { AnyObject } from '../types/basic.js'; 2 | import type { Point } from '../types/geometric.js'; 3 | import type { Animation } from '../types/animation.js'; 4 | export default class Element { 5 | static defaults: {}; 6 | static defaultRoutes: any; 7 | x: number; 8 | y: number; 9 | active: boolean; 10 | options: O; 11 | $animations: Record; 12 | tooltipPosition(useFinalPosition: boolean): Point; 13 | hasValue(): boolean; 14 | /** 15 | * Gets the current or final value of each prop. Can return extra properties (whole object). 16 | * @param props - properties to get 17 | * @param [final] - get the final value (animation target) 18 | */ 19 | getProps

(props: P, final?: boolean): Pick; 20 | getProps

(props: P[], final?: boolean): Partial>; 21 | } 22 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/core/core.layouts.defaults.d.ts: -------------------------------------------------------------------------------- 1 | export function applyLayoutsDefaults(defaults: any): void; 2 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/core/core.scale.autoskip.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @typedef { import('./core.controller.js').default } Chart 3 | * @typedef {{value:number | string, label?:string, major?:boolean, $context?:any}} Tick 4 | */ 5 | /** 6 | * Returns a subset of ticks to be plotted to avoid overlapping labels. 7 | * @param {import('./core.scale.js').default} scale 8 | * @param {Tick[]} ticks 9 | * @return {Tick[]} 10 | * @private 11 | */ 12 | export function autoSkip(scale: import('./core.scale.js').default, ticks: Tick[]): Tick[]; 13 | export type Chart = import('./core.controller.js').default; 14 | export type Tick = { 15 | value: number | string; 16 | label?: string; 17 | major?: boolean; 18 | $context?: any; 19 | }; 20 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/core/core.scale.defaults.d.ts: -------------------------------------------------------------------------------- 1 | export function applyScaleDefaults(defaults: any): void; 2 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/core/core.ticks.d.ts: -------------------------------------------------------------------------------- 1 | declare namespace _default { 2 | export { formatters }; 3 | } 4 | export default _default; 5 | declare namespace formatters { 6 | /** 7 | * Formatter for value labels 8 | * @method Chart.Ticks.formatters.values 9 | * @param value the value to display 10 | * @return {string|string[]} the label to display 11 | */ 12 | function values(value: any): string | string[]; 13 | /** 14 | * Formatter for numeric ticks 15 | * @method Chart.Ticks.formatters.numeric 16 | * @param tickValue {number} the value to be formatted 17 | * @param index {number} the position of the tickValue parameter in the ticks array 18 | * @param ticks {object[]} the list of ticks being converted 19 | * @return {string} string representation of the tickValue parameter 20 | */ 21 | function numeric(tickValue: number, index: number, ticks: any[]): string; 22 | /** 23 | * Formatter for logarithmic ticks 24 | * @method Chart.Ticks.formatters.logarithmic 25 | * @param tickValue {number} the value to be formatted 26 | * @param index {number} the position of the tickValue parameter in the ticks array 27 | * @param ticks {object[]} the list of ticks being converted 28 | * @return {string} string representation of the tickValue parameter 29 | */ 30 | function logarithmic(tickValue: number, index: number, ticks: any[]): string; 31 | } 32 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/core/core.typedRegistry.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @typedef {{id: string, defaults: any, overrides?: any, defaultRoutes: any}} IChartComponent 3 | */ 4 | export default class TypedRegistry { 5 | constructor(type: any, scope: any, override: any); 6 | type: any; 7 | scope: any; 8 | override: any; 9 | items: any; 10 | isForType(type: any): boolean; 11 | /** 12 | * @param {IChartComponent} item 13 | * @returns {string} The scope where items defaults were registered to. 14 | */ 15 | register(item: IChartComponent): string; 16 | /** 17 | * @param {string} id 18 | * @returns {object?} 19 | */ 20 | get(id: string): object | null; 21 | /** 22 | * @param {IChartComponent} item 23 | */ 24 | unregister(item: IChartComponent): void; 25 | } 26 | export type IChartComponent = { 27 | id: string; 28 | defaults: any; 29 | overrides?: any; 30 | defaultRoutes: any; 31 | }; 32 | import defaults from "./core.defaults.js"; 33 | import { overrides } from "./core.defaults.js"; 34 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/core/index.d.ts: -------------------------------------------------------------------------------- 1 | export type { DateAdapter, TimeUnit } from './core.adapters.js'; 2 | export { default as _adapters } from './core.adapters.js'; 3 | export { default as Animation } from './core.animation.js'; 4 | export { default as Animations } from './core.animations.js'; 5 | export { default as animator } from './core.animator.js'; 6 | export { default as Chart } from './core.controller.js'; 7 | export { default as DatasetController } from './core.datasetController.js'; 8 | export { default as defaults } from './core.defaults.js'; 9 | export { default as Element } from './core.element.js'; 10 | export { default as Interaction } from './core.interaction.js'; 11 | export { default as layouts } from './core.layouts.js'; 12 | export { default as plugins } from './core.plugins.js'; 13 | export { default as registry } from './core.registry.js'; 14 | export { default as Scale } from './core.scale.js'; 15 | export { default as Ticks } from './core.ticks.js'; 16 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/elements/element.arc.d.ts: -------------------------------------------------------------------------------- 1 | import Element from '../core/core.element.js'; 2 | import type { ArcOptions, Point } from '../types/index.js'; 3 | export interface ArcProps extends Point { 4 | startAngle: number; 5 | endAngle: number; 6 | innerRadius: number; 7 | outerRadius: number; 8 | circumference: number; 9 | } 10 | export default class ArcElement extends Element { 11 | static id: string; 12 | static defaults: { 13 | borderAlign: string; 14 | borderColor: string; 15 | borderDash: any[]; 16 | borderDashOffset: number; 17 | borderJoinStyle: any; 18 | borderRadius: number; 19 | borderWidth: number; 20 | offset: number; 21 | spacing: number; 22 | angle: any; 23 | circular: boolean; 24 | }; 25 | static defaultRoutes: { 26 | backgroundColor: string; 27 | }; 28 | static descriptors: { 29 | _scriptable: boolean; 30 | _indexable: (name: any) => boolean; 31 | }; 32 | circumference: number; 33 | endAngle: number; 34 | fullCircles: number; 35 | innerRadius: number; 36 | outerRadius: number; 37 | pixelMargin: number; 38 | startAngle: number; 39 | constructor(cfg: any); 40 | inRange(chartX: number, chartY: number, useFinalPosition: boolean): boolean; 41 | getCenterPoint(useFinalPosition: boolean): { 42 | x: number; 43 | y: number; 44 | }; 45 | tooltipPosition(useFinalPosition: boolean): { 46 | x: number; 47 | y: number; 48 | }; 49 | draw(ctx: CanvasRenderingContext2D): void; 50 | } 51 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/elements/element.bar.d.ts: -------------------------------------------------------------------------------- 1 | export default class BarElement extends Element { 2 | static id: string; 3 | /** 4 | * @type {any} 5 | */ 6 | static defaults: any; 7 | constructor(cfg: any); 8 | options: any; 9 | horizontal: any; 10 | base: any; 11 | width: any; 12 | height: any; 13 | inflateAmount: any; 14 | draw(ctx: any): void; 15 | inRange(mouseX: any, mouseY: any, useFinalPosition: any): boolean; 16 | inXRange(mouseX: any, useFinalPosition: any): boolean; 17 | inYRange(mouseY: any, useFinalPosition: any): boolean; 18 | getCenterPoint(useFinalPosition: any): { 19 | x: number; 20 | y: number; 21 | }; 22 | getRange(axis: any): number; 23 | } 24 | export type BarProps = { 25 | x: number; 26 | y: number; 27 | base: number; 28 | horizontal: boolean; 29 | width: number; 30 | height: number; 31 | }; 32 | import Element from "../core/core.element.js"; 33 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/elements/element.point.d.ts: -------------------------------------------------------------------------------- 1 | import Element from '../core/core.element.js'; 2 | import type { CartesianParsedData, ChartArea, Point, PointHoverOptions, PointOptions } from '../types/index.js'; 3 | export type PointProps = Point; 4 | export default class PointElement extends Element { 5 | static id: string; 6 | parsed: CartesianParsedData; 7 | skip?: boolean; 8 | stop?: boolean; 9 | /** 10 | * @type {any} 11 | */ 12 | static defaults: { 13 | borderWidth: number; 14 | hitRadius: number; 15 | hoverBorderWidth: number; 16 | hoverRadius: number; 17 | pointStyle: string; 18 | radius: number; 19 | rotation: number; 20 | }; 21 | /** 22 | * @type {any} 23 | */ 24 | static defaultRoutes: { 25 | backgroundColor: string; 26 | borderColor: string; 27 | }; 28 | constructor(cfg: any); 29 | inRange(mouseX: number, mouseY: number, useFinalPosition?: boolean): boolean; 30 | inXRange(mouseX: number, useFinalPosition?: boolean): boolean; 31 | inYRange(mouseY: number, useFinalPosition?: boolean): boolean; 32 | getCenterPoint(useFinalPosition?: boolean): { 33 | x: number; 34 | y: number; 35 | }; 36 | size(options?: Partial): number; 37 | draw(ctx: CanvasRenderingContext2D, area: ChartArea): void; 38 | getRange(): any; 39 | } 40 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/elements/index.d.ts: -------------------------------------------------------------------------------- 1 | export { default as ArcElement } from "./element.arc.js"; 2 | export { default as LineElement } from "./element.line.js"; 3 | export { default as PointElement } from "./element.point.js"; 4 | export { default as BarElement } from "./element.bar.js"; 5 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/helpers.cjs.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"helpers.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/helpers.esm.min.js: -------------------------------------------------------------------------------- 1 | export{H as HALF_PI,b1 as INFINITY,P as PI,b0 as PITAU,b3 as QUARTER_PI,b2 as RAD_PER_DEG,T as TAU,b4 as TWO_THIRDS_PI,D as _addGrace,J as _alignPixel,S as _alignStartEnd,p as _angleBetween,b5 as _angleDiff,_ as _arrayUnique,a9 as _attachContext,at as _bezierCurveTo,aq as _bezierInterpolation,ay as _boundSegment,ao as _boundSegments,W as _capitalize,an as _computeSegments,aa as _createResolver,aL as _decimalPlaces,aU as _deprecated,ab as _descriptors,ai as _elementsEqual,A as _factorize,aN as _filterBetween,a2 as _getParentNode,q as _getStartAndCountOfVisiblePoints,I as _int16Range,ak as _isBetween,aj as _isClickEvent,a6 as _isDomSupported,$ as _isPointInArea,E as _limitValue,aM as _longestText,aO as _lookup,Z as _lookupByKey,G as _measureText,aS as _merger,aT as _mergerIf,az as _normalizeAngle,y as _parseObjectDataRadialScale,ar as _pointInLine,al as _readValueToProps,Y as _rlookupByKey,w as _scaleRangesChanged,aH as _setMinAndMaxByKey,aV as _splitKey,ap as _steppedInterpolation,as as _steppedLineTo,aC as _textX,R as _toLeftRightCenter,am as _updateBezierControlPoints,av as addRoundedRectPath,aK as almostEquals,aJ as almostWhole,C as callback,ag as clearCanvas,L as clipArea,aR as clone,c as color,h as createContext,ae as debounce,j as defined,aG as distanceBetweenPoints,au as drawPoint,aE as drawPointLegend,Q as each,e as easingEffects,B as finiteOrDefault,a_ as fontString,o as formatNumber,a0 as getAngleFromPoint,aQ as getHoverColor,a1 as getMaximumSize,X as getRelativePosition,aA as getRtlAdapter,aZ as getStyle,b as isArray,g as isFinite,a8 as isFunction,k as isNullOrUndef,x as isNumber,i as isObject,aP as isPatternOrGradient,l as listenArrayEvents,z as log10,V as merge,ac as mergeIf,aI as niceNum,aF as noop,aB as overrideTextDirection,a3 as readUsedSize,M as renderText,r as requestAnimFrame,a as resolve,f as resolveObjectKey,aD as restoreTextDirection,af as retinaScale,ah as setsEqual,s as sign,aX as splineCurve,aY as splineCurveMonotone,a5 as supportsEventListenerOptions,a4 as throttled,F as toDegrees,n as toDimension,O as toFont,aW as toFontString,a$ as toLineHeight,K as toPadding,m as toPercentage,t as toRadians,aw as toTRBL,ax as toTRBLCorners,ad as uid,N as unclipArea,u as unlistenArrayEvents,v as valueOrDefault}from"./chunks/helpers.segment.js"; -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/helpers.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"helpers.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"} -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/helpers/helpers.color.d.ts: -------------------------------------------------------------------------------- 1 | import { Color } from '@kurkle/color'; 2 | export declare function isPatternOrGradient(value: unknown): value is CanvasPattern | CanvasGradient; 3 | export declare function color(value: CanvasGradient): CanvasGradient; 4 | export declare function color(value: CanvasPattern): CanvasPattern; 5 | export declare function color(value: string | { 6 | r: number; 7 | g: number; 8 | b: number; 9 | a: number; 10 | } | [number, number, number] | [number, number, number, number]): Color; 11 | export declare function getHoverColor(value: CanvasGradient): CanvasGradient; 12 | export declare function getHoverColor(value: CanvasPattern): CanvasPattern; 13 | export declare function getHoverColor(value: string): string; 14 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/helpers/helpers.config.d.ts: -------------------------------------------------------------------------------- 1 | import type { AnyObject } from '../types/basic.js'; 2 | import type { ChartMeta } from '../types/index.js'; 3 | import type { ResolverObjectKey, ResolverCache, ResolverProxy, DescriptorDefaults, Descriptor, ContextProxy } from './helpers.config.types.js'; 4 | export * from './helpers.config.types.js'; 5 | /** 6 | * Creates a Proxy for resolving raw values for options. 7 | * @param scopes - The option scopes to look for values, in resolution order 8 | * @param prefixes - The prefixes for values, in resolution order. 9 | * @param rootScopes - The root option scopes 10 | * @param fallback - Parent scopes fallback 11 | * @param getTarget - callback for getting the target for changed values 12 | * @returns Proxy 13 | * @private 14 | */ 15 | export declare function _createResolver(scopes: T, prefixes?: string[], rootScopes?: R, fallback?: ResolverObjectKey, getTarget?: () => AnyObject): any; 16 | /** 17 | * Returns an Proxy for resolving option values with context. 18 | * @param proxy - The Proxy returned by `_createResolver` 19 | * @param context - Context object for scriptable/indexable options 20 | * @param subProxy - The proxy provided for scriptable options 21 | * @param descriptorDefaults - Defaults for descriptors 22 | * @private 23 | */ 24 | export declare function _attachContext(proxy: ResolverProxy, context: AnyObject, subProxy?: ResolverProxy, descriptorDefaults?: DescriptorDefaults): ContextProxy; 25 | /** 26 | * @private 27 | */ 28 | export declare function _descriptors(proxy: ResolverCache, defaults?: DescriptorDefaults): Descriptor; 29 | export declare function _parseObjectDataRadialScale(meta: ChartMeta<'line' | 'scatter'>, data: AnyObject[], start: number, count: number): { 30 | r: unknown; 31 | }[]; 32 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/helpers/helpers.config.types.d.ts: -------------------------------------------------------------------------------- 1 | import type { AnyObject } from '../types/basic.js'; 2 | import type { Merge } from '../types/utils.js'; 3 | export type ResolverObjectKey = string | boolean; 4 | export interface ResolverCache { 5 | [Symbol.toStringTag]: 'Object'; 6 | _cacheable: boolean; 7 | _scopes: T; 8 | _rootScopes: T | R; 9 | _fallback: ResolverObjectKey; 10 | _keys?: string[]; 11 | _scriptable?: boolean; 12 | _indexable?: boolean; 13 | _allKeys?: boolean; 14 | _storage?: T[number]; 15 | _getTarget(): T[number]; 16 | override(scope: S): ResolverProxy<(T[number] | S)[], T | R>; 17 | } 18 | export type ResolverProxy = Merge & ResolverCache; 19 | export interface DescriptorDefaults { 20 | scriptable: boolean; 21 | indexable: boolean; 22 | allKeys?: boolean; 23 | } 24 | export interface Descriptor { 25 | allKeys: boolean; 26 | scriptable: boolean; 27 | indexable: boolean; 28 | isScriptable(key: string): boolean; 29 | isIndexable(key: string): boolean; 30 | } 31 | export interface ContextCache { 32 | _cacheable: boolean; 33 | _proxy: ResolverProxy; 34 | _context: AnyObject; 35 | _subProxy: ResolverProxy; 36 | _stack: Set; 37 | _descriptors: Descriptor; 38 | setContext(ctx: AnyObject): ContextProxy; 39 | override(scope: S): ContextProxy<(T[number] | S)[], T | R>; 40 | } 41 | export type ContextProxy = Merge & ContextCache; 42 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/helpers/helpers.curve.d.ts: -------------------------------------------------------------------------------- 1 | import type { ChartArea } from '../types/index.js'; 2 | import type { SplinePoint } from '../types/geometric.js'; 3 | export declare function splineCurve(firstPoint: SplinePoint, middlePoint: SplinePoint, afterPoint: SplinePoint, t: number): { 4 | previous: SplinePoint; 5 | next: SplinePoint; 6 | }; 7 | /** 8 | * This function calculates Bézier control points in a similar way than |splineCurve|, 9 | * but preserves monotonicity of the provided data and ensures no local extremums are added 10 | * between the dataset discrete points due to the interpolation. 11 | * See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation 12 | */ 13 | export declare function splineCurveMonotone(points: SplinePoint[], indexAxis?: 'x' | 'y'): void; 14 | /** 15 | * @private 16 | */ 17 | export declare function _updateBezierControlPoints(points: SplinePoint[], options: any, area: ChartArea, loop: boolean, indexAxis: 'x' | 'y'): void; 18 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/helpers/helpers.easing.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Easing functions adapted from Robert Penner's easing equations. 3 | * @namespace Chart.helpers.easing.effects 4 | * @see http://www.robertpenner.com/easing/ 5 | */ 6 | declare const effects: { 7 | readonly linear: (t: number) => number; 8 | readonly easeInQuad: (t: number) => number; 9 | readonly easeOutQuad: (t: number) => number; 10 | readonly easeInOutQuad: (t: number) => number; 11 | readonly easeInCubic: (t: number) => number; 12 | readonly easeOutCubic: (t: number) => number; 13 | readonly easeInOutCubic: (t: number) => number; 14 | readonly easeInQuart: (t: number) => number; 15 | readonly easeOutQuart: (t: number) => number; 16 | readonly easeInOutQuart: (t: number) => number; 17 | readonly easeInQuint: (t: number) => number; 18 | readonly easeOutQuint: (t: number) => number; 19 | readonly easeInOutQuint: (t: number) => number; 20 | readonly easeInSine: (t: number) => number; 21 | readonly easeOutSine: (t: number) => number; 22 | readonly easeInOutSine: (t: number) => number; 23 | readonly easeInExpo: (t: number) => number; 24 | readonly easeOutExpo: (t: number) => number; 25 | readonly easeInOutExpo: (t: number) => number; 26 | readonly easeInCirc: (t: number) => number; 27 | readonly easeOutCirc: (t: number) => number; 28 | readonly easeInOutCirc: (t: number) => number; 29 | readonly easeInElastic: (t: number) => number; 30 | readonly easeOutElastic: (t: number) => number; 31 | readonly easeInOutElastic: (t: number) => number; 32 | readonly easeInBack: (t: number) => number; 33 | readonly easeOutBack: (t: number) => number; 34 | readonly easeInOutBack: (t: number) => number; 35 | readonly easeInBounce: (t: number) => number; 36 | readonly easeOutBounce: (t: number) => number; 37 | readonly easeInOutBounce: (t: number) => number; 38 | }; 39 | export type EasingFunction = keyof typeof effects; 40 | export default effects; 41 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/helpers/helpers.extras.d.ts: -------------------------------------------------------------------------------- 1 | import type { ChartMeta, PointElement } from '../types/index.js'; 2 | export declare function fontString(pixelSize: number, fontStyle: string, fontFamily: string): string; 3 | /** 4 | * Request animation polyfill 5 | */ 6 | export declare const requestAnimFrame: (((callback: FrameRequestCallback) => number) & typeof requestAnimationFrame) | ((callback: any) => any); 7 | /** 8 | * Throttles calling `fn` once per animation frame 9 | * Latest arguments are used on the actual call 10 | */ 11 | export declare function throttled>(fn: (...args: TArgs) => void, thisArg: any): (...args: TArgs) => void; 12 | /** 13 | * Debounces calling `fn` for `delay` ms 14 | */ 15 | export declare function debounce>(fn: (...args: TArgs) => void, delay: number): (...args: TArgs) => number; 16 | /** 17 | * Converts 'start' to 'left', 'end' to 'right' and others to 'center' 18 | * @private 19 | */ 20 | export declare const _toLeftRightCenter: (align: 'start' | 'end' | 'center') => "center" | "left" | "right"; 21 | /** 22 | * Returns `start`, `end` or `(start + end) / 2` depending on `align`. Defaults to `center` 23 | * @private 24 | */ 25 | export declare const _alignStartEnd: (align: 'start' | 'end' | 'center', start: number, end: number) => number; 26 | /** 27 | * Returns `left`, `right` or `(left + right) / 2` depending on `align`. Defaults to `left` 28 | * @private 29 | */ 30 | export declare const _textX: (align: 'left' | 'right' | 'center', left: number, right: number, rtl: boolean) => number; 31 | /** 32 | * Return start and count of visible points. 33 | * @private 34 | */ 35 | export declare function _getStartAndCountOfVisiblePoints(meta: ChartMeta<'line' | 'scatter'>, points: PointElement[], animationsDisabled: boolean): { 36 | start: number; 37 | count: number; 38 | }; 39 | /** 40 | * Checks if the scale ranges have changed. 41 | * @param {object} meta - dataset meta. 42 | * @returns {boolean} 43 | * @private 44 | */ 45 | export declare function _scaleRangesChanged(meta: any): boolean; 46 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/helpers/helpers.interpolation.d.ts: -------------------------------------------------------------------------------- 1 | import type { Point, SplinePoint } from '../types/geometric.js'; 2 | /** 3 | * @private 4 | */ 5 | export declare function _pointInLine(p1: Point, p2: Point, t: number, mode?: any): { 6 | x: number; 7 | y: number; 8 | }; 9 | /** 10 | * @private 11 | */ 12 | export declare function _steppedInterpolation(p1: Point, p2: Point, t: number, mode: 'middle' | 'after' | unknown): { 13 | x: number; 14 | y: number; 15 | }; 16 | /** 17 | * @private 18 | */ 19 | export declare function _bezierInterpolation(p1: SplinePoint, p2: SplinePoint, t: number, mode?: any): { 20 | x: number; 21 | y: number; 22 | }; 23 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/helpers/helpers.intl.d.ts: -------------------------------------------------------------------------------- 1 | export declare function formatNumber(num: number, locale: string, options?: Intl.NumberFormatOptions): string; 2 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/helpers/helpers.rtl.d.ts: -------------------------------------------------------------------------------- 1 | export interface RTLAdapter { 2 | x(x: number): number; 3 | setWidth(w: number): void; 4 | textAlign(align: 'center' | 'left' | 'right'): 'center' | 'left' | 'right'; 5 | xPlus(x: number, value: number): number; 6 | leftForLtr(x: number, itemWidth: number): number; 7 | } 8 | export declare function getRtlAdapter(rtl: boolean, rectX: number, width: number): RTLAdapter; 9 | export declare function overrideTextDirection(ctx: CanvasRenderingContext2D, direction: 'ltr' | 'rtl'): void; 10 | export declare function restoreTextDirection(ctx: CanvasRenderingContext2D, original?: [string, string]): void; 11 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/helpers/index.d.ts: -------------------------------------------------------------------------------- 1 | export * from './helpers.color.js'; 2 | export * from './helpers.core.js'; 3 | export * from './helpers.canvas.js'; 4 | export * from './helpers.collection.js'; 5 | export * from './helpers.config.js'; 6 | export * from './helpers.curve.js'; 7 | export * from './helpers.dom.js'; 8 | export { default as easingEffects } from './helpers.easing.js'; 9 | export * from './helpers.extras.js'; 10 | export * from './helpers.interpolation.js'; 11 | export * from './helpers.intl.js'; 12 | export * from './helpers.options.js'; 13 | export * from './helpers.math.js'; 14 | export * from './helpers.rtl.js'; 15 | export * from './helpers.segment.js'; 16 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/index.d.ts: -------------------------------------------------------------------------------- 1 | export * from './controllers/index.js'; 2 | export * from './core/index.js'; 3 | export * from './elements/index.js'; 4 | export * from './platform/index.js'; 5 | export * from './plugins/index.js'; 6 | export * from './scales/index.js'; 7 | import * as controllers from './controllers/index.js'; 8 | import * as elements from './elements/index.js'; 9 | import * as plugins from './plugins/index.js'; 10 | import * as scales from './scales/index.js'; 11 | export { controllers, elements, plugins, scales, }; 12 | export declare const registerables: (typeof controllers | typeof elements | typeof plugins | typeof scales)[]; 13 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/index.umd.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @namespace Chart 3 | */ 4 | import Chart from './core/core.controller.js'; 5 | export default Chart; 6 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/platform/index.d.ts: -------------------------------------------------------------------------------- 1 | export function _detectPlatform(canvas: any): typeof BasicPlatform | typeof DomPlatform; 2 | import BasicPlatform from "./platform.basic.js"; 3 | import DomPlatform from "./platform.dom.js"; 4 | import BasePlatform from "./platform.base.js"; 5 | export { BasePlatform, BasicPlatform, DomPlatform }; 6 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/platform/platform.basic.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Platform class for charts without access to the DOM or to many element properties 3 | * This platform is used by default for any chart passed an OffscreenCanvas. 4 | * @extends BasePlatform 5 | */ 6 | export default class BasicPlatform extends BasePlatform { 7 | acquireContext(item: any): any; 8 | updateConfig(config: any): void; 9 | } 10 | import BasePlatform from "./platform.base.js"; 11 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/platform/platform.dom.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Platform class for charts that can access the DOM and global window/document properties 3 | * @extends BasePlatform 4 | */ 5 | export default class DomPlatform extends BasePlatform { 6 | /** 7 | * @param {HTMLCanvasElement} canvas 8 | * @param {number} [aspectRatio] 9 | * @return {CanvasRenderingContext2D|null} 10 | */ 11 | acquireContext(canvas: HTMLCanvasElement, aspectRatio?: number): CanvasRenderingContext2D | null; 12 | /** 13 | * @param {Chart} chart 14 | * @param {string} type 15 | */ 16 | removeEventListener(chart: Chart, type: string): void; 17 | } 18 | export type Chart = import('../core/core.controller.js').default; 19 | import BasePlatform from "./platform.base.js"; 20 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/plugins/index.d.ts: -------------------------------------------------------------------------------- 1 | export { default as Colors } from "./plugin.colors.js"; 2 | export { default as Decimation } from "./plugin.decimation.js"; 3 | export { default as Filler } from "./plugin.filler/index.js"; 4 | export { default as Legend } from "./plugin.legend.js"; 5 | export { default as SubTitle } from "./plugin.subtitle.js"; 6 | export { default as Title } from "./plugin.title.js"; 7 | export { default as Tooltip } from "./plugin.tooltip.js"; 8 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/plugins/plugin.colors.d.ts: -------------------------------------------------------------------------------- 1 | import type { Chart } from '../types.js'; 2 | export interface ColorsPluginOptions { 3 | enabled?: boolean; 4 | forceOverride?: boolean; 5 | } 6 | declare const _default: { 7 | id: string; 8 | defaults: ColorsPluginOptions; 9 | beforeLayout(chart: Chart, _args: any, options: ColorsPluginOptions): void; 10 | }; 11 | export default _default; 12 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/plugins/plugin.decimation.d.ts: -------------------------------------------------------------------------------- 1 | declare namespace _default { 2 | const id: string; 3 | namespace defaults { 4 | const algorithm: string; 5 | const enabled: boolean; 6 | } 7 | function beforeElementsUpdate(chart: any, args: any, options: any): void; 8 | function destroy(chart: any): void; 9 | } 10 | export default _default; 11 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/plugins/plugin.filler/filler.drawing.d.ts: -------------------------------------------------------------------------------- 1 | export function _drawfill(ctx: any, source: any, area: any): void; 2 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/plugins/plugin.filler/filler.helper.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @param {PointElement[] | { x: number; y: number; }} boundary 3 | * @param {LineElement} line 4 | * @return {LineElement?} 5 | */ 6 | export function _createBoundaryLine(boundary: PointElement[] | { 7 | x: number; 8 | y: number; 9 | }, line: LineElement): LineElement | null; 10 | export function _shouldApplyFill(source: any): boolean; 11 | export type Chart = import('../../core/core.controller.js').default; 12 | export type Scale = import('../../core/core.scale.js').default; 13 | export type PointElement = import('../../elements/element.point.js').default; 14 | import { LineElement } from "../../elements/index.js"; 15 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/plugins/plugin.filler/filler.options.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @typedef { import('../../core/core.scale.js').default } Scale 3 | * @typedef { import('../../elements/element.line.js').default } LineElement 4 | * @typedef { import('../../types/index.js').FillTarget } FillTarget 5 | * @typedef { import('../../types/index.js').ComplexFillTarget } ComplexFillTarget 6 | */ 7 | export function _resolveTarget(sources: any, index: any, propagate: any): any; 8 | /** 9 | * @param {LineElement} line 10 | * @param {number} index 11 | * @param {number} count 12 | */ 13 | export function _decodeFill(line: LineElement, index: number, count: number): any; 14 | /** 15 | * @param {FillTarget | ComplexFillTarget} fill 16 | * @param {Scale} scale 17 | * @returns {number | null} 18 | */ 19 | export function _getTargetPixel(fill: FillTarget | ComplexFillTarget, scale: Scale): number | null; 20 | /** 21 | * @param {FillTarget | ComplexFillTarget} fill 22 | * @param {Scale} scale 23 | * @param {number} startValue 24 | * @returns {number | undefined} 25 | */ 26 | export function _getTargetValue(fill: FillTarget | ComplexFillTarget, scale: Scale, startValue: number): number | undefined; 27 | export type Scale = import('../../core/core.scale.js').default; 28 | export type LineElement = import('../../elements/element.line.js').default; 29 | export type FillTarget = import('../../types/index.js').FillTarget; 30 | export type ComplexFillTarget = import('../../types/index.js').ComplexFillTarget; 31 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/plugins/plugin.filler/filler.segment.d.ts: -------------------------------------------------------------------------------- 1 | export function _segments(line: any, target: any, property: any): ({ 2 | source: any; 3 | target: { 4 | property: any; 5 | start: any; 6 | end: any; 7 | }; 8 | start: any; 9 | end: any; 10 | } | { 11 | source: { 12 | start: number; 13 | end: number; 14 | loop: boolean; 15 | style?: any; 16 | }; 17 | target: { 18 | start: number; 19 | end: number; 20 | loop: boolean; 21 | style?: any; 22 | }; 23 | start: { 24 | [x: number]: any; 25 | }; 26 | end: { 27 | [x: number]: any; 28 | }; 29 | })[]; 30 | export function _getBounds(property: any, first: any, last: any, loop: any): { 31 | property: any; 32 | start: any; 33 | end: any; 34 | }; 35 | export function _pointsFromSegments(boundary: any, line: any): any[]; 36 | export function _findSegmentEnd(start: any, end: any, points: any): any; 37 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/plugins/plugin.filler/filler.target.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @typedef { import('../../core/core.controller.js').default } Chart 3 | * @typedef { import('../../core/core.scale.js').default } Scale 4 | * @typedef { import('../../elements/element.point.js').default } PointElement 5 | */ 6 | export function _getTarget(source: any): any; 7 | export type Chart = import('../../core/core.controller.js').default; 8 | export type Scale = import('../../core/core.scale.js').default; 9 | export type PointElement = import('../../elements/element.point.js').default; 10 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/plugins/plugin.filler/filler.target.stack.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @param {{ chart: Chart; scale: Scale; index: number; line: LineElement; }} source 3 | * @return {LineElement} 4 | */ 5 | export function _buildStackLine(source: { 6 | chart: Chart; 7 | scale: Scale; 8 | index: number; 9 | line: LineElement; 10 | }): LineElement; 11 | export type Chart = import('../../core/core.controller.js').default; 12 | export type Scale = import('../../core/core.scale.js').default; 13 | export type PointElement = import('../../elements/element.point.js').default; 14 | import { LineElement } from "../../elements/index.js"; 15 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/plugins/plugin.filler/index.d.ts: -------------------------------------------------------------------------------- 1 | declare namespace _default { 2 | const id: string; 3 | function afterDatasetsUpdate(chart: any, _args: any, options: any): void; 4 | function beforeDraw(chart: any, _args: any, options: any): void; 5 | function beforeDatasetsDraw(chart: any, _args: any, options: any): void; 6 | function beforeDatasetDraw(chart: any, args: any, options: any): void; 7 | namespace defaults { 8 | const propagate: boolean; 9 | const drawTime: string; 10 | } 11 | } 12 | export default _default; 13 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/plugins/plugin.filler/simpleArc.d.ts: -------------------------------------------------------------------------------- 1 | export class simpleArc { 2 | constructor(opts: any); 3 | x: any; 4 | y: any; 5 | radius: any; 6 | pathSegment(ctx: any, bounds: any, opts: any): boolean; 7 | interpolate(point: any): { 8 | x: any; 9 | y: any; 10 | angle: any; 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/plugins/plugin.subtitle.d.ts: -------------------------------------------------------------------------------- 1 | declare namespace _default { 2 | const id: string; 3 | function start(chart: any, _args: any, options: any): void; 4 | function stop(chart: any): void; 5 | function beforeUpdate(chart: any, _args: any, options: any): void; 6 | namespace defaults { 7 | export const align: string; 8 | export const display: boolean; 9 | export namespace font { 10 | const weight: string; 11 | } 12 | export const fullSize: boolean; 13 | export const padding: number; 14 | export const position: string; 15 | export const text: string; 16 | const weight_1: number; 17 | export { weight_1 as weight }; 18 | } 19 | namespace defaultRoutes { 20 | const color: string; 21 | } 22 | namespace descriptors { 23 | const _scriptable: boolean; 24 | const _indexable: boolean; 25 | } 26 | } 27 | export default _default; 28 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/plugins/plugin.title.d.ts: -------------------------------------------------------------------------------- 1 | export class Title extends Element { 2 | /** 3 | * @param {{ ctx: any; options: any; chart: any; }} config 4 | */ 5 | constructor(config: { 6 | ctx: any; 7 | options: any; 8 | chart: any; 9 | }); 10 | chart: any; 11 | options: any; 12 | ctx: any; 13 | _padding: import("../types.js").ChartArea; 14 | top: number; 15 | bottom: any; 16 | left: number; 17 | right: any; 18 | width: any; 19 | height: any; 20 | position: any; 21 | weight: any; 22 | fullSize: any; 23 | update(maxWidth: any, maxHeight: any): void; 24 | isHorizontal(): boolean; 25 | _drawArgs(offset: any): { 26 | titleX: any; 27 | titleY: any; 28 | maxWidth: number; 29 | rotation: number; 30 | }; 31 | draw(): void; 32 | } 33 | declare namespace _default { 34 | export const id: string; 35 | export { Title as _element }; 36 | export function start(chart: any, _args: any, options: any): void; 37 | export function stop(chart: any): void; 38 | export function beforeUpdate(chart: any, _args: any, options: any): void; 39 | export namespace defaults { 40 | export const align: string; 41 | export const display: boolean; 42 | export namespace font { 43 | const weight: string; 44 | } 45 | export const fullSize: boolean; 46 | export const padding: number; 47 | export const position: string; 48 | export const text: string; 49 | const weight_1: number; 50 | export { weight_1 as weight }; 51 | } 52 | export namespace defaultRoutes { 53 | const color: string; 54 | } 55 | export namespace descriptors { 56 | const _scriptable: boolean; 57 | const _indexable: boolean; 58 | } 59 | } 60 | export default _default; 61 | import Element from "../core/core.element.js"; 62 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/scales/index.d.ts: -------------------------------------------------------------------------------- 1 | export { default as CategoryScale } from "./scale.category.js"; 2 | export { default as LinearScale } from "./scale.linear.js"; 3 | export { default as LogarithmicScale } from "./scale.logarithmic.js"; 4 | export { default as RadialLinearScale } from "./scale.radialLinear.js"; 5 | export { default as TimeScale } from "./scale.time.js"; 6 | export { default as TimeSeriesScale } from "./scale.timeseries.js"; 7 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/scales/scale.category.d.ts: -------------------------------------------------------------------------------- 1 | export default class CategoryScale extends Scale { 2 | static id: string; 3 | /** 4 | * @type {any} 5 | */ 6 | static defaults: any; 7 | /** @type {number} */ 8 | _startValue: number; 9 | _valueRange: number; 10 | _addedLabels: any[]; 11 | init(scaleOptions: any): void; 12 | parse(raw: any, index: any): number; 13 | buildTicks(): { 14 | value: any; 15 | }[]; 16 | getLabelForValue(value: any): any; 17 | getPixelForValue(value: any): number; 18 | getPixelForTick(index: any): number; 19 | getValueForPixel(pixel: any): number; 20 | } 21 | import Scale from "../core/core.scale.js"; 22 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/scales/scale.linear.d.ts: -------------------------------------------------------------------------------- 1 | export default class LinearScale extends LinearScaleBase { 2 | static id: string; 3 | /** 4 | * @type {any} 5 | */ 6 | static defaults: any; 7 | getPixelForValue(value: any): number; 8 | getValueForPixel(pixel: any): number; 9 | } 10 | import LinearScaleBase from "./scale.linearbase.js"; 11 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/scales/scale.linearbase.d.ts: -------------------------------------------------------------------------------- 1 | export default class LinearScaleBase extends Scale { 2 | /** @type {number} */ 3 | start: number; 4 | /** @type {number} */ 5 | end: number; 6 | /** @type {number} */ 7 | _startValue: number; 8 | /** @type {number} */ 9 | _endValue: number; 10 | _valueRange: number; 11 | parse(raw: any, index: any): number; 12 | handleTickRangeOptions(): void; 13 | getTickLimit(): number; 14 | /** 15 | * @protected 16 | */ 17 | protected computeTickLimit(): number; 18 | getLabelForValue(value: any): string; 19 | } 20 | import Scale from "../core/core.scale.js"; 21 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/scales/scale.logarithmic.d.ts: -------------------------------------------------------------------------------- 1 | export default class LogarithmicScale extends Scale { 2 | static id: string; 3 | /** 4 | * @type {any} 5 | */ 6 | static defaults: any; 7 | /** @type {number} */ 8 | start: number; 9 | /** @type {number} */ 10 | end: number; 11 | /** @type {number} */ 12 | _startValue: number; 13 | _valueRange: number; 14 | parse(raw: any, index: any): number; 15 | _zero: boolean; 16 | handleTickRangeOptions(): void; 17 | /** 18 | * @param {number} value 19 | * @return {string} 20 | */ 21 | getLabelForValue(value: number): string; 22 | getPixelForValue(value: any): number; 23 | getValueForPixel(pixel: any): number; 24 | } 25 | import Scale from "../core/core.scale.js"; 26 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/scales/scale.radialLinear.d.ts: -------------------------------------------------------------------------------- 1 | export default class RadialLinearScale extends LinearScaleBase { 2 | static id: string; 3 | /** 4 | * @type {any} 5 | */ 6 | static defaults: any; 7 | static defaultRoutes: { 8 | 'angleLines.color': string; 9 | 'pointLabels.color': string; 10 | 'ticks.color': string; 11 | }; 12 | static descriptors: { 13 | angleLines: { 14 | _fallback: string; 15 | }; 16 | }; 17 | /** @type {number} */ 18 | xCenter: number; 19 | /** @type {number} */ 20 | yCenter: number; 21 | /** @type {number} */ 22 | drawingArea: number; 23 | /** @type {string[]} */ 24 | _pointLabels: string[]; 25 | _pointLabelItems: any[]; 26 | _padding: import("../types.js").ChartArea; 27 | generateTickLabels(ticks: any): void; 28 | setCenterPoint(leftMovement: any, rightMovement: any, topMovement: any, bottomMovement: any): void; 29 | getIndexAngle(index: any): number; 30 | getDistanceFromCenterForValue(value: any): number; 31 | getValueForDistanceFromCenter(distance: any): any; 32 | getPointLabelContext(index: any): any; 33 | getPointPosition(index: any, distanceFromCenter: any, additionalAngle?: number): { 34 | x: number; 35 | y: number; 36 | angle: number; 37 | }; 38 | getPointPositionForValue(index: any, value: any): { 39 | x: number; 40 | y: number; 41 | angle: number; 42 | }; 43 | getBasePosition(index: any): { 44 | x: number; 45 | y: number; 46 | angle: number; 47 | }; 48 | getPointLabelPosition(index: any): { 49 | left: any; 50 | top: any; 51 | right: any; 52 | bottom: any; 53 | }; 54 | /** 55 | * @protected 56 | */ 57 | protected drawGrid(): void; 58 | /** 59 | * @protected 60 | */ 61 | protected drawLabels(): void; 62 | } 63 | import LinearScaleBase from "./scale.linearbase.js"; 64 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/scales/scale.timeseries.d.ts: -------------------------------------------------------------------------------- 1 | export default TimeSeriesScale; 2 | declare class TimeSeriesScale extends TimeScale { 3 | /** @type {object[]} */ 4 | _table: object[]; 5 | /** @type {number} */ 6 | _minPos: number; 7 | /** @type {number} */ 8 | _tableRange: number; 9 | /** 10 | * @protected 11 | */ 12 | protected initOffsets(): void; 13 | /** 14 | * Returns an array of {time, pos} objects used to interpolate a specific `time` or position 15 | * (`pos`) on the scale, by searching entries before and after the requested value. `pos` is 16 | * a decimal between 0 and 1: 0 being the start of the scale (left or top) and 1 the other 17 | * extremity (left + width or top + height). Note that it would be more optimized to directly 18 | * store pre-computed pixels, but the scale dimensions are not guaranteed at the time we need 19 | * to create the lookup table. The table ALWAYS contains at least two items: min and max. 20 | * @param {number[]} timestamps 21 | * @return {object[]} 22 | * @protected 23 | */ 24 | protected buildLookupTable(timestamps: number[]): object[]; 25 | /** 26 | * Generates all timestamps defined in the data. 27 | * Important: this method can return ticks outside the min and max range, it's the 28 | * responsibility of the calling code to clamp values if needed. 29 | * @protected 30 | */ 31 | protected _generate(): any; 32 | /** 33 | * Returns all timestamps 34 | * @return {number[]} 35 | * @private 36 | */ 37 | private _getTimestampsForTable; 38 | } 39 | import TimeScale from "./scale.time.js"; 40 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/types.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Temporary entry point of the types at the time of the transition. 3 | * After transition done need to remove it in favor of index.ts 4 | */ 5 | export * from './index.js'; 6 | /** 7 | * Explicitly re-exporting to resolve the ambiguity. 8 | */ 9 | export { BarController, BubbleController, DoughnutController, LineController, PieController, PolarAreaController, RadarController, ScatterController, Animation, Animations, Chart, DatasetController, Interaction, Scale, Ticks, defaults, layouts, registry, ArcElement, BarElement, LineElement, PointElement, BasePlatform, BasicPlatform, DomPlatform, Decimation, Filler, Legend, SubTitle, Title, Tooltip, CategoryScale, LinearScale, LogarithmicScale, RadialLinearScale, TimeScale, TimeSeriesScale, PluginOptionsByType, ElementOptionsByType, ChartDatasetProperties, UpdateModeEnum, registerables } from './types/index.js'; 10 | export * from './types/index.js'; 11 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/types/animation.d.ts: -------------------------------------------------------------------------------- 1 | import {Chart} from './index.js'; 2 | import {AnyObject} from './basic.js'; 3 | 4 | export declare class Animation { 5 | constructor(cfg: AnyObject, target: AnyObject, prop: string, to?: unknown); 6 | active(): boolean; 7 | update(cfg: AnyObject, to: unknown, date: number): void; 8 | cancel(): void; 9 | tick(date: number): void; 10 | readonly _to: unknown; 11 | } 12 | 13 | export interface AnimationEvent { 14 | chart: Chart; 15 | numSteps: number; 16 | initial: boolean; 17 | currentStep: number; 18 | } 19 | 20 | export declare class Animator { 21 | listen(chart: Chart, event: 'complete' | 'progress', cb: (event: AnimationEvent) => void): void; 22 | add(chart: Chart, items: readonly Animation[]): void; 23 | has(chart: Chart): boolean; 24 | start(chart: Chart): void; 25 | running(chart: Chart): boolean; 26 | stop(chart: Chart): void; 27 | remove(chart: Chart): boolean; 28 | } 29 | 30 | export declare class Animations { 31 | constructor(chart: Chart, animations: AnyObject); 32 | configure(animations: AnyObject): void; 33 | update(target: AnyObject, values: AnyObject): undefined | boolean; 34 | } 35 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/types/basic.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export type AnyObject = Record; 3 | export type EmptyObject = Record; 4 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/types/color.d.ts: -------------------------------------------------------------------------------- 1 | export type Color = string | CanvasGradient | CanvasPattern; 2 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/types/geometric.d.ts: -------------------------------------------------------------------------------- 1 | export interface ChartArea { 2 | top: number; 3 | left: number; 4 | right: number; 5 | bottom: number; 6 | width: number; 7 | height: number; 8 | } 9 | 10 | export interface Point { 11 | x: number; 12 | y: number; 13 | } 14 | 15 | export type TRBL = { 16 | top: number; 17 | right: number; 18 | bottom: number; 19 | left: number; 20 | } 21 | 22 | export type TRBLCorners = { 23 | topLeft: number; 24 | topRight: number; 25 | bottomLeft: number; 26 | bottomRight: number; 27 | }; 28 | 29 | export type CornerRadius = number | Partial; 30 | 31 | export type RoundedRect = { 32 | x: number; 33 | y: number; 34 | w: number; 35 | h: number; 36 | radius?: CornerRadius 37 | } 38 | 39 | export type Padding = Partial | number | Point; 40 | 41 | export interface SplinePoint { 42 | x: number; 43 | y: number; 44 | skip?: boolean; 45 | 46 | // Both Bezier and monotone interpolations have these fields 47 | // but they are added in different spots 48 | cp1x?: number; 49 | cp1y?: number; 50 | cp2x?: number; 51 | cp2y?: number; 52 | } 53 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/types/layout.d.ts: -------------------------------------------------------------------------------- 1 | import {ChartArea} from './geometric.js'; 2 | 3 | export type LayoutPosition = 'left' | 'top' | 'right' | 'bottom' | 'center' | 'chartArea' | {[scaleId: string]: number}; 4 | 5 | export interface LayoutItem { 6 | /** 7 | * The position of the item in the chart layout. Possible values are 8 | */ 9 | position: LayoutPosition; 10 | /** 11 | * The weight used to sort the item. Higher weights are further away from the chart area 12 | */ 13 | weight: number; 14 | /** 15 | * if true, and the item is horizontal, then push vertical boxes down 16 | */ 17 | fullSize: boolean; 18 | /** 19 | * Width of item. Must be valid after update() 20 | */ 21 | width: number; 22 | /** 23 | * Height of item. Must be valid after update() 24 | */ 25 | height: number; 26 | /** 27 | * Left edge of the item. Set by layout system and cannot be used in update 28 | */ 29 | left: number; 30 | /** 31 | * Top edge of the item. Set by layout system and cannot be used in update 32 | */ 33 | top: number; 34 | /** 35 | * Right edge of the item. Set by layout system and cannot be used in update 36 | */ 37 | right: number; 38 | /** 39 | * Bottom edge of the item. Set by layout system and cannot be used in update 40 | */ 41 | bottom: number; 42 | 43 | /** 44 | * Called before the layout process starts 45 | */ 46 | beforeLayout?(): void; 47 | /** 48 | * Draws the element 49 | */ 50 | draw(chartArea: ChartArea): void; 51 | /** 52 | * Returns an object with padding on the edges 53 | */ 54 | getPadding?(): ChartArea; 55 | /** 56 | * returns true if the layout item is horizontal (ie. top or bottom) 57 | */ 58 | isHorizontal(): boolean; 59 | /** 60 | * Takes two parameters: width and height. 61 | * @param width 62 | * @param height 63 | */ 64 | update(width: number, height: number, margins?: ChartArea): void; 65 | } 66 | -------------------------------------------------------------------------------- /src/wwwroot/lib/Chart.js/types/utils.d.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/ban-types */ 2 | 3 | // DeepPartial implementation taken from the utility-types NPM package, which is 4 | // Copyright (c) 2016 Piotr Witek (http://piotrwitek.github.io) 5 | // and used under the terms of the MIT license 6 | export type DeepPartial = T extends Function 7 | ? T 8 | : T extends Array 9 | ? _DeepPartialArray 10 | : T extends object 11 | ? _DeepPartialObject 12 | : T | undefined; 13 | 14 | type _DeepPartialArray = Array> 15 | type _DeepPartialObject = { [P in keyof T]?: DeepPartial }; 16 | 17 | export type DistributiveArray = [T] extends [unknown] ? Array : never 18 | 19 | // https://stackoverflow.com/a/50375286 20 | export type UnionToIntersection = (U extends unknown ? (k: U) => void : never) extends (k: infer I) => void ? I : never; 21 | 22 | export type AllKeys = T extends any ? keyof T : never; 23 | 24 | export type PickType> = T extends { [k in K]?: any } 25 | ? T[K] 26 | : undefined; 27 | 28 | export type Merge = { 29 | [k in AllKeys]: PickType; 30 | }; 31 | -------------------------------------------------------------------------------- /src/wwwroot/lib/chartjs-adapter-moment/chartjs-adapter-moment.esm.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * chartjs-adapter-moment v1.0.1 3 | * https://www.chartjs.org 4 | * (c) 2022 chartjs-adapter-moment Contributors 5 | * Released under the MIT license 6 | */ 7 | import moment from 'moment'; 8 | import { _adapters } from 'chart.js'; 9 | 10 | const FORMATS = { 11 | datetime: 'MMM D, YYYY, h:mm:ss a', 12 | millisecond: 'h:mm:ss.SSS a', 13 | second: 'h:mm:ss a', 14 | minute: 'h:mm a', 15 | hour: 'hA', 16 | day: 'MMM D', 17 | week: 'll', 18 | month: 'MMM YYYY', 19 | quarter: '[Q]Q - YYYY', 20 | year: 'YYYY' 21 | }; 22 | 23 | _adapters._date.override(typeof moment === 'function' ? { 24 | _id: 'moment', // DEBUG ONLY 25 | 26 | formats: function() { 27 | return FORMATS; 28 | }, 29 | 30 | parse: function(value, format) { 31 | if (typeof value === 'string' && typeof format === 'string') { 32 | value = moment(value, format); 33 | } else if (!(value instanceof moment)) { 34 | value = moment(value); 35 | } 36 | return value.isValid() ? value.valueOf() : null; 37 | }, 38 | 39 | format: function(time, format) { 40 | return moment(time).format(format); 41 | }, 42 | 43 | add: function(time, amount, unit) { 44 | return moment(time).add(amount, unit).valueOf(); 45 | }, 46 | 47 | diff: function(max, min, unit) { 48 | return moment(max).diff(moment(min), unit); 49 | }, 50 | 51 | startOf: function(time, unit, weekday) { 52 | time = moment(time); 53 | if (unit === 'isoWeek') { 54 | weekday = Math.trunc(Math.min(Math.max(0, weekday), 6)); 55 | return time.isoWeekday(weekday).startOf('day').valueOf(); 56 | } 57 | return time.startOf(unit).valueOf(); 58 | }, 59 | 60 | endOf: function(time, unit) { 61 | return moment(time).endOf(unit).valueOf(); 62 | } 63 | } : {}); 64 | -------------------------------------------------------------------------------- /src/wwwroot/lib/chartjs-adapter-moment/chartjs-adapter-moment.esm.min.js: -------------------------------------------------------------------------------- 1 | import moment from"moment";import{_adapters}from"chart.js";const FORMATS={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};_adapters._date.override("function"==typeof moment?{_id:"moment",formats:function(){return FORMATS},parse:function(t,e){return"string"==typeof t&&"string"==typeof e?t=moment(t,e):t instanceof moment||(t=moment(t)),t.isValid()?t.valueOf():null},format:function(t,e){return moment(t).format(e)},add:function(t,e,n){return moment(t).add(e,n).valueOf()},diff:function(t,e,n){return moment(t).diff(moment(e),n)},startOf:function(t,e,n){return t=moment(t),"isoWeek"===e?(n=Math.trunc(Math.min(Math.max(0,n),6)),t.isoWeekday(n).startOf("day").valueOf()):t.startOf(e).valueOf()},endOf:function(t,e){return moment(t).endOf(e).valueOf()}}:{}); -------------------------------------------------------------------------------- /src/wwwroot/lib/chartjs-adapter-moment/chartjs-adapter-moment.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * chartjs-adapter-moment v1.0.1 3 | * https://www.chartjs.org 4 | * (c) 2022 chartjs-adapter-moment Contributors 5 | * Released under the MIT license 6 | */ 7 | !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("moment"),require("chart.js")):"function"==typeof define&&define.amd?define(["moment","chart.js"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).moment,e.Chart)}(this,(function(e,t){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=n(e);const a={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};t._adapters._date.override("function"==typeof f.default?{_id:"moment",formats:function(){return a},parse:function(e,t){return"string"==typeof e&&"string"==typeof t?e=f.default(e,t):e instanceof f.default||(e=f.default(e)),e.isValid()?e.valueOf():null},format:function(e,t){return f.default(e).format(t)},add:function(e,t,n){return f.default(e).add(t,n).valueOf()},diff:function(e,t,n){return f.default(e).diff(f.default(t),n)},startOf:function(e,t,n){return e=f.default(e),"isoWeek"===t?(n=Math.trunc(Math.min(Math.max(0,n),6)),e.isoWeekday(n).startOf("day").valueOf()):e.startOf(t).valueOf()},endOf:function(e,t){return f.default(e).endOf(t).valueOf()}}:{})})); 8 | --------------------------------------------------------------------------------