In the following example, a
categorical 12-color palette is used.
@@ -37,16 +31,17 @@
+
+ Set the OnClick callback to react when a scatter point is selected. The callback receives ChartClickEventArgs with the dataset, point index, label, and structured raw X and Y value.
+
-
-
@code {
private const string pageUrl = DemoRouteConstants.Demos_URL_ScatterChart;
private const string pageTitle = "Blazor Scatter Chart";
- private const string pageDescription = "A Blazor Bootstrap scatter chart components are based on basic line charts with the x-axis changed to a linear axis. To use a scatter chart, data must be passed as objects containing X and Y properties.";
+ private const string pageDescription = "BlazorExpress.ChartJS scatter chart components are based on basic line charts with the x-axis changed to a linear axis. To use a scatter chart, data must be passed as objects containing X and Y properties.";
private const string metaTitle = "Blazor Scatter Chart Component";
- private const string metaDescription = "A Blazor Bootstrap scatter chart components are based on basic line charts with the x-axis changed to a linear axis. To use a scatter chart, data must be passed as objects containing X and Y properties.";
+ private const string metaDescription = "BlazorExpress.ChartJS scatter chart components are based on basic line charts with the x-axis changed to a linear axis. To use a scatter chart, data must be passed as objects containing X and Y properties.";
private const string imageUrl = "https://i.imgur.com/GEox0tS.png";
}
diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/ScatterCharts/ScatterChart_Demo_01_Basic_Example.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/ScatterCharts/ScatterChart_Demo_01_Basic_Example.razor
index 9e32eb5bd..5a48d5f8b 100644
--- a/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/ScatterCharts/ScatterChart_Demo_01_Basic_Example.razor
+++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/ScatterCharts/ScatterChart_Demo_01_Basic_Example.razor
@@ -1,4 +1,4 @@
-
+
@code {
private ScatterChart scatterChart = default!;
@@ -35,14 +35,14 @@
private ScatterChartDataset GetRandomRadarChartDataset(int recordIndex)
{
- var c = ColorUtility.CategoricalTwelveColors[recordIndex].ToColor();
+ var c = ColorUtility.CategoricalTwelveColors[recordIndex].ToChartColor();
return new ScatterChartDataset
{
Label = $"Team {recordIndex + 1}",
Data = GetRandomData(),
- BackgroundColor = c.ToRgbaString(), // RGBA
- BorderColor = c.ToRgbString(), // RGB
+ BackgroundColor = c.ToChartRgbaString(), // RGBA
+ BorderColor = c.ToChartRgbString(), // RGB
BorderWidth = 2,
HoverBorderWidth = 4,
};
diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/ScatterCharts/ScatterChart_Demo_02_Dynamic_Data.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/ScatterCharts/ScatterChart_Demo_02_Dynamic_Data.razor
index 49b8b2acd..402c201a9 100644
--- a/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/ScatterCharts/ScatterChart_Demo_02_Dynamic_Data.razor
+++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/ScatterCharts/ScatterChart_Demo_02_Dynamic_Data.razor
@@ -1,4 +1,4 @@
-
+
await RandomizeAsync()"> Randomize
@@ -120,7 +120,7 @@
private ScatterChartDataset GetRandomScatterChartDataset()
{
- var c = ColorUtility.CategoricalTwelveColors[datasetsCount].ToColor();
+ var c = ColorUtility.CategoricalTwelveColors[datasetsCount].ToChartColor();
datasetsCount += 1;
@@ -128,8 +128,8 @@
{
Label = $"Team {datasetsCount}",
Data = GetRandomData(),
- BackgroundColor = c.ToRgbaString(), // RGBA
- BorderColor = c.ToRgbString(), // RGB
+ BackgroundColor = c.ToChartRgbaString(), // RGBA
+ BorderColor = c.ToChartRgbString(), // RGB
BorderWidth = 2,
Fill = true,
HoverBorderWidth = 4,
diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/ScatterCharts/ScatterChart_Demo_03_Click_Event.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/ScatterCharts/ScatterChart_Demo_03_Click_Event.razor
index ab1614c18..c84c959c2 100644
--- a/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/ScatterCharts/ScatterChart_Demo_03_Click_Event.razor
+++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/ScatterCharts/ScatterChart_Demo_03_Click_Event.razor
@@ -1,57 +1,43 @@
-
+
-
- Selected item: @selectedItemMessage
-
+@if (selectedChartItem is not null)
+{
+
+ Selected: @selectedChartItem.DatasetLabel (dataset @selectedChartItem.DatasetIndex),
+ @FormatLabel(selectedChartItem) (index @selectedChartItem.Index),
+ value @FormatValue(selectedChartItem)
+
+}
@code {
private ScatterChart scatterChart = default!;
private ScatterChartOptions scatterChartOptions = default!;
private ChartData chartData = default!;
- private string selectedItemMessage = "Click a point to view its details.";
+ private ChartClickEventArgs? selectedChartItem;
protected override void OnInitialized()
{
chartData = new ChartData
+ {
+ Labels = new List
{ "First", "Second", "Third", "Fourth" },
+ Datasets = new List
{
- Datasets = new List
+ new ScatterChartDataset
{
- new ScatterChartDataset
+ Label = "Measurements",
+ Data = new List
{
- Label = "Team 1",
- Data = new List
- {
- new(15, 25),
- new(22, 48),
- new(38, 32),
- new(55, 67)
- },
- BackgroundColor = ColorUtility.CategoricalTwelveColors[0].ToColor().ToRgbaString(),
- BorderColor = ColorUtility.CategoricalTwelveColors[0].ToColor().ToRgbString(),
- BorderWidth = 2,
- HoverBorderWidth = 4,
- PointRadius = new List { 6 },
- PointHoverRadius = new List { 8 }
+ new(10, 25),
+ new(25, 15),
+ new(35, 40),
+ new(50, 30),
},
- new ScatterChartDataset
- {
- Label = "Team 2",
- Data = new List
- {
- new(12, 35),
- new(28, 30),
- new(41, 52),
- new(63, 72)
- },
- BackgroundColor = ColorUtility.CategoricalTwelveColors[1].ToColor().ToRgbaString(),
- BorderColor = ColorUtility.CategoricalTwelveColors[1].ToColor().ToRgbString(),
- BorderWidth = 2,
- HoverBorderWidth = 4,
- PointRadius = new List { 6 },
- PointHoverRadius = new List { 8 }
- }
- }
- };
+ BackgroundColor = "rgba(255, 159, 64, 0.6)",
+ BorderColor = "rgb(255, 159, 64)",
+ BorderWidth = 2,
+ },
+ },
+ };
scatterChartOptions = new ScatterChartOptions { Responsive = true };
}
@@ -64,8 +50,13 @@
await base.OnAfterRenderAsync(firstRender);
}
- private void OnClick(ChartClickEventArgs eventArgs)
+ private Task HandleClickAsync(ChartClickEventArgs eventArgs)
{
- selectedItemMessage = $"Dataset: {eventArgs.DatasetLabel}, Value: {eventArgs.Value}";
+ selectedChartItem = eventArgs;
+ return Task.CompletedTask;
}
+
+ private static string FormatLabel(ChartClickEventArgs eventArgs) => eventArgs.Label ?? $"point {eventArgs.Index}";
+
+ private static string FormatValue(ChartClickEventArgs eventArgs) => eventArgs.Value?.ToString() ?? "null";
}
diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/Utils_Colors.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/Utils_Colors.razor
index 0d47f71e6..d2fdbe00c 100644
--- a/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/Utils_Colors.razor
+++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/Utils_Colors.razor
@@ -1,4 +1,4 @@
-@using System.Drawing;
+@using System.Drawing;
@@ -183,10 +183,10 @@
public ChartColor(Color color)
{
Name = color.Name;
- Hex = color.ToHexString();
- Hexa = color.ToHexaString();
- Rgb = color.ToRgbString();
- Rgba = color.ToRgbaString();
+ Hex = color.ToChartHexString();
+ Hexa = color.ToChartHexaString();
+ Rgb = color.ToChartRgbString();
+ Rgba = color.ToChartRgbaString();
}
public string Name { get; set; }
diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/_Imports.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/_Imports.razor
new file mode 100644
index 000000000..ca55fbd66
--- /dev/null
+++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/_Imports.razor
@@ -0,0 +1,6 @@
+@using BlazorExpress.ChartJS
+@using Unit = BlazorExpress.ChartJS.Unit
+@using ColorUtility = BlazorExpress.ChartJS.ColorUtility
+@using Alignment = BlazorExpress.ChartJS.DataLabelAlignment
+@using Anchor = BlazorExpress.ChartJS.DataLabelAnchor
+@using BlazorBootstrap.Demo.RCL.Components.Pages.Demos.Charts
diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/BarCharts/BarChart_Doc_01_Documentation.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/BarCharts/BarChart_Doc_01_Documentation.razor
index f5534bc98..169dd5866 100644
--- a/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/BarCharts/BarChart_Doc_01_Documentation.razor
+++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/BarCharts/BarChart_Doc_01_Documentation.razor
@@ -1,4 +1,4 @@
-@attribute [Route(pageUrl)]
+@attribute [Route(pageUrl)]
@layout DocsMainLayout
+
+
@@ -58,4 +62,4 @@
private const string metaTitle = $"Blazor {componentName} Component";
private const string metaDescription = $"This documentation provides a comprehensive reference for the {componentName} component, guiding you through its configuration options.";
private const string imageUrl = DemoScreenshotSrcConstants.Demos_URL_BubbleChart;
-}
\ No newline at end of file
+}
diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/DoughnutCharts/DoughnutChart_Doc_01_Documentation.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/DoughnutCharts/DoughnutChart_Doc_01_Documentation.razor
index 27debe28b..e2c3694e1 100644
--- a/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/DoughnutCharts/DoughnutChart_Doc_01_Documentation.razor
+++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/DoughnutCharts/DoughnutChart_Doc_01_Documentation.razor
@@ -1,4 +1,4 @@
-@attribute [Route(pageUrl)]
+@attribute [Route(pageUrl)]
@layout DocsMainLayout
- Using charts only
- If you only need chart components (without the rest of the Blazor Bootstrap UI), install the BlazorExpress.ChartJS package from NuGet.
- > dotnet add package BlazorExpress.ChartJS
- For setup and usage details, see the BlazorExpress.ChartJS getting started guide .
-
\ No newline at end of file
+
+ Chart Components — Dedicated Library
+
+ Chart components have been moved to the dedicated BlazorExpress.ChartJS library
+ to support independent feature additions and easier maintenance.
+ Complete the following steps in the Blazor project that renders the charts.
+
+
+
+ Install the package used by these demos:
+ dotnet add package BlazorExpress.ChartJS --version 1.2.4
+
+
+ Import the component namespace in _Imports.razor:
+ @@using BlazorExpress.ChartJS
+
+
+ Load the browser scripts in this order from the host page, after the Blazor framework script.
+ The data-labels plugin is needed only when a chart uses data labels.
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.4.1/chart.umd.js"></script>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/chartjs-plugin-datalabels/2.2.0/chartjs-plugin-datalabels.min.js"></script>
+<script src="_content/BlazorExpress.ChartJS/blazorexpress.chartjs.js"></script>
+
+
+
+ See the BlazorExpress.ChartJS website
+ and GitHub repository
+ for current package documentation. We also recommend checking the
+ original BlazorExpress.ChartJS demos
+ when adapting advanced examples.
+
+
diff --git a/BlazorBootstrap.Demo.RCL/Components/Shared/GettingStarted/GettingStarted.razor b/BlazorBootstrap.Demo.RCL/Components/Shared/GettingStarted/GettingStarted.razor
index eec8fb997..39e77bce2 100644
--- a/BlazorBootstrap.Demo.RCL/Components/Shared/GettingStarted/GettingStarted.razor
+++ b/BlazorBootstrap.Demo.RCL/Components/Shared/GettingStarted/GettingStarted.razor
@@ -86,4 +86,8 @@
Blazor Server (.NET 6)
-
\ No newline at end of file
+
+
+
+
+
\ No newline at end of file
diff --git a/BlazorBootstrap.Demo.RCL/Extensions/TypeExtensions.cs b/BlazorBootstrap.Demo.RCL/Extensions/TypeExtensions.cs
index 7d539e964..11796107a 100644
--- a/BlazorBootstrap.Demo.RCL/Extensions/TypeExtensions.cs
+++ b/BlazorBootstrap.Demo.RCL/Extensions/TypeExtensions.cs
@@ -1,4 +1,4 @@
-namespace BlazorBootstrap.Demo.RCL;
+namespace BlazorBootstrap.Demo.RCL;
///
/// Extension methods for .
@@ -67,17 +67,20 @@ public static HashSet GetComponentMethods(this Type type)
{
var methods = new HashSet();
- var includeBlazorBootstrapChartMethods = typeof(BlazorBootstrapChart).IsAssignableFrom(type);
+ var includeChartComponentBaseMethods = typeof(BlazorExpress.ChartJS.ChartComponentBase).IsAssignableFrom(type);
foreach (MethodInfo method in type.GetMethods(BindingFlags.Public | BindingFlags.Instance))
{
+ var isChartComponentBaseMethod = includeChartComponentBaseMethods && method.DeclaringType == typeof(BlazorExpress.ChartJS.ChartComponentBase);
+ var isDocumentedChartClickHandler = isChartComponentBaseMethod && method.Name == nameof(BlazorExpress.ChartJS.ChartComponentBase.HandleClickAsync);
+
// Filter out methods inherited from System.Object (if needed)
if (method.DeclaringType != typeof(object)
&& (method.DeclaringType == type
- || (includeBlazorBootstrapChartMethods && method.DeclaringType == typeof(BlazorBootstrapChart)))
+ || isChartComponentBaseMethod)
&& !method.Name.StartsWith("get_") // Exclude get_ methods
&& !method.Name.StartsWith("set_") // Exclude set_ methods
- && !method.GetCustomAttributes(typeof(JSInvokableAttribute), false).Any()) // Exclude methods that are not general public methods
+ && (!method.GetCustomAttributes(typeof(JSInvokableAttribute), false).Any() || isDocumentedChartClickHandler)) // Exclude methods that are not general public methods
{
methods.Add(method);
}
diff --git a/BlazorBootstrap.Demo.RCL/_Imports.razor b/BlazorBootstrap.Demo.RCL/_Imports.razor
index 0764f8845..870477c55 100644
--- a/BlazorBootstrap.Demo.RCL/_Imports.razor
+++ b/BlazorBootstrap.Demo.RCL/_Imports.razor
@@ -1,4 +1,4 @@
-@using System.Net.Http
+@using System.Net.Http
@using System.Net.Http.Json
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Routing
diff --git a/BlazorBootstrap.Demo.Server/Components/App.razor b/BlazorBootstrap.Demo.Server/Components/App.razor
index 120567bcd..88c376600 100644
--- a/BlazorBootstrap.Demo.Server/Components/App.razor
+++ b/BlazorBootstrap.Demo.Server/Components/App.razor
@@ -1,4 +1,4 @@
-
+
@@ -46,10 +46,11 @@
-
+
-
+
+
diff --git a/BlazorBootstrap.Demo.WebAssembly/wwwroot/index.html b/BlazorBootstrap.Demo.WebAssembly/wwwroot/index.html
index 5bad7d05a..cc6974988 100644
--- a/BlazorBootstrap.Demo.WebAssembly/wwwroot/index.html
+++ b/BlazorBootstrap.Demo.WebAssembly/wwwroot/index.html
@@ -50,10 +50,11 @@
-
+
-
+
+
diff --git a/README.md b/README.md
index 8558cfb70..e7d48e9e6 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-
+
@@ -51,6 +51,11 @@ Install [Blazor Bootstrap templates](https://github.com/vikramlearning/blazorboo
- Read the [Getting started page](https://docs.blazorbootstrap.com/getting-started/blazor-webassembly-net-8) for information on the framework installation, contents, examples, and more.
+## Charts
+
+Chart components have moved out of BlazorBootstrap and are now provided by the dedicated [BlazorExpress.ChartJS](https://chartjs.blazorexpress.com/) package.
+
+This is a breaking change for existing chart users: install `BlazorExpress.ChartJS`, import its namespace, load its browser scripts, and migrate from the former BlazorBootstrap chart API. See the [migration and setup guide](https://docs.blazorbootstrap.com/components/charts), the [GitHub repository](https://github.com/BlazorExpress/BlazorExpress.ChartJS), and the [original demos](https://chartjs.blazorexpress.com/demos/bar-chart).
## Blazor Bootstrap Components
| Component Name | Docs | Demos |
@@ -64,13 +69,6 @@ Install [Blazor Bootstrap templates](https://github.com/vikramlearning/blazorboo
| Callout | [Docs](https://docs.blazorbootstrap.com/components/callout) | [Demos](https://demos.blazorbootstrap.com/callout) |
| Card | [Docs](https://docs.blazorbootstrap.com/components/card) | [Demos](https://demos.blazorbootstrap.com/card) |
| Carousel | [Docs](https://docs.blazorbootstrap.com/components/carousel) | [Demos](https://demos.blazorbootstrap.com/carousel) |
-| Charts: Bar chart | [Docs](https://docs.blazorbootstrap.com/data-visualization/bar-chart) | [Demos](https://demos.blazorbootstrap.com/charts/bar-chart) |
-| Charts: Doughnut chart | [Docs](https://docs.blazorbootstrap.com/data-visualization/doughnut-chart) | [Demos](https://demos.blazorbootstrap.com/charts/doughnut-chart) |
-| Charts: Line chart | [Docs](https://docs.blazorbootstrap.com/data-visualization/line-chart) | [Demos](https://demos.blazorbootstrap.com/charts/line-chart) |
-| Charts: Pie chart | [Docs](https://docs.blazorbootstrap.com/data-visualization/pie-chart) | [Demos](https://demos.blazorbootstrap.com/charts/pie-chart) |
-| Charts: Polar Area chart | [Docs](https://docs.blazorbootstrap.com/data-visualization/polar-area-chart) | [Demos](https://demos.blazorbootstrap.com/charts/polar-area-chart) |
-| Charts: Radar chart | [Docs](https://docs.blazorbootstrap.com/data-visualization/radar-chart) | [Demos](https://demos.blazorbootstrap.com/charts/radar-chart) |
-| Charts: Scatter chart | [Docs](https://docs.blazorbootstrap.com/data-visualization/scatter-chart) | [Demos](https://demos.blazorbootstrap.com/charts/scatter-chart) |
| Checkbox Input | [Docs](https://docs.blazorbootstrap.com/forms/checkbox-input) | [Demos](https://demos.blazorbootstrap.com/form/checkbox-input) |
| Collapse | [Docs](https://docs.blazorbootstrap.com/components/collapse) | [Demos](https://demos.blazorbootstrap.com/collapse) |
| Confirm Dialog | [Docs](https://docs.blazorbootstrap.com/components/confirm-dialog) | [Demos](https://demos.blazorbootstrap.com/confirm-dialog) |
@@ -144,21 +142,6 @@ Blazor Bootstrap's documentation, which is included in this repository's root di
### Blazor Bootstrap - Carousel

-### Blazor Bootstrap - Charts: Bar Chart
-
-
-### Blazor Bootstrap - Charts: Doughnut Chart
-
-
-### Blazor Bootstrap - Charts: Line Chart
-
-
-### Blazor Bootstrap - Charts: Pie Chart
-
-
-### Blazor Bootstrap - Charts: Polar Area Chart
-
-
### Blazor Bootstrap - Checkbox Input

diff --git a/blazorbootstrap/BlazorBootstrap.csproj b/blazorbootstrap/BlazorBootstrap.csproj
index ad742ac5f..5d30e13ce 100644
--- a/blazorbootstrap/BlazorBootstrap.csproj
+++ b/blazorbootstrap/BlazorBootstrap.csproj
@@ -1,4 +1,4 @@
-
+
@@ -10,7 +10,7 @@
Apache-2.0
https://docs.blazorbootstrap.com/
https://github.com/vikramlearning/blazorbootstrap
- Blazor, WebAssembly, BlazorWebAssembly, Bootstrap, Bootstrap5, BlazorBootstrap, BlazorAlert, BlazorAutoComplete, BlazorButtons, BlazorCallout, BlazorCharts, BlazorConfirmDialog, BlazorGrid, BlazorIcon, BlazorImage, BlazorModal, BlazorCheckboxInput, BlazorCurrencyInput, BlazorNumberInput, BlazorInput, BlazorNumber, BlazorDate, BlazorDateInput, BlazorPasswordInput, BlazorDatePicker, BlazorRadioInput, BlazorTextInput, BlazortextAreaInput, BlazorTime, BlazorTimeInput, BlazorTimePicker, BlazorOffcanvas, BlazorPagination, BlazorPdfViewer, BlazorPlaceholders, BlazorPreload, BlazorProgress, BlazorRibbon, BlazorScriptLoader, BlazorSidebar, BlazorSidebar2, BlazorSortableList, BlazorSwitch, BlazorSpinners, BlazorTabs, BlazorToasts, BlazorTooltips, BlazorTooltips, BlazorBarChart, BlazorDoughnutChart, BlazorLineChart, BlazorPieChart, BlazorPolarAreaChart, BlazorRadarChart, BlazorScatterChart, BlazorMarkdown
+ Blazor, WebAssembly, BlazorWebAssembly, Bootstrap, Bootstrap5, BlazorBootstrap, BlazorAlert, BlazorAutoComplete, BlazorButtons, BlazorCallout, BlazorConfirmDialog, BlazorGrid, BlazorIcon, BlazorImage, BlazorModal, BlazorCheckboxInput, BlazorCurrencyInput, BlazorNumberInput, BlazorInput, BlazorNumber, BlazorDate, BlazorDateInput, BlazorPasswordInput, BlazorDatePicker, BlazorRadioInput, BlazorTextInput, BlazortextAreaInput, BlazorTime, BlazorTimeInput, BlazorTimePicker, BlazorOffcanvas, BlazorPagination, BlazorPdfViewer, BlazorPlaceholders, BlazorPreload, BlazorProgress, BlazorRibbon, BlazorScriptLoader, BlazorSidebar, BlazorSidebar2, BlazorSortableList, BlazorSwitch, BlazorSpinners, BlazorTabs, BlazorToasts, BlazorTooltips, BlazorTooltips, BlazorMarkdown
Blazor Bootstrap is a component library built on top of Blazor and Bootstrap5 CSS framework.
Vikram Reddy
diff --git a/blazorbootstrap/Components/Charts/BarChart.razor b/blazorbootstrap/Components/Charts/BarChart.razor
deleted file mode 100644
index da05c573a..000000000
--- a/blazorbootstrap/Components/Charts/BarChart.razor
+++ /dev/null
@@ -1,6 +0,0 @@
-@namespace BlazorBootstrap
-@inherits BlazorBootstrapChart
-
-
-
-
diff --git a/blazorbootstrap/Components/Charts/BarChart.razor.cs b/blazorbootstrap/Components/Charts/BarChart.razor.cs
deleted file mode 100644
index ca3f90ce1..000000000
--- a/blazorbootstrap/Components/Charts/BarChart.razor.cs
+++ /dev/null
@@ -1,147 +0,0 @@
-namespace BlazorBootstrap;
-
-[AddedVersion("1.0.0")]
-public partial class BarChart : BlazorBootstrapChart
-{
- #region Fields and Constants
-
- private const string _jsObjectName = "window.blazorChart.bar";
-
- #endregion
-
- #region Constructors
-
- public BarChart()
- {
- chartType = ChartType.Bar;
- }
-
- #endregion
-
- #region Methods
-
- [AddedVersion("1.10.0")]
- [Description("Adds data to chart.")]
- public override async Task AddDataAsync(ChartData chartData, string dataLabel, IChartDatasetData data)
- {
- if (chartData is null)
- throw new ArgumentNullException(nameof(chartData));
-
- if (chartData.Datasets is null)
- throw new ArgumentNullException(nameof(chartData.Datasets));
-
- if (data is null)
- throw new ArgumentNullException(nameof(data));
-
- foreach (var dataset in chartData.Datasets)
- BarLineChartSupport.AppendDataPoint(dataset, data);
-
- await SafeInvokeVoidAsync($"{_jsObjectName}.addDatasetData", Id, dataLabel, data);
-
- return chartData;
- }
-
- [AddedVersion("1.10.0")]
- [Description("Adds dataset to chart.")]
- public override async Task AddDataAsync(ChartData chartData, string dataLabel, IReadOnlyCollection data)
- {
- if (chartData is null)
- throw new ArgumentNullException(nameof(chartData));
-
- if (chartData.Datasets is null)
- throw new ArgumentNullException(nameof(chartData.Datasets));
-
- if (chartData.Labels is null)
- throw new ArgumentNullException(nameof(chartData.Labels));
-
- if (dataLabel is null)
- throw new ArgumentNullException(nameof(dataLabel));
-
- if (string.IsNullOrWhiteSpace(dataLabel))
- throw new Exception($"{nameof(dataLabel)} cannot be empty.");
-
- if (data is null)
- throw new ArgumentNullException(nameof(data));
-
- if (!data.Any())
- throw new Exception($"{nameof(data)} cannot be empty.");
-
- if (chartData.Datasets.Count != data.Count)
- throw new InvalidDataException("The chart dataset count and the new data points count do not match.");
-
- if (chartData.Labels.Contains(dataLabel))
- throw new Exception($"{dataLabel} already exists.");
-
- chartData.Labels.Add(dataLabel);
-
- foreach (var dataset in chartData.Datasets)
- {
- var chartDatasetData = data.FirstOrDefault(x => x is ChartDatasetData chartDataPoint && chartDataPoint.DatasetLabel == (dataset as dynamic).Label);
-
- if (chartDatasetData is not null)
- BarLineChartSupport.AppendDataPoint(dataset, chartDatasetData);
- }
-
- await SafeInvokeVoidAsync($"{_jsObjectName}.addDatasetsData", Id, dataLabel, data?.OfType());
-
- return chartData;
- }
-
- [AddedVersion("1.10.0")]
- [Description("Adds dataset to chart.")]
- public override async Task AddDatasetAsync(ChartData chartData, IChartDataset chartDataset, IChartOptions chartOptions)
- {
- if (chartData is null)
- throw new ArgumentNullException(nameof(chartData));
-
- if (chartData.Datasets is null)
- throw new ArgumentNullException(nameof(chartData.Datasets));
-
- if (chartDataset is null)
- throw new ArgumentNullException(nameof(chartDataset));
-
- if (BarLineChartSupport.IsSupportedDataset(chartDataset))
- {
- chartData.Datasets.Add(chartDataset);
- await SafeInvokeVoidAsync($"{_jsObjectName}.addDataset", Id, chartDataset);
- }
-
- return chartData;
- }
-
- [AddedVersion("1.0.0")]
- [Description("Initializes the chart.")]
- public override async Task InitializeAsync(ChartData chartData, IChartOptions chartOptions, string[]? plugins = null)
- {
- if (chartData is null)
- throw new ArgumentNullException(nameof(chartData));
-
- if (chartData.Datasets is null)
- throw new ArgumentNullException(nameof(chartData.Datasets));
-
- if (chartOptions is null)
- throw new ArgumentNullException(nameof(chartOptions));
-
- var data = new { chartData.Labels, Datasets = BarLineChartSupport.GetSupportedDatasets(chartData) };
- await SafeInvokeVoidAsync($"{_jsObjectName}.initialize", Id, GetChartType(), data, (BarChartOptions)chartOptions, plugins, ObjRef);
- }
-
- [AddedVersion("1.0.0")]
- [Description("Updates the chart.")]
- public override async Task UpdateAsync(ChartData chartData, IChartOptions chartOptions)
- {
- if (chartData is null)
- throw new ArgumentNullException(nameof(chartData));
-
- if (chartData.Datasets is null)
- throw new ArgumentNullException(nameof(chartData.Datasets));
-
- if (chartOptions is null)
- throw new ArgumentNullException(nameof(chartOptions));
-
- var data = new { chartData.Labels, Datasets = BarLineChartSupport.GetSupportedDatasets(chartData) };
- await SafeInvokeVoidAsync($"{_jsObjectName}.update", Id, GetChartType(), data, (BarChartOptions)chartOptions, ObjRef);
- }
-
- #endregion
-}
diff --git a/blazorbootstrap/Components/Charts/BarLineChartSupport.cs b/blazorbootstrap/Components/Charts/BarLineChartSupport.cs
deleted file mode 100644
index 0e7f935a3..000000000
--- a/blazorbootstrap/Components/Charts/BarLineChartSupport.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-namespace BlazorBootstrap;
-
-internal static class BarLineChartSupport
-{
- internal static void AppendDataPoint(IChartDataset dataset, IChartDatasetData chartDatasetData)
- {
- if (chartDatasetData is not ChartDatasetData chartDataPoint || !TryGetDataValue(chartDataPoint, out var value))
- return;
-
- switch (dataset)
- {
- case BarChartDataset barChartDataset when barChartDataset.Label == chartDataPoint.DatasetLabel:
- barChartDataset.Data ??= new List();
- barChartDataset.Data.Add(value);
- break;
- case LineChartDataset lineChartDataset when lineChartDataset.Label == chartDataPoint.DatasetLabel:
- lineChartDataset.Data ??= new List();
- lineChartDataset.Data.Add(value);
- break;
- }
- }
-
- internal static IEnumerable GetSupportedDatasets(ChartData chartData)
- {
- if (chartData?.Datasets is null)
- yield break;
-
- foreach (var dataset in chartData.Datasets)
- switch (dataset)
- {
- case BarChartDataset barChartDataset:
- yield return barChartDataset;
- break;
- case LineChartDataset lineChartDataset:
- yield return lineChartDataset;
- break;
- }
- }
-
- internal static bool IsSupportedDataset(IChartDataset chartDataset) => chartDataset is BarChartDataset or LineChartDataset;
-
- private static bool TryGetDataValue(ChartDatasetData chartDatasetData, out double? value)
- {
- switch (chartDatasetData.Data)
- {
- case double number:
- value = number;
- return true;
- case int number:
- value = number;
- return true;
- case float number:
- value = number;
- return true;
- case decimal number:
- value = (double)number;
- return true;
- case null:
- value = null;
- return true;
- default:
- value = null;
- return false;
- }
- }
-}
\ No newline at end of file
diff --git a/blazorbootstrap/Components/Charts/BlazorBootstrapChart.cs b/blazorbootstrap/Components/Charts/BlazorBootstrapChart.cs
deleted file mode 100644
index b694f82fa..000000000
--- a/blazorbootstrap/Components/Charts/BlazorBootstrapChart.cs
+++ /dev/null
@@ -1,309 +0,0 @@
-namespace BlazorBootstrap;
-
-///
-/// Base class for BlazorBootstrap chart components.
-///
-[AddedVersion("1.0.0")]
-public class BlazorBootstrapChart : BlazorBootstrapComponentBase, IDisposable, IAsyncDisposable
-{
- #region Fields and Constants
-
- internal ChartType chartType;
-
- private DotNetObjectReference? objRef;
-
- #endregion
-
- #region Methods
-
- //public async Task Stop() { }
-
- //public async Task ToBase64Image() { }
-
- //public async Task ToBase64Image(string type, double quality) { }
-
- ///
- /// Adds a data point to each dataset in the chart.
- ///
- /// The current chart data.
- /// The label to append.
- /// The data point to append.
- /// The updated chart data.
- [AddedVersion("1.10.0")]
- [Description("Adds data to chart.")]
- public virtual async Task AddDataAsync(ChartData chartData, string dataLabel, IChartDatasetData data) => await Task.FromResult(chartData);
-
- ///
- /// Adds a labeled batch of data points to the chart.
- ///
- /// The current chart data.
- /// The label to append.
- /// The dataset values to append.
- /// The updated chart data.
- [AddedVersion("1.10.0")]
- [Description("Adds dataset to chart.")]
- public virtual async Task AddDataAsync(ChartData chartData, string dataLabel, IReadOnlyCollection data) => await Task.FromResult(chartData);
-
- ///
- /// Adds a dataset to the chart.
- ///
- /// The current chart data.
- /// The dataset to append.
- /// The current chart options.
- /// The updated chart data.
- [AddedVersion("1.10.0")]
- [Description("Adds dataset to chart.")]
- public virtual async Task AddDatasetAsync(ChartData chartData, IChartDataset chartDataset, IChartOptions chartOptions) => await Task.FromResult(chartData);
-
- ///
- public new virtual void Dispose() => Dispose(true);
-
- ///
- public new virtual async ValueTask DisposeAsync()
- {
- await DisposeAsyncCore(true);
- Dispose(false);
- }
-
- //public async Task Clear() { }
-
- ///
- /// Initializes the chart.
- ///
- /// The chart data to render.
- /// The chart options to apply.
- /// The optional Chart.js plugins to enable.
- [AddedVersion("1.0.0")]
- [Description("Initializes the chart.")]
- public virtual async Task InitializeAsync(ChartData chartData, IChartOptions chartOptions, string[]? plugins = null)
- {
- if (chartData is not null && chartData.Datasets is not null && chartData.Datasets.Any())
- {
- var _data = GetChartDataObject(chartData);
-
- if (chartType == ChartType.Bar)
- await SafeInvokeVoidAsync("window.blazorChart.bar.initialize", Id, GetChartType(), _data, (BarChartOptions)chartOptions, plugins, ObjRef);
- else if (chartType == ChartType.Line)
- await SafeInvokeVoidAsync("window.blazorChart.line.initialize", Id, GetChartType(), _data, (LineChartOptions)chartOptions, plugins, ObjRef);
- else
- await SafeInvokeVoidAsync("window.blazorChart.initialize", Id, GetChartType(), _data, chartOptions, plugins, ObjRef);
- }
- }
-
- [JSInvokable]
- public async Task HandleClickAsync(ChartClickEventArgs eventArgs) => await OnClick.InvokeAsync(eventArgs);
-
- ///
- protected override void OnInitialized()
- {
- objRef ??= DotNetObjectReference.Create(this);
-
- base.OnInitialized();
- }
-
- //public async Task Render() { }
-
- //public async Task Reset() { }
-
- ///
- /// Resizes the chart.
- ///
- /// The new width value.
- /// The new height value.
- /// The unit of measure for the width.
- /// The unit of measure for the height.
- [AddedVersion("1.0.0")]
- [Description("Resizes the chart.")]
- public async Task ResizeAsync(int width, int height, Unit widthUnit = Unit.Px, Unit heightUnit = Unit.Px)
- {
- var widthWithUnit = $"width:{width.ToString(CultureInfo.InvariantCulture)}{widthUnit.ToCssString()}";
- var heightWithUnit = $"height:{height.ToString(CultureInfo.InvariantCulture)}{heightUnit.ToCssString()}";
- await SafeInvokeVoidAsync("window.blazorChart.resize", Id, widthWithUnit, heightWithUnit);
- }
-
- ///
- /// Update chart by reapplying all chart data and options.
- /// If animation is enabled, this will animate the datasets from scratch.
- ///
- /// The updated chart data.
- /// The updated chart options.
- [AddedVersion("1.0.0")]
- [Description("Updates the chart.")]
- public virtual async Task UpdateAsync(ChartData chartData, IChartOptions chartOptions)
- {
- if (chartData is not null && chartData.Datasets is not null && chartData.Datasets.Any())
- {
- var data = GetChartDataObject(chartData);
-
- if (chartType == ChartType.Bar)
- await SafeInvokeVoidAsync("window.blazorChart.bar.update", Id, GetChartType(), data, (BarChartOptions)chartOptions, ObjRef);
- else if (chartType == ChartType.Line)
- await SafeInvokeVoidAsync("window.blazorChart.line.update", Id, GetChartType(), data, (LineChartOptions)chartOptions, ObjRef);
- else
- await SafeInvokeVoidAsync("window.blazorChart.update", Id, GetChartType(), data, chartOptions, ObjRef);
- }
- }
-
- protected override void Dispose(bool disposing)
- {
- if (disposing)
- objRef?.Dispose();
-
- base.Dispose(disposing);
- }
-
- protected override ValueTask DisposeAsyncCore(bool disposing)
- {
- if (disposing)
- objRef?.Dispose();
-
- return base.DisposeAsyncCore(disposing);
- }
-
- ///
- /// Update only data labels and values. If animation is enabled, this will animate the datapoints.
- /// Changes to the options will not be applied.
- ///
- /// The updated chart data. Only dataset labels and values will be applied.
- [AddedVersion("3.0.0")]
- [Description("Updates only data labels and values. Changes to the options are not applied.")]
- public virtual async Task UpdateValuesAsync(ChartData chartData)
- {
- if (chartData is not null && chartData.Datasets is not null && chartData.Datasets.Any())
- {
- var data = GetChartDataObject(chartData);
-
- if (chartType == ChartType.Bar)
- await SafeInvokeVoidAsync("window.blazorChart.bar.updateDataValues", Id, data);
- else if (chartType == ChartType.Line)
- await SafeInvokeVoidAsync("window.blazorChart.line.updateDataValues", Id, data);
- else
- await SafeInvokeVoidAsync("window.blazorChart.updateDataValues", Id, data);
- }
- }
-
- protected string GetChartType() =>
- chartType switch
- {
- ChartType.Bar => "bar",
- ChartType.Bubble => "bubble",
- ChartType.Doughnut => "doughnut",
- ChartType.Line => "line",
- ChartType.Pie => "pie",
- ChartType.PolarArea => "polarArea",
- ChartType.Radar => "radar",
- ChartType.Scatter => "scatter",
- _ => "line" // default
- };
-
- private string GetChartContainerSizeAsStyle()
- {
- var style = "";
-
- if (Width > 0)
- style += $"width:{Width.Value.ToString(CultureInfo.InvariantCulture)}{WidthUnit.ToCssString()};";
-
- if (Height > 0)
- style += $"height:{Height.Value.ToString(CultureInfo.InvariantCulture)}{HeightUnit.ToCssString()};";
-
- return style;
- }
-
- private object GetChartDataObject(ChartData chartData)
- {
- var datasets = new List();
-
- if (chartData?.Datasets?.Any() ?? false)
- foreach (var dataset in chartData.Datasets)
- if (dataset is BarChartDataset)
- datasets.Add((BarChartDataset)dataset);
- else if (dataset is BubbleChartDataset)
- datasets.Add((BubbleChartDataset)dataset);
- else if (dataset is DoughnutChartDataset)
- datasets.Add((DoughnutChartDataset)dataset);
- else if (dataset is LineChartDataset)
- datasets.Add((LineChartDataset)dataset);
- else if (dataset is PieChartDataset)
- datasets.Add((PieChartDataset)dataset);
- else if (dataset is PolarAreaChartDataset)
- datasets.Add((PolarAreaChartDataset)dataset);
- else if (dataset is RadarChartDataset)
- datasets.Add((RadarChartDataset)dataset);
- else if (dataset is ScatterChartDataset)
- datasets.Add((ScatterChartDataset)dataset);
-
- var data = new { chartData?.Labels, Datasets = datasets };
-
- return data;
- }
-
- #endregion
-
- #region Properties, Indexers
-
- internal string ContainerStyle => GetChartContainerSizeAsStyle();
-
- ///
- /// Fired when a chart data point is clicked.
- ///
- [AddedVersion("4.0.0")]
- [Description("Fired when a chart data point is clicked.")]
- [Parameter]
- public EventCallback OnClick { get; set; }
-
- protected DotNetObjectReference? ObjRef => objRef;
-
- ///
- /// Gets or sets chart container height.
- /// The default unit of measure is .
- /// To change the unit of measure see .
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("1.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets chart container height. The default unit of measure is Unit.Px. To change the unit of measure see HeightUnit .")]
- [Parameter]
- public int? Height { get; set; }
-
- ///
- /// Gets or sets chart container height unit of measure.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("1.0.0")]
- [DefaultValue(Unit.Px)]
- [Description("Gets or sets chart container height unit of measure.")]
- [Parameter]
- public Unit HeightUnit { get; set; } = Unit.Px;
-
- ///
- /// Gets or sets chart container width.
- /// The default unit of measure is .
- /// To change the unit of measure see .
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("1.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets chart container width. The default unit of measure is Unit.Px. To change the unit of measure see WidthUnit .")]
- [Parameter]
- public int? Width { get; set; }
-
- ///
- /// Gets or sets chart container width unit of measure.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("1.0.0")]
- [DefaultValue(Unit.Px)]
- [Description("Gets or sets chart container width unit of measure.")]
- [Parameter]
- public Unit WidthUnit { get; set; } = Unit.Px;
-
- #endregion
-}
diff --git a/blazorbootstrap/Components/Charts/BubbleChart.razor b/blazorbootstrap/Components/Charts/BubbleChart.razor
deleted file mode 100644
index 9aa25e1e2..000000000
--- a/blazorbootstrap/Components/Charts/BubbleChart.razor
+++ /dev/null
@@ -1,6 +0,0 @@
-@namespace BlazorBootstrap
-@inherits BlazorBootstrapChart
-
-
-
-
\ No newline at end of file
diff --git a/blazorbootstrap/Components/Charts/BubbleChart.razor.cs b/blazorbootstrap/Components/Charts/BubbleChart.razor.cs
deleted file mode 100644
index cbc0e901b..000000000
--- a/blazorbootstrap/Components/Charts/BubbleChart.razor.cs
+++ /dev/null
@@ -1,152 +0,0 @@
-namespace BlazorBootstrap;
-
-[AddedVersion("4.0.0")]
-public partial class BubbleChart : BlazorBootstrapChart
-{
- #region Fields and Constants
-
- private const string _jsObjectName = "window.blazorChart.bubble";
-
- #endregion
-
- #region Constructors
-
- public BubbleChart()
- {
- chartType = ChartType.Bubble;
- }
-
- #endregion
-
- #region Methods
-
- [AddedVersion("4.0.0")]
- [Description("Adds data to chart.")]
- public override async Task AddDataAsync(ChartData chartData, string dataLabel, IChartDatasetData data)
- {
- if (chartData is null)
- throw new ArgumentNullException(nameof(chartData));
-
- if (chartData.Datasets is null)
- throw new ArgumentNullException(nameof(chartData.Datasets));
-
- if (data is null)
- throw new ArgumentNullException(nameof(data));
-
- foreach (var dataset in chartData.Datasets)
- if (dataset is BubbleChartDataset bubbleChartDataset && bubbleChartDataset.Label == dataLabel)
- if (data is BubbleChartDatasetData bubbleChartDatasetData && bubbleChartDatasetData.Data is BubbleChartDataPoint bubbleChartDataPoint)
- bubbleChartDataset.Data?.Add(bubbleChartDataPoint);
-
- await SafeInvokeVoidAsync($"{_jsObjectName}.addDatasetData", Id, dataLabel, data);
-
- return chartData;
- }
-
- [AddedVersion("4.0.0")]
- [Description("Adds dataset to chart.")]
- public override async Task AddDataAsync(ChartData chartData, string dataLabel, IReadOnlyCollection data)
- {
- if (chartData is null)
- throw new ArgumentNullException(nameof(chartData));
-
- if (chartData.Datasets is null)
- throw new ArgumentException("chartData.Datasets must not be null", nameof(chartData));
-
- if (chartData.Labels is null)
- throw new ArgumentException("chartData.Labels must not be null", nameof(chartData));
-
- if (dataLabel is null)
- throw new ArgumentNullException(nameof(dataLabel));
-
- if (string.IsNullOrWhiteSpace(dataLabel))
- throw new Exception($"{nameof(dataLabel)} cannot be empty.");
-
- if (data is null)
- throw new ArgumentNullException(nameof(data));
-
- if (!data.Any())
- throw new ArgumentException($"{nameof(data)} cannot be empty.", nameof(data));
-
- if (chartData.Datasets.Count != data.Count)
- throw new InvalidDataException("The chart dataset count and the new data points count do not match.");
-
- if (chartData.Labels.Contains(dataLabel))
- throw new Exception($"{dataLabel} already exists.");
-
- chartData.Labels.Add(dataLabel);
-
- foreach (var dataset in chartData.Datasets)
- if (dataset is BubbleChartDataset bubbleChartDataset)
- {
- var chartDatasetData = data.FirstOrDefault(x => x is BubbleChartDatasetData bubbleChartDatasetData && bubbleChartDatasetData.DatasetLabel == bubbleChartDataset.Label);
-
- if (chartDatasetData is BubbleChartDatasetData bubbleChartDatasetData && bubbleChartDatasetData.Data is BubbleChartDataPoint bubbleChartDataPoint)
- bubbleChartDataset.Data?.Add(bubbleChartDataPoint);
- }
-
- await SafeInvokeVoidAsync($"{_jsObjectName}.addDatasetsData", Id, dataLabel, data?.Select(x => (BubbleChartDatasetData)x));
-
- return chartData;
- }
-
- [AddedVersion("4.0.0")]
- [Description("Adds dataset to chart.")]
- public override async Task AddDatasetAsync(ChartData chartData, IChartDataset chartDataset, IChartOptions chartOptions)
- {
- if (chartData is null)
- throw new ArgumentNullException(nameof(chartData));
-
- if (chartData.Datasets is null)
- throw new ArgumentException("chartData.Datasets must not be null", nameof(chartData));
-
- if (chartDataset is null)
- throw new ArgumentNullException(nameof(chartDataset));
-
- if (chartDataset is BubbleChartDataset)
- {
- chartData.Datasets.Add(chartDataset);
- await SafeInvokeVoidAsync($"{_jsObjectName}.addDataset", Id, (BubbleChartDataset)chartDataset);
- }
-
- return chartData;
- }
-
- [AddedVersion("4.0.0")]
- [Description("Initializes the chart.")]
- public override async Task InitializeAsync(ChartData chartData, IChartOptions chartOptions, string[]? plugins = null)
- {
- if (chartData is null)
- throw new ArgumentNullException(nameof(chartData));
-
- if (chartData.Datasets is null)
- throw new ArgumentNullException(nameof(chartData.Datasets));
-
- if (chartOptions is null)
- throw new ArgumentNullException(nameof(chartOptions));
-
- var datasets = chartData.Datasets.OfType();
- var data = new { chartData.Labels, Datasets = datasets };
- await SafeInvokeVoidAsync($"{_jsObjectName}.initialize", Id, GetChartType(), data, (BubbleChartOptions)chartOptions, plugins, ObjRef);
- }
-
- [AddedVersion("4.0.0")]
- [Description("Updates the chart.")]
- public override async Task UpdateAsync(ChartData chartData, IChartOptions chartOptions)
- {
- if (chartData is null)
- throw new ArgumentNullException(nameof(chartData));
-
- if (chartData.Datasets is null)
- throw new ArgumentNullException(nameof(chartData.Datasets));
-
- if (chartOptions is null)
- throw new ArgumentNullException(nameof(chartOptions));
-
- var datasets = chartData.Datasets.OfType();
- var data = new { chartData.Labels, Datasets = datasets };
- await SafeInvokeVoidAsync($"{_jsObjectName}.update", Id, GetChartType(), data, (BubbleChartOptions)chartOptions, ObjRef);
- }
-
- #endregion
-}
\ No newline at end of file
diff --git a/blazorbootstrap/Components/Charts/DoughnutChart.razor b/blazorbootstrap/Components/Charts/DoughnutChart.razor
deleted file mode 100644
index da05c573a..000000000
--- a/blazorbootstrap/Components/Charts/DoughnutChart.razor
+++ /dev/null
@@ -1,6 +0,0 @@
-@namespace BlazorBootstrap
-@inherits BlazorBootstrapChart
-
-
-
-
diff --git a/blazorbootstrap/Components/Charts/DoughnutChart.razor.cs b/blazorbootstrap/Components/Charts/DoughnutChart.razor.cs
deleted file mode 100644
index d5ceb4b0d..000000000
--- a/blazorbootstrap/Components/Charts/DoughnutChart.razor.cs
+++ /dev/null
@@ -1,146 +0,0 @@
-namespace BlazorBootstrap;
-
-[AddedVersion("1.0.0")]
-public partial class DoughnutChart : BlazorBootstrapChart
-{
- #region Fields and Constants
-
- private const string _jsObjectName = "window.blazorChart.doughnut";
-
- #endregion
-
- #region Constructors
-
- public DoughnutChart()
- {
- chartType = ChartType.Doughnut;
- }
-
- #endregion
-
- #region Methods
-
- [AddedVersion("1.10.0")]
- [Description("Adds data to chart.")]
- public override async Task AddDataAsync(ChartData chartData, string dataLabel, IChartDatasetData data)
- {
- if (chartData is null)
- throw new ArgumentNullException(nameof(chartData));
-
- if (chartData.Datasets is null)
- throw new ArgumentNullException(nameof(chartData.Datasets));
-
- if (data is null)
- throw new ArgumentNullException(nameof(data));
-
- foreach (var dataset in chartData.Datasets)
- if (dataset is DoughnutChartDataset doughnutChartDataset && doughnutChartDataset.Label == dataLabel)
- if (data is DoughnutChartDatasetData doughnutChartDatasetData)
- {
- doughnutChartDataset.Data?.Add(doughnutChartDatasetData.Data as double?);
- doughnutChartDataset.BackgroundColor?.Add(doughnutChartDatasetData.BackgroundColor!);
- }
-
- await SafeInvokeVoidAsync($"{_jsObjectName}.addDatasetData", Id, dataLabel, data);
-
- return chartData;
- }
-
- [AddedVersion("1.10.0")]
- [Description("Adds dataset to chart.")]
- public override async Task AddDataAsync(ChartData chartData, string dataLabel, IReadOnlyCollection data)
- {
- if (chartData is null)
- throw new ArgumentNullException(nameof(chartData));
-
- if (chartData.Datasets is null)
- throw new ArgumentNullException(nameof(chartData.Datasets));
-
- if (chartData.Labels is null)
- throw new ArgumentNullException(nameof(chartData.Labels));
-
- if (dataLabel is null)
- throw new ArgumentNullException(nameof(dataLabel));
-
- if (string.IsNullOrWhiteSpace(dataLabel))
- throw new Exception($"{nameof(dataLabel)} cannot be empty.");
-
- if (data is null)
- throw new ArgumentNullException(nameof(data));
-
- if (!data.Any())
- throw new Exception($"{nameof(data)} cannot be empty.");
-
- if (chartData.Datasets.Count != data.Count)
- throw new InvalidDataException("The chart dataset count and the new data points count do not match.");
-
- if (chartData.Labels.Contains(dataLabel))
- throw new Exception($"{dataLabel} already exists.");
-
- chartData.Labels.Add(dataLabel);
-
- foreach (var dataset in chartData.Datasets)
- if (dataset is DoughnutChartDataset doughnutChartDataset)
- {
- var chartDatasetData = data.FirstOrDefault(x => x is DoughnutChartDatasetData doughnutChartDatasetData && doughnutChartDatasetData.DatasetLabel == doughnutChartDataset.Label);
-
- if (chartDatasetData is DoughnutChartDatasetData doughnutChartDatasetData)
- {
- doughnutChartDataset.Data?.Add(doughnutChartDatasetData.Data as double?);
- doughnutChartDataset.BackgroundColor?.Add(doughnutChartDatasetData.BackgroundColor!);
- }
- }
-
- await SafeInvokeVoidAsync($"{_jsObjectName}.addDatasetsData", Id, dataLabel, data?.Select(x => (DoughnutChartDatasetData)x));
-
- return chartData;
- }
-
- [AddedVersion("1.10.0")]
- [Description("Adds dataset to chart.")]
- public override async Task AddDatasetAsync(ChartData chartData, IChartDataset chartDataset, IChartOptions chartOptions)
- {
- if (chartData is null)
- throw new ArgumentNullException(nameof(chartData));
-
- if (chartData.Datasets is null)
- throw new ArgumentNullException(nameof(chartData.Datasets));
-
- if (chartDataset is null)
- throw new ArgumentNullException(nameof(chartDataset));
-
- if (chartDataset is DoughnutChartDataset doughnutChartDataset)
- {
- chartData.Datasets.Add(doughnutChartDataset);
- await SafeInvokeVoidAsync($"{_jsObjectName}.addDataset", Id, doughnutChartDataset);
- }
-
- return chartData;
- }
-
- [AddedVersion("1.0.0")]
- [Description("Initializes the chart.")]
- public override async Task InitializeAsync(ChartData chartData, IChartOptions chartOptions, string[]? plugins = null)
- {
- if (chartData is not null && chartData.Datasets is not null)
- {
- var datasets = chartData.Datasets.OfType();
- var data = new { chartData.Labels, Datasets = datasets };
- await SafeInvokeVoidAsync($"{_jsObjectName}.initialize", Id, GetChartType(), data, (DoughnutChartOptions)chartOptions, plugins, ObjRef);
- }
- }
-
- [AddedVersion("1.0.0")]
- [Description("Updates the chart.")]
- public override async Task UpdateAsync(ChartData chartData, IChartOptions chartOptions)
- {
- if (chartData is not null && chartData.Datasets is not null)
- {
- var datasets = chartData.Datasets.OfType();
- var data = new { chartData.Labels, Datasets = datasets };
- await SafeInvokeVoidAsync($"{_jsObjectName}.update", Id, GetChartType(), data, (DoughnutChartOptions)chartOptions, ObjRef);
- }
- }
-
- #endregion
-}
diff --git a/blazorbootstrap/Components/Charts/LineChart.razor b/blazorbootstrap/Components/Charts/LineChart.razor
deleted file mode 100644
index da05c573a..000000000
--- a/blazorbootstrap/Components/Charts/LineChart.razor
+++ /dev/null
@@ -1,6 +0,0 @@
-@namespace BlazorBootstrap
-@inherits BlazorBootstrapChart
-
-
-
-
diff --git a/blazorbootstrap/Components/Charts/LineChart.razor.cs b/blazorbootstrap/Components/Charts/LineChart.razor.cs
deleted file mode 100644
index ad4c0f6dd..000000000
--- a/blazorbootstrap/Components/Charts/LineChart.razor.cs
+++ /dev/null
@@ -1,141 +0,0 @@
-namespace BlazorBootstrap;
-
-[AddedVersion("1.0.0")]
-public partial class LineChart : BlazorBootstrapChart
-{
- #region Constructors
-
- public LineChart()
- {
- chartType = ChartType.Line;
- }
-
- #endregion
-
- #region Methods
-
- [AddedVersion("1.10.0")]
- [Description("Adds data to chart.")]
- public override async Task AddDataAsync(ChartData chartData, string dataLabel, IChartDatasetData data)
- {
- if (chartData is null)
- throw new ArgumentNullException(nameof(chartData));
-
- if (chartData.Datasets is null)
- throw new ArgumentNullException(nameof(chartData.Datasets));
-
- if (data is null)
- throw new ArgumentNullException(nameof(data));
-
- foreach (var dataset in chartData.Datasets)
- BarLineChartSupport.AppendDataPoint(dataset, data);
-
- await SafeInvokeVoidAsync("window.blazorChart.line.addDatasetData", Id, dataLabel, data);
-
- return chartData;
- }
-
- [AddedVersion("1.10.0")]
- [Description("Adds dataset to chart.")]
- public override async Task AddDataAsync(ChartData chartData, string dataLabel, IReadOnlyCollection data)
- {
- if (chartData is null)
- throw new ArgumentNullException(nameof(chartData));
-
- if (chartData.Datasets is null)
- throw new ArgumentException("chartData.Datasets must not be null", nameof(chartData));
-
- if (chartData.Labels is null)
- throw new ArgumentException("chartData.Labels must not be null", nameof(chartData));
-
- if (dataLabel is null)
- throw new ArgumentNullException(nameof(dataLabel));
-
- if (string.IsNullOrWhiteSpace(dataLabel))
- throw new Exception($"{nameof(dataLabel)} cannot be empty.");
-
- if (data is null)
- throw new ArgumentNullException(nameof(data));
-
- if (!data.Any())
- throw new ArgumentException($"{nameof(data)} cannot be empty.", nameof(data));
-
- if (chartData.Datasets.Count != data.Count)
- throw new InvalidDataException("The chart dataset count and the new data points count do not match.");
-
- if (chartData.Labels.Contains(dataLabel))
- throw new Exception($"{dataLabel} already exists.");
-
- chartData.Labels.Add(dataLabel);
-
- foreach (var dataset in chartData.Datasets)
- {
- var chartDatasetData = data.FirstOrDefault(x => x is ChartDatasetData chartDataPoint && chartDataPoint.DatasetLabel == (dataset as dynamic).Label);
-
- if (chartDatasetData is not null)
- BarLineChartSupport.AppendDataPoint(dataset, chartDatasetData);
- }
-
- await SafeInvokeVoidAsync("window.blazorChart.line.addDatasetsData", Id, dataLabel, data?.OfType());
-
- return chartData;
- }
-
- [AddedVersion("1.10.0")]
- [Description("Adds dataset to chart.")]
- public override async Task AddDatasetAsync(ChartData chartData, IChartDataset chartDataset, IChartOptions chartOptions)
- {
- if (chartData is null)
- throw new ArgumentNullException(nameof(chartData));
-
- if (chartData.Datasets is null)
- throw new ArgumentException("chartData.Datasets must not be null", nameof(chartData));
-
- if (chartDataset is null)
- throw new ArgumentNullException(nameof(chartDataset));
-
- if (BarLineChartSupport.IsSupportedDataset(chartDataset))
- {
- chartData.Datasets.Add(chartDataset);
- await SafeInvokeVoidAsync("window.blazorChart.line.addDataset", Id, chartDataset);
- }
-
- return chartData;
- }
-
- [AddedVersion("1.0.0")]
- [Description("Initializes the chart.")]
- public override async Task InitializeAsync(ChartData chartData, IChartOptions chartOptions, string[]? plugins = null)
- {
- if (chartData is null)
- throw new ArgumentNullException(nameof(chartData));
-
- if (chartData.Datasets is null)
- throw new ArgumentException("chartData.Datasets must not be null", nameof(chartData));
-
- if (chartOptions is null)
- throw new ArgumentNullException(nameof(chartOptions));
-
- var data = new { chartData.Labels, Datasets = BarLineChartSupport.GetSupportedDatasets(chartData) };
- await SafeInvokeVoidAsync("window.blazorChart.line.initialize", Id, GetChartType(), data, (LineChartOptions)chartOptions, plugins, ObjRef);
- }
-
- [AddedVersion("1.0.0")]
- [Description("Updates the chart.")]
- public override async Task UpdateAsync(ChartData chartData, IChartOptions chartOptions)
- {
- if (chartData is null)
- throw new ArgumentNullException(nameof(chartData));
-
- if (chartData.Datasets is null)
- throw new ArgumentException("chartData.Datasets must not be null", nameof(chartData));
-
- if (chartOptions is null)
- throw new ArgumentNullException(nameof(chartOptions));
-
- var data = new { chartData.Labels, Datasets = BarLineChartSupport.GetSupportedDatasets(chartData) };
- await SafeInvokeVoidAsync("window.blazorChart.line.update", Id, GetChartType(), data, (LineChartOptions)chartOptions, ObjRef);
- }
-
- #endregion
-}
diff --git a/blazorbootstrap/Components/Charts/PieChart.razor b/blazorbootstrap/Components/Charts/PieChart.razor
deleted file mode 100644
index da05c573a..000000000
--- a/blazorbootstrap/Components/Charts/PieChart.razor
+++ /dev/null
@@ -1,6 +0,0 @@
-@namespace BlazorBootstrap
-@inherits BlazorBootstrapChart
-
-
-
-
diff --git a/blazorbootstrap/Components/Charts/PieChart.razor.cs b/blazorbootstrap/Components/Charts/PieChart.razor.cs
deleted file mode 100644
index e3516b6e8..000000000
--- a/blazorbootstrap/Components/Charts/PieChart.razor.cs
+++ /dev/null
@@ -1,146 +0,0 @@
-namespace BlazorBootstrap;
-
-[AddedVersion("1.0.0")]
-public partial class PieChart : BlazorBootstrapChart
-{
- #region Fields and Constants
-
- private const string _jsObjectName = "window.blazorChart.pie";
-
- #endregion
-
- #region Constructors
-
- public PieChart()
- {
- chartType = ChartType.Pie;
- }
-
- #endregion
-
- #region Methods
-
- [AddedVersion("1.10.0")]
- [Description("Adds data to chart.")]
- public override async Task AddDataAsync(ChartData chartData, string dataLabel, IChartDatasetData data)
- {
- if (chartData is null)
- throw new ArgumentNullException(nameof(chartData));
-
- if (chartData.Datasets is null)
- throw new ArgumentNullException(nameof(chartData.Datasets));
-
- if (data is null)
- throw new ArgumentNullException(nameof(data));
-
- foreach (var dataset in chartData.Datasets)
- if (dataset is PieChartDataset pieChartDataset && pieChartDataset.Label == dataLabel)
- if (data is PieChartDatasetData pieChartDatasetData)
- {
- pieChartDataset.Data?.Add(pieChartDatasetData.Data as double?);
- pieChartDataset.BackgroundColor?.Add(pieChartDatasetData.BackgroundColor!);
- }
-
- await SafeInvokeVoidAsync($"{_jsObjectName}.addDatasetData", Id, dataLabel, data);
-
- return chartData;
- }
-
- [AddedVersion("1.10.0")]
- [Description("Adds dataset to chart.")]
- public override async Task AddDataAsync(ChartData chartData, string dataLabel, IReadOnlyCollection data)
- {
- if (chartData is null)
- throw new ArgumentNullException(nameof(chartData));
-
- if (chartData.Datasets is null)
- throw new ArgumentNullException(nameof(chartData.Datasets));
-
- if (chartData.Labels is null)
- throw new ArgumentNullException(nameof(chartData.Labels));
-
- if (dataLabel is null)
- throw new ArgumentNullException(nameof(dataLabel));
-
- if (string.IsNullOrWhiteSpace(dataLabel))
- throw new Exception($"{nameof(dataLabel)} cannot be empty.");
-
- if (data is null)
- throw new ArgumentNullException(nameof(data));
-
- if (!data.Any())
- throw new Exception($"{nameof(data)} cannot be empty.");
-
- if (chartData.Datasets.Count != data.Count)
- throw new InvalidDataException("The chart dataset count and the new data points count do not match.");
-
- if (chartData.Labels.Contains(dataLabel))
- throw new Exception($"{dataLabel} already exists.");
-
- chartData.Labels.Add(dataLabel);
-
- foreach (var dataset in chartData.Datasets)
- if (dataset is PieChartDataset pieChartDataset)
- {
- var chartDatasetData = data.FirstOrDefault(x => x is PieChartDatasetData pieChartDatasetData && pieChartDatasetData.DatasetLabel == pieChartDataset.Label);
-
- if (chartDatasetData is PieChartDatasetData pieChartDatasetData)
- {
- pieChartDataset.Data?.Add(pieChartDatasetData.Data as double?);
- pieChartDataset.BackgroundColor?.Add(pieChartDatasetData.BackgroundColor!);
- }
- }
-
- await SafeInvokeVoidAsync($"{_jsObjectName}.addDatasetsData", Id, dataLabel, data?.Select(x => (PieChartDatasetData)x));
-
- return chartData;
- }
-
- [AddedVersion("1.10.0")]
- [Description("Adds dataset to chart.")]
- public override async Task AddDatasetAsync(ChartData chartData, IChartDataset chartDataset, IChartOptions chartOptions)
- {
- if (chartData is null)
- throw new ArgumentNullException(nameof(chartData));
-
- if (chartData.Datasets is null)
- throw new ArgumentNullException(nameof(chartData.Datasets));
-
- if (chartDataset is null)
- throw new ArgumentNullException(nameof(chartDataset));
-
- if (chartDataset is PieChartDataset pieChartDataset)
- {
- chartData.Datasets.Add(pieChartDataset);
- await SafeInvokeVoidAsync($"{_jsObjectName}.addDataset", Id, pieChartDataset);
- }
-
- return chartData;
- }
-
- [AddedVersion("1.0.0")]
- [Description("Initializes the chart.")]
- public override async Task InitializeAsync(ChartData chartData, IChartOptions chartOptions, string[]? plugins = null)
- {
- if (chartData is not null && chartData.Datasets is not null)
- {
- var datasets = chartData.Datasets.OfType();
- var data = new { chartData.Labels, Datasets = datasets };
- await SafeInvokeVoidAsync($"{_jsObjectName}.initialize", Id, GetChartType(), data, (PieChartOptions)chartOptions, plugins, ObjRef);
- }
- }
-
- [AddedVersion("1.0.0")]
- [Description("Updates the chart.")]
- public override async Task UpdateAsync(ChartData chartData, IChartOptions chartOptions)
- {
- if (chartData is not null && chartData.Datasets is not null)
- {
- var datasets = chartData.Datasets.OfType();
- var data = new { chartData.Labels, Datasets = datasets };
- await SafeInvokeVoidAsync($"{_jsObjectName}.update", Id, GetChartType(), data, (PieChartOptions)chartOptions, ObjRef);
- }
- }
-
- #endregion
-}
diff --git a/blazorbootstrap/Components/Charts/PolarAreaChart.razor b/blazorbootstrap/Components/Charts/PolarAreaChart.razor
deleted file mode 100644
index a24e57c6f..000000000
--- a/blazorbootstrap/Components/Charts/PolarAreaChart.razor
+++ /dev/null
@@ -1,6 +0,0 @@
-@namespace BlazorBootstrap
-@inherits BlazorBootstrapChart
-
-
-
-
diff --git a/blazorbootstrap/Components/Charts/PolarAreaChart.razor.cs b/blazorbootstrap/Components/Charts/PolarAreaChart.razor.cs
deleted file mode 100644
index 7f5b46001..000000000
--- a/blazorbootstrap/Components/Charts/PolarAreaChart.razor.cs
+++ /dev/null
@@ -1,141 +0,0 @@
-namespace BlazorBootstrap;
-
-[AddedVersion("3.0.0")]
-public partial class PolarAreaChart : BlazorBootstrapChart
-{
- #region Fields and Constants
-
- private const string _jsObjectName = "window.blazorChart.polarArea";
-
- #endregion
-
- #region Constructors
-
- public PolarAreaChart()
- {
- chartType = ChartType.PolarArea;
- }
-
- #endregion
-
- #region Methods
-
- // TODO: May be this method is not required
- [AddedVersion("3.0.0")]
- [Description("Adds data to chart.")]
- public override async Task AddDataAsync(ChartData chartData, string dataLabel, IChartDatasetData data)
- {
- if (chartData is null)
- throw new ArgumentNullException(nameof(chartData));
-
- if (chartData.Datasets is null)
- throw new ArgumentException("chartData.Datasets must not be null", nameof(chartData));
-
- if (data is null)
- throw new ArgumentNullException(nameof(data));
-
- foreach (var dataset in chartData.Datasets)
- if (dataset is PolarAreaChartDataset barChartDataset && barChartDataset.Label == dataLabel)
- if (data is PolarAreaChartDatasetData barChartDatasetData)
- barChartDataset.Data?.Add(barChartDatasetData.Data as double?);
-
- await SafeInvokeVoidAsync($"{_jsObjectName}.addDatasetData", Id, dataLabel, data);
-
- return chartData;
- }
-
- [AddedVersion("3.0.0")]
- [Description("Adds dataset to chart.")]
- public override async Task AddDataAsync(ChartData chartData, string dataLabel, IReadOnlyCollection data)
- {
- if (chartData is null)
- throw new ArgumentNullException(nameof(chartData));
-
- if (chartData.Datasets is null)
- throw new ArgumentException("chartData.Datasets must not be null", nameof(chartData));
-
- if (chartData.Labels is null)
- throw new ArgumentException("chartData.Labels must not be null", nameof(chartData));
-
- if (dataLabel is null)
- throw new ArgumentNullException(nameof(dataLabel));
-
- if (string.IsNullOrWhiteSpace(dataLabel))
- throw new Exception($"{nameof(dataLabel)} cannot be empty.");
-
- if (data is null)
- throw new ArgumentNullException(nameof(data));
-
- if (!data.Any())
- throw new Exception($"{nameof(data)} cannot be empty.");
-
- if (chartData.Datasets.Count != data.Count)
- throw new InvalidDataException("The chart dataset count and the new data points count do not match.");
-
- if (chartData.Labels.Contains(dataLabel))
- throw new Exception($"{dataLabel} already exists.");
-
- chartData.Labels.Add(dataLabel);
-
- foreach (var dataset in chartData.Datasets)
- if (dataset is PolarAreaChartDataset barChartDataset)
- {
- var chartDatasetData = data.FirstOrDefault(x => x is PolarAreaChartDatasetData barChartDatasetData && barChartDatasetData.DatasetLabel == barChartDataset.Label);
-
- if (chartDatasetData is PolarAreaChartDatasetData barChartDatasetData)
- barChartDataset.Data?.Add(barChartDatasetData.Data as double?);
- }
-
- await SafeInvokeVoidAsync($"{_jsObjectName}.addDatasetsData", Id, dataLabel, data?.Select(x => (PolarAreaChartDatasetData)x));
-
- return chartData;
- }
-
- [AddedVersion("3.0.0")]
- [Description("Adds dataset to chart.")]
- public override async Task AddDatasetAsync(ChartData chartData, IChartDataset chartDataset, IChartOptions chartOptions)
- {
- if (chartData is null)
- throw new ArgumentNullException(nameof(chartData));
-
- if (chartData.Datasets is null)
- throw new ArgumentException("chartData.Datasets must not be null", nameof(chartData));
-
- if (chartDataset is null)
- throw new ArgumentNullException(nameof(chartDataset));
-
- if (chartDataset is PolarAreaChartDataset)
- {
- chartData.Datasets.Add(chartDataset);
- await SafeInvokeVoidAsync($"{_jsObjectName}.addDataset", Id, (PolarAreaChartDataset)chartDataset);
- }
-
- return chartData;
- }
-
- [AddedVersion("3.0.0")]
- [Description("Initializes the chart.")]
- public override async Task InitializeAsync(ChartData chartData, IChartOptions chartOptions, string[]? plugins = null)
- {
- if (chartData is not null && chartData.Datasets is not null)
- {
- var datasets = chartData.Datasets.OfType();
- var data = new { chartData.Labels, Datasets = datasets };
- await SafeInvokeVoidAsync($"{_jsObjectName}.initialize", Id, GetChartType(), data, (PolarAreaChartOptions)chartOptions, plugins, ObjRef);
- }
- }
-
- [AddedVersion("3.0.0")]
- [Description("Updates the chart.")]
- public override async Task UpdateAsync(ChartData chartData, IChartOptions chartOptions)
- {
- if (chartData is not null && chartData.Datasets is not null)
- {
- var datasets = chartData.Datasets.OfType();
- var data = new { chartData.Labels, Datasets = datasets };
- await SafeInvokeVoidAsync($"{_jsObjectName}.update", Id, GetChartType(), data, (PolarAreaChartOptions)chartOptions, ObjRef);
- }
- }
-
- #endregion
-}
diff --git a/blazorbootstrap/Components/Charts/RadarChart.razor b/blazorbootstrap/Components/Charts/RadarChart.razor
deleted file mode 100644
index a24e57c6f..000000000
--- a/blazorbootstrap/Components/Charts/RadarChart.razor
+++ /dev/null
@@ -1,6 +0,0 @@
-@namespace BlazorBootstrap
-@inherits BlazorBootstrapChart
-
-
-
-
diff --git a/blazorbootstrap/Components/Charts/RadarChart.razor.cs b/blazorbootstrap/Components/Charts/RadarChart.razor.cs
deleted file mode 100644
index c20da461f..000000000
--- a/blazorbootstrap/Components/Charts/RadarChart.razor.cs
+++ /dev/null
@@ -1,141 +0,0 @@
-namespace BlazorBootstrap;
-
-[AddedVersion("3.0.0")]
-public partial class RadarChart : BlazorBootstrapChart
-{
- #region Fields and Constants
-
- private const string _jsObjectName = "window.blazorChart.radar";
-
- #endregion
-
- #region Constructors
-
- public RadarChart()
- {
- chartType = ChartType.Radar;
- }
-
- #endregion
-
- #region Methods
-
- // TODO: May be this method is not required
- [AddedVersion("3.0.0")]
- [Description("Adds data to chart.")]
- public override async Task AddDataAsync(ChartData chartData, string dataLabel, IChartDatasetData data)
- {
- if (chartData is null)
- throw new ArgumentNullException(nameof(chartData));
-
- if (chartData.Datasets is null)
- throw new ArgumentException("chartData.Datasets must not be null", nameof(chartData));
-
- if (data is null)
- throw new ArgumentNullException(nameof(data));
-
- foreach (var dataset in chartData.Datasets)
- if (dataset is RadarChartDataset radarChartDataset && radarChartDataset.Label == dataLabel)
- if (data is RadarChartDatasetData radarChartDatasetData)
- radarChartDataset.Data?.Add(radarChartDatasetData.Data as double?);
-
- await SafeInvokeVoidAsync($"{_jsObjectName}.addDatasetData", Id, dataLabel, data);
-
- return chartData;
- }
-
- [AddedVersion("3.0.0")]
- [Description("Adds dataset to chart.")]
- public override async Task AddDataAsync(ChartData chartData, string dataLabel, IReadOnlyCollection data)
- {
- if (chartData is null)
- throw new ArgumentNullException(nameof(chartData));
-
- if (chartData.Datasets is null)
- throw new ArgumentException("chartData.Datasets must not be null", nameof(chartData));
-
- if (chartData.Labels is null)
- throw new ArgumentException("chartData.Labels must not be null", nameof(chartData));
-
- if (dataLabel is null)
- throw new ArgumentNullException(nameof(dataLabel));
-
- if (string.IsNullOrWhiteSpace(dataLabel))
- throw new Exception($"{nameof(dataLabel)} cannot be empty.");
-
- if (data is null)
- throw new ArgumentNullException(nameof(data));
-
- if (!data.Any())
- throw new Exception($"{nameof(data)} cannot be empty.");
-
- if (chartData.Datasets.Count != data.Count)
- throw new InvalidDataException("The chart dataset count and the new data points count do not match.");
-
- if (chartData.Labels.Contains(dataLabel))
- throw new Exception($"{dataLabel} already exists.");
-
- chartData.Labels.Add(dataLabel);
-
- foreach (var dataset in chartData.Datasets)
- if (dataset is RadarChartDataset radarChartDataset)
- {
- var chartDatasetData = data.FirstOrDefault(x => x is RadarChartDatasetData radarChartDatasetData && radarChartDatasetData.DatasetLabel == radarChartDataset.Label);
-
- if (chartDatasetData is RadarChartDatasetData radarChartDatasetData)
- radarChartDataset.Data?.Add(radarChartDatasetData.Data as double?);
- }
-
- await SafeInvokeVoidAsync($"{_jsObjectName}.addDatasetsData", Id, dataLabel, data?.Select(x => (RadarChartDatasetData)x));
-
- return chartData;
- }
-
- [AddedVersion("3.0.0")]
- [Description("Adds dataset to chart.")]
- public override async Task AddDatasetAsync(ChartData chartData, IChartDataset chartDataset, IChartOptions chartOptions)
- {
- if (chartData is null)
- throw new ArgumentNullException(nameof(chartData));
-
- if (chartData.Datasets is null)
- throw new ArgumentException("chartData.Datasets must not be null", nameof(chartData));
-
- if (chartDataset is null)
- throw new ArgumentNullException(nameof(chartDataset));
-
- if (chartDataset is RadarChartDataset)
- {
- chartData.Datasets.Add(chartDataset);
- await SafeInvokeVoidAsync($"{_jsObjectName}.addDataset", Id, (RadarChartDataset)chartDataset);
- }
-
- return chartData;
- }
-
- [AddedVersion("3.0.0")]
- [Description("Initializes the chart.")]
- public override async Task InitializeAsync(ChartData chartData, IChartOptions chartOptions, string[]? plugins = null)
- {
- if (chartData is not null && chartData.Datasets is not null)
- {
- var datasets = chartData.Datasets.OfType();
- var data = new { chartData.Labels, Datasets = datasets };
- await SafeInvokeVoidAsync($"{_jsObjectName}.initialize", Id, GetChartType(), data, (RadarChartOptions)chartOptions, plugins, ObjRef);
- }
- }
-
- [AddedVersion("3.0.0")]
- [Description("Updates the chart.")]
- public override async Task UpdateAsync(ChartData chartData, IChartOptions chartOptions)
- {
- if (chartData is not null && chartData.Datasets is not null)
- {
- var datasets = chartData.Datasets.OfType();
- var data = new { chartData.Labels, Datasets = datasets };
- await SafeInvokeVoidAsync($"{_jsObjectName}.update", Id, GetChartType(), data, (RadarChartOptions)chartOptions, ObjRef);
- }
- }
-
- #endregion
-}
diff --git a/blazorbootstrap/Components/Charts/ScatterChart.razor b/blazorbootstrap/Components/Charts/ScatterChart.razor
deleted file mode 100644
index a24e57c6f..000000000
--- a/blazorbootstrap/Components/Charts/ScatterChart.razor
+++ /dev/null
@@ -1,6 +0,0 @@
-@namespace BlazorBootstrap
-@inherits BlazorBootstrapChart
-
-
-
-
diff --git a/blazorbootstrap/Components/Charts/ScatterChart.razor.cs b/blazorbootstrap/Components/Charts/ScatterChart.razor.cs
deleted file mode 100644
index a30418cfa..000000000
--- a/blazorbootstrap/Components/Charts/ScatterChart.razor.cs
+++ /dev/null
@@ -1,153 +0,0 @@
-namespace BlazorBootstrap;
-
-[AddedVersion("3.0.0")]
-public partial class ScatterChart : BlazorBootstrapChart
-{
- #region Fields and Constants
-
- private const string _jsObjectName = "window.blazorChart.scatter";
-
- #endregion
-
- #region Constructors
-
- public ScatterChart()
- {
- chartType = ChartType.Scatter;
- }
-
- #endregion
-
- #region Methods
-
- // TODO: May be this method is not required
- [AddedVersion("3.0.0")]
- [Description("Adds data to chart.")]
- public override async Task AddDataAsync(ChartData chartData, string dataLabel, IChartDatasetData data)
- {
- if (chartData is null)
- throw new ArgumentNullException(nameof(chartData));
-
- if (chartData.Datasets is null)
- throw new ArgumentNullException(nameof(chartData.Datasets));
-
- if (data is null)
- throw new ArgumentNullException(nameof(data));
-
- foreach (var dataset in chartData.Datasets)
- if (dataset is ScatterChartDataset scatterChartDataset && scatterChartDataset.Label == dataLabel)
- if (data is ScatterChartDatasetData scatterChartDatasetData && scatterChartDatasetData.Data is ScatterChartDataPoint scatterChartDataPoint)
- scatterChartDataset.Data?.Add(scatterChartDataPoint);
-
- await SafeInvokeVoidAsync($"{_jsObjectName}.addDatasetData", Id, dataLabel, data);
-
- return chartData;
- }
-
- [AddedVersion("3.0.0")]
- [Description("Adds dataset to chart.")]
- public override async Task AddDataAsync(ChartData chartData, string dataLabel, IReadOnlyCollection data)
- {
- if (chartData is null)
- throw new ArgumentNullException(nameof(chartData));
-
- if (chartData.Datasets is null)
- throw new ArgumentException("chartData.Datasets must not be null", nameof(chartData));
-
- if (chartData.Labels is null)
- throw new ArgumentException("chartData.Labels must not be null", nameof(chartData));
-
- if (dataLabel is null)
- throw new ArgumentNullException(nameof(dataLabel));
-
- if (string.IsNullOrWhiteSpace(dataLabel))
- throw new Exception($"{nameof(dataLabel)} cannot be empty.");
-
- if (data is null)
- throw new ArgumentNullException(nameof(data));
-
- if (!data.Any())
- throw new ArgumentException($"{nameof(data)} cannot be empty.", nameof(data));
-
- if (chartData.Datasets.Count != data.Count)
- throw new InvalidDataException("The chart dataset count and the new data points count do not match.");
-
- if (chartData.Labels.Contains(dataLabel))
- throw new Exception($"{dataLabel} already exists.");
-
- chartData.Labels.Add(dataLabel);
-
- foreach (var dataset in chartData.Datasets)
- if (dataset is ScatterChartDataset scatterChartDataset)
- {
- var chartDatasetData = data.FirstOrDefault(x => x is ScatterChartDatasetData scatterChartDatasetData && scatterChartDatasetData.DatasetLabel == scatterChartDataset.Label);
-
- if (chartDatasetData is ScatterChartDatasetData scatterChartDatasetData && scatterChartDatasetData.Data is ScatterChartDataPoint scatterChartDataPoint)
- scatterChartDataset.Data?.Add(scatterChartDataPoint);
- }
-
- await SafeInvokeVoidAsync($"{_jsObjectName}.addDatasetsData", Id, dataLabel, data?.Select(x => (ScatterChartDatasetData)x));
-
- return chartData;
- }
-
- [AddedVersion("3.0.0")]
- [Description("Adds dataset to chart.")]
- public override async Task AddDatasetAsync(ChartData chartData, IChartDataset chartDataset, IChartOptions chartOptions)
- {
- if (chartData is null)
- throw new ArgumentNullException(nameof(chartData));
-
- if (chartData.Datasets is null)
- throw new ArgumentException("chartData.Datasets must not be null", nameof(chartData));
-
- if (chartDataset is null)
- throw new ArgumentNullException(nameof(chartDataset));
-
- if (chartDataset is ScatterChartDataset)
- {
- chartData.Datasets.Add(chartDataset);
- await SafeInvokeVoidAsync($"{_jsObjectName}.addDataset", Id, (ScatterChartDataset)chartDataset);
- }
-
- return chartData;
- }
-
- [AddedVersion("3.0.0")]
- [Description("Initializes the chart.")]
- public override async Task InitializeAsync(ChartData chartData, IChartOptions chartOptions, string[]? plugins = null)
- {
- if (chartData is null)
- throw new ArgumentNullException(nameof(chartData));
-
- if (chartData.Datasets is null)
- throw new ArgumentException("chartData.Datasets must not be null", nameof(chartData));
-
- if (chartOptions is null)
- throw new ArgumentNullException(nameof(chartOptions));
-
- var datasets = chartData.Datasets.OfType();
- var data = new { chartData.Labels, Datasets = datasets };
- await SafeInvokeVoidAsync($"{_jsObjectName}.initialize", Id, GetChartType(), data, (ScatterChartOptions)chartOptions, plugins, ObjRef);
- }
-
- [AddedVersion("3.0.0")]
- [Description("Updates the chart.")]
- public override async Task UpdateAsync(ChartData chartData, IChartOptions chartOptions)
- {
- if (chartData is null)
- throw new ArgumentNullException(nameof(chartData));
-
- if (chartData.Datasets is null)
- throw new ArgumentException("chartData.Datasets must not be null", nameof(chartData));
-
- if (chartOptions is null)
- throw new ArgumentNullException(nameof(chartOptions));
-
- var datasets = chartData.Datasets.OfType();
- var data = new { chartData.Labels, Datasets = datasets };
- await SafeInvokeVoidAsync($"{_jsObjectName}.update", Id, GetChartType(), data, (ScatterChartOptions)chartOptions, ObjRef);
- }
-
- #endregion
-}
diff --git a/blazorbootstrap/Enums/ChartType.cs b/blazorbootstrap/Enums/ChartType.cs
deleted file mode 100644
index e66d9fc83..000000000
--- a/blazorbootstrap/Enums/ChartType.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-namespace BlazorBootstrap;
-
-public enum ChartType
-{
- Line,
- Bar,
- Pie,
- Doughnut,
- PolarArea,
- Radar,
- Scatter,
- Bubble
-}
diff --git a/blazorbootstrap/EventArguments/ChartClickEventArgs.cs b/blazorbootstrap/EventArguments/ChartClickEventArgs.cs
deleted file mode 100644
index 84d4a5c35..000000000
--- a/blazorbootstrap/EventArguments/ChartClickEventArgs.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-namespace BlazorBootstrap;
-
-public class ChartClickEventArgs
-{
- #region Properties, Indexers
-
- ///
- /// Gets or sets the dataset index of the clicked chart item.
- ///
- [AddedVersion("4.0.0")]
- [DefaultValue(0)]
- [Description("Gets or sets the dataset index of the clicked chart item.")]
- public int DatasetIndex { get; set; }
-
- ///
- /// Gets or sets the dataset label of the clicked chart item.
- ///
- [AddedVersion("4.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the dataset label of the clicked chart item.")]
- public string? DatasetLabel { get; set; }
-
- ///
- /// Gets or sets the data index of the clicked chart item.
- ///
- [AddedVersion("4.0.0")]
- [DefaultValue(0)]
- [Description("Gets or sets the data index of the clicked chart item.")]
- public int Index { get; set; }
-
- ///
- /// Gets or sets the data label of the clicked chart item.
- ///
- [AddedVersion("4.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the data label of the clicked chart item.")]
- public string? Label { get; set; }
-
- ///
- /// Gets or sets the raw value of the clicked chart item.
- ///
- [AddedVersion("4.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the raw value of the clicked chart item.")]
- public System.Text.Json.JsonElement? Value { get; set; }
-
- #endregion
-}
diff --git a/blazorbootstrap/Models/Charts/ChartData.cs b/blazorbootstrap/Models/Charts/ChartData.cs
deleted file mode 100644
index 8041b8d32..000000000
--- a/blazorbootstrap/Models/Charts/ChartData.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-namespace BlazorBootstrap;
-
-///
-/// Represents the data payload for a chart.
-///
-[AddedVersion("1.0.0")]
-public class ChartData
-{
- #region Properties, Indexers
-
- ///
- /// Gets or sets the datasets.
- ///
- [AddedVersion("1.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the chart datasets.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? Datasets { get; set; }
-
- ///
- /// Gets or sets the labels.
- ///
- [AddedVersion("1.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the chart labels.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? Labels { get; set; }
-
- #endregion
-}
diff --git a/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDataset.cs
deleted file mode 100644
index 2d3be17a7..000000000
--- a/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDataset.cs
+++ /dev/null
@@ -1,265 +0,0 @@
-namespace BlazorBootstrap;
-
-///
-/// The bar chart allows a number of properties to be specified for each dataset.
-/// These are used to set display properties for a specific dataset.
-///
-///
-///
-[AddedVersion("1.0.0")]
-public class BarChartDataset : ChartDataset
-{
- #region Constructors
-
- public BarChartDataset()
- {
- Type = "bar";
- }
-
- #endregion
-
- #region Properties, Indexers
-
- ///
- /// The bar background color.
- ///
- ///
- /// Default value is 'rgba(0, 0, 0, 0.1)'.
- ///
- [AddedVersion("1.0.0")]
- [DefaultValue("rgba(0, 0, 0, 0.1)")]
- [Description("Gets or sets the bar background color.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? BackgroundColor { get; set; }
-
- ///
- /// Percent (0-1) of the available width each bar should be within the category width.
- /// 1.0 will take the whole category width and put the bars right next to each other.
- ///
- ///
- /// Default value is 0.9.
- ///
- [AddedVersion("1.0.0")]
- [DefaultValue(0.9d)]
- [Description("Gets or sets the percentage of the category width used by each bar.")]
- public double BarPercentage { get; set; } = 0.9;
-
- ///
- /// It is applied to the width of each bar, in pixels.
- /// When this is enforced, barPercentage and categoryPercentage are ignored.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the bar thickness in pixels.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public double? BarThickness { get; set; }
-
- ///
- /// The bar border color.
- ///
- ///
- /// Default value is 'rgba(0, 0, 0, 0.1)'.
- ///
- [AddedVersion("1.0.0")]
- [DefaultValue("rgba(0, 0, 0, 0.1)")]
- [Description("Gets or sets the bar border color.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? BorderColor { get; set; }
-
- ///
- /// Border radius
- ///
- ///
- /// Default value is 0.
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(0)]
- [Description("Gets or sets the bar border radius.")]
- public List? BorderRadius { get; set; }
-
- ///
- /// Gets or sets the border width (in pixels).
- ///
- ///
- /// Default value is 0.
- ///
- [AddedVersion("1.0.0")]
- [DefaultValue(0)]
- [Description("Gets or sets the border width in pixels.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? BorderWidth { get; set; }
-
- //BorderSkipped
- //https://www.chartjs.org/docs/latest/api/interfaces/BarControllerDatasetOptions.html#borderskipped
-
- ///
- /// Percent (0-1) of the available width each category should be within the sample width.
- ///
- ///
- /// Default value is 0.8.
- ///
- [AddedVersion("1.0.0")]
- [DefaultValue(0.8d)]
- [Description("Gets or sets the percentage of the sample width used by each category.")]
- public double CategoryPercentage { get; set; } = 0.8;
-
- [AddedVersion("1.10.2")]
- [Description("Gets or sets the dataset data label configuration.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public BarChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link
-
- ///
- /// Should the bars be grouped on index axis.
- /// When , all the datasets at same index value will be placed next to each other centering on that
- /// index value.
- /// When , each bar is placed on its actual index-axis value.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(true)]
- [Description("Gets or sets a value indicating whether bars are grouped on the index axis.")]
- public bool Grouped { get; set; } = true;
-
- ///
- /// The bar background color when hovered.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("1.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the bar background color when hovered.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? HoverBackgroundColor { get; set; }
-
- ///
- /// The bar border color when hovered.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("1.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the bar border color when hovered.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? HoverBorderColor { get; set; }
-
- ///
- /// The bar border radius when hovered (in pixels).
- ///
- ///
- /// Default value is 0.
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(0)]
- [Description("Gets or sets the hovered bar border radius in pixels.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? HoverBorderRadius { get; set; }
-
- ///
- /// The bar border width when hovered (in pixels).
- ///
- ///
- /// Default value is 1.
- ///
- [AddedVersion("1.0.0")]
- [DefaultValue(1)]
- [Description("Gets or sets the hovered bar border width in pixels.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? HoverBorderWidth { get; set; }
-
- ///
- /// The base axis of the chart. 'x' for vertical charts and 'y' for horizontal charts.
- /// Supported values are 'x' and 'y'.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the base axis of the dataset.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public string? IndexAxis { get; set; }
-
- //InflateAmount
- //https://www.chartjs.org/docs/latest/charts/bar.html#inflateamount
-
- ///
- /// Set this to ensure that bars are not sized thicker than this.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the maximum bar thickness.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public double? MaxBarThickness { get; set; }
-
- ///
- /// Set this to ensure that bars have a minimum length in pixels.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the minimum bar length in pixels.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public double? MinBarLength { get; set; }
-
- //PointStyle
- //https://www.chartjs.org/docs/latest/configuration/elements.html#point-styles
-
- ///
- /// If , null or undefined values will not be used for spacing calculations when determining bar
- /// size.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(false)]
- [Description("Gets or sets a value indicating whether null values are skipped during bar size calculation.")]
- public bool SkipNull { get; set; }
-
- //Stack
- //https://www.chartjs.org/docs/latest/charts/bar.html#general
-
- ///
- /// The ID of the x axis to plot this dataset on.
- ///
- ///
- /// Default value is first x axis.
- ///
- [AddedVersion("1.0.0")]
- [DefaultValue("first x axis")]
- [Description("Gets or sets the x-axis identifier for the dataset.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public string? XAxisID { get; set; }
-
- ///
- /// The ID of the y axis to plot this dataset on.
- ///
- ///
- /// Default value is first y axis.
- ///
- [AddedVersion("1.0.0")]
- [DefaultValue("first y axis")]
- [Description("Gets or sets the y-axis identifier for the dataset.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public string? YAxisID { get; set; }
-
- #endregion
-}
-
-///
-/// Represents data label options for a bar chart dataset.
-///
-[AddedVersion("1.10.2")]
-public class BarChartDatasetDataLabels : ChartDatasetDataLabels { }
diff --git a/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDatasetData.cs b/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDatasetData.cs
deleted file mode 100644
index 52df7ea65..000000000
--- a/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDatasetData.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-namespace BlazorBootstrap;
-
-///
-/// Represents a bar chart data item for dynamic updates.
-///
-[AddedVersion("1.10.0")]
-public record BarChartDatasetData : ChartDatasetData
-{
- #region Constructors
-
- public BarChartDatasetData(string? datasetLabel, double data) : base(datasetLabel, data) { }
-
- #endregion
-}
diff --git a/blazorbootstrap/Models/Charts/ChartDataset/BubbleChart/BubbleChartDataPoint.cs b/blazorbootstrap/Models/Charts/ChartDataset/BubbleChart/BubbleChartDataPoint.cs
deleted file mode 100644
index d3946d7f9..000000000
--- a/blazorbootstrap/Models/Charts/ChartDataset/BubbleChart/BubbleChartDataPoint.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-namespace BlazorBootstrap;
-
-///
-///
-///
-[AddedVersion("4.0.0")]
-public record BubbleChartDataPoint(double X, double Y, double R);
\ No newline at end of file
diff --git a/blazorbootstrap/Models/Charts/ChartDataset/BubbleChart/BubbleChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/BubbleChart/BubbleChartDataset.cs
deleted file mode 100644
index 83446603c..000000000
--- a/blazorbootstrap/Models/Charts/ChartDataset/BubbleChart/BubbleChartDataset.cs
+++ /dev/null
@@ -1,106 +0,0 @@
-namespace BlazorBootstrap;
-
-///
-/// A bubble chart is used to display three dimensions of data at the same time.
-/// The location of the bubble is determined by the first two dimensions and the corresponding horizontal and vertical axes.
-/// The third dimension is represented by the size of the individual bubbles.
-/// .
-///
-[AddedVersion("4.0.0")]
-public class BubbleChartDataset : ChartDataset
-{
- #region Constructors
-
- public BubbleChartDataset()
- {
- Type = "bubble";
- }
-
- #endregion
-
- #region Properties, Indexers
-
- [AddedVersion("4.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the bubble background colors.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? BackgroundColor { get; set; }
-
- [AddedVersion("4.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the bubble border colors.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? BorderColor { get; set; }
-
- [AddedVersion("4.0.0")]
- [DefaultValue(3d)]
- [Description("Gets or sets the bubble border width.")]
- public double BorderWidth { get; set; } = 3;
-
- [AddedVersion("4.0.0")]
- [Description("Gets or sets the dataset data label configuration.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public BubbleChartDatasetDataLabels Datalabels { get; set; } = new();
-
- [AddedVersion("4.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets a value indicating whether active elements are drawn on top.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? DrawActiveElementsOnTop { get; set; }
-
- [AddedVersion("4.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the bubble background colors when hovered.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? HoverBackgroundColor { get; set; }
-
- [AddedVersion("4.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the bubble border colors when hovered.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? HoverBorderColor { get; set; }
-
- [AddedVersion("4.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the bubble border widths when hovered.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? HoverBorderWidth { get; set; }
-
- [AddedVersion("4.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the bubble hit radii.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? HitRadius { get; set; }
-
- [AddedVersion("4.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the bubble hover radii.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? HoverRadius { get; set; }
-
- [AddedVersion("4.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the bubble point styles.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? PointStyle { get; set; }
-
- [AddedVersion("4.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the bubble radii.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? Radius { get; set; }
-
- [AddedVersion("4.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the bubble rotations.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? Rotation { get; set; }
-
- #endregion
-}
-
-///
-/// Represents data label options for a bubble chart dataset.
-///
-[AddedVersion("4.0.0")]
-public class BubbleChartDatasetDataLabels : ChartDatasetDataLabels { }
\ No newline at end of file
diff --git a/blazorbootstrap/Models/Charts/ChartDataset/BubbleChart/BubbleChartDatasetData.cs b/blazorbootstrap/Models/Charts/ChartDataset/BubbleChart/BubbleChartDatasetData.cs
deleted file mode 100644
index ea3bef763..000000000
--- a/blazorbootstrap/Models/Charts/ChartDataset/BubbleChart/BubbleChartDatasetData.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-namespace BlazorBootstrap;
-
-///
-/// Represents a bubble chart data item for dynamic updates.
-///
-[AddedVersion("4.0.0")]
-public record BubbleChartDatasetData : ChartDatasetData
-{
- #region Constructors
-
- public BubbleChartDatasetData(string? datasetLabel, BubbleChartDataPoint data) : base(datasetLabel, data) { }
-
- #endregion
-}
\ No newline at end of file
diff --git a/blazorbootstrap/Models/Charts/ChartDataset/ChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/ChartDataset.cs
deleted file mode 100644
index 82460aad2..000000000
--- a/blazorbootstrap/Models/Charts/ChartDataset/ChartDataset.cs
+++ /dev/null
@@ -1,124 +0,0 @@
-namespace BlazorBootstrap;
-
-public interface IChartDataset { }
-
-///
-///
-///
-[AddedVersion("1.0.0")]
-public class ChartDataset : IChartDataset
-{
- #region Constructors
-
- public ChartDataset()
- {
- Oid = Guid.NewGuid();
- }
-
- #endregion
-
- #region Properties, Indexers
-
- ///
- /// Chart.js animates charts out of the box.
- /// A number of options are provided to configure how the animation looks and how long it takes.
- /// .
- ///
- [AddedVersion("4.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the dataset animation configuration.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public ChartAnimation? Animation { get; set; }
-
- ///
- /// How to clip relative to chartArea. Positive value allows overflow, negative value clips that many pixels inside
- /// chartArea. 0 = clip at chartArea.
- /// Clipping can also be configured per side: clip: {left: 5, top: false, right: -2, bottom: 0}
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("1.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the clipping configuration.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public string? Clip { get; set; }
-
- ///
- /// Gets or sets the Data.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("1.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the dataset values.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? Data { get; set; }
-
- ///
- /// Configures the visibility state of the dataset. Set it to , to hide the dataset from the chart.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("1.0.0")]
- [DefaultValue(false)]
- [Description("Gets or sets a value indicating whether the dataset is hidden.")]
- public bool Hidden { get; set; }
-
- ///
- /// The label for the dataset which appears in the legend and tooltips.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("1.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the dataset label.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public string? Label { get; set; }
-
- ///
- /// Get unique object id.
- ///
- [AddedVersion("1.0.0")]
- [Description("Gets the unique object identifier.")]
- public Guid Oid { get; private set; }
-
- ///
- /// The drawing order of dataset. Also affects order for stacking, tooltip and legend.
- ///
- ///
- /// Default value is 0.
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(0)]
- [Description("Gets or sets the dataset drawing order.")]
- public int Order { get; set; }
-
- ///
- /// The ID of the group to which this dataset belongs when stacked.
- /// Datasets with the same stack ID are rendered in the same stack group.
- /// .
- ///
- [AddedVersion("4.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the dataset stack identifier.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public string? Stack { get; set; }
-
- ///
- /// Gets or sets the chart type.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("1.0.0")]
- [DefaultValue(null)]
- [Description("Gets the chart type associated with the dataset.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public string? Type { get; protected set; }
-
- #endregion
-}
diff --git a/blazorbootstrap/Models/Charts/ChartDataset/ChartDatasetData.cs b/blazorbootstrap/Models/Charts/ChartDataset/ChartDatasetData.cs
deleted file mode 100644
index c040fa9d1..000000000
--- a/blazorbootstrap/Models/Charts/ChartDataset/ChartDatasetData.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-namespace BlazorBootstrap;
-
-public interface IChartDatasetData { }
-
-///
-/// Represents a labeled data item that can be appended to a chart dataset.
-///
-[AddedVersion("1.10.0")]
-public record ChartDatasetData : IChartDatasetData
-{
- #region Constructors
-
- ///
- /// Initializes a new instance of the record.
- ///
- /// The target dataset label.
- /// The data value to append.
- public ChartDatasetData(string? datasetLabel, object? data)
- {
- DatasetLabel = datasetLabel;
- Data = data;
- }
-
- #endregion
-
- #region Properties, Indexers
-
- ///
- /// Gets the dataset label.
- ///
- [AddedVersion("1.10.0")]
- [DefaultValue(null)]
- [Description("Gets the dataset label.")]
- public string? DatasetLabel { get; init; }
-
- ///
- /// Gets the data value.
- ///
- [AddedVersion("1.10.0")]
- [DefaultValue(null)]
- [Description("Gets the data value.")]
- public object? Data { get; init; }
-
- #endregion
-}
diff --git a/blazorbootstrap/Models/Charts/ChartDataset/ChartDatasetDataLabels.cs b/blazorbootstrap/Models/Charts/ChartDataset/ChartDatasetDataLabels.cs
deleted file mode 100644
index 61178a187..000000000
--- a/blazorbootstrap/Models/Charts/ChartDataset/ChartDatasetDataLabels.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-namespace BlazorBootstrap;
-
-///
-/// Highly customizable Chart.js plugin that displays labels on data for any type of charts.
-/// .
-///
-[AddedVersion("3.0.0")]
-public class ChartDatasetDataLabels
-{
- #region Fields and Constants
-
- private Alignment alignment;
-
- private Anchor anchor;
-
- #endregion
-
- #region Properties, Indexers
-
- ///
- /// Gets or sets the data labels alignment.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(Alignment.None)]
- [Description("Gets or sets the data labels alignment.")]
- [JsonIgnore]
- public Alignment Alignment
- {
- get => alignment;
- set
- {
- alignment = value;
- DataLabelsAlignment = value.ToChartDatasetDataLabelAlignmentString();
- }
- }
-
- ///
- /// Gets or sets the data labels anchor.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(Anchor.None)]
- [Description("Gets or sets the data labels anchor.")]
- [JsonIgnore]
- public Anchor Anchor
- {
- get => anchor;
- set
- {
- anchor = value;
- DataLabelsAnchor = value.ToChartDatasetDataLabelAnchorString();
- }
- }
-
- //public string? BackgroundColor { get; set; }
-
- [AddedVersion("3.0.0")]
- [DefaultValue(2d)]
- [Description("Gets or sets the data label border width.")]
- public double BorderWidth { get; set; } = 2;
-
- ///
- /// Gets or sets the data labels alignment.
- /// Possible values: start, center, and end.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(null)]
- [Description("Gets the serialized data labels alignment value.")]
- [JsonPropertyName("align")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public string? DataLabelsAlignment { get; private set; }
-
- ///
- /// Gets or sets the data labels anchor.
- /// Possible values: start, center, and end.
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(null)]
- [Description("Gets the serialized data labels anchor value.")]
- [JsonPropertyName("anchor")]
- public string? DataLabelsAnchor { get; private set; }
-
- #endregion
-}
diff --git a/blazorbootstrap/Models/Charts/ChartDataset/DoughnutChart/DoughnutChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/DoughnutChart/DoughnutChartDataset.cs
deleted file mode 100644
index 62b3f7ad9..000000000
--- a/blazorbootstrap/Models/Charts/ChartDataset/DoughnutChart/DoughnutChartDataset.cs
+++ /dev/null
@@ -1,268 +0,0 @@
-namespace BlazorBootstrap;
-
-///
-/// The doughnut/pie chart allows a number of properties to be specified for each dataset.
-/// These are used to set display properties for a specific dataset.
-/// .
-///
-[AddedVersion("1.0.0")]
-public class DoughnutChartDataset : ChartDataset
-{
- #region Properties, Indexers
-
- ///
- /// Arc background color.
- ///
- ///
- /// Default value is 'rgba(0, 0, 0, 0.1)'.
- ///
- [AddedVersion("1.0.0")]
- [DefaultValue("rgba(0, 0, 0, 0.1)")]
- [Description("Gets or sets the arc background color.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? BackgroundColor { get; set; }
-
- ///
- /// Supported values are 'center' and 'inner'.
- /// When 'center' is set, the borders of arcs next to each other will overlap.
- /// When 'inner' is set, it is guaranteed that all borders will not overlap.
- ///
- ///
- /// Default value is 'center'.
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue("center")]
- [Description("Gets or sets the arc border alignment.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? BorderAlign { get; set; } // TODO: change this to enum
-
- ///
- /// Arc border color.
- ///
- ///
- /// Default value is '#fff'.
- ///
- [AddedVersion("1.0.0")]
- [DefaultValue("#fff")]
- [Description("Gets or sets the arc border color.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? BorderColor { get; set; }
-
- ///
- /// Arc border length and spacing of dashes.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the arc border dash pattern.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? BorderDash { get; set; }
-
- ///
- /// Arc border offset for line dashes.
- ///
- ///
- /// Default value is 0.0.
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(0d)]
- [Description("Gets or sets the arc border dash offset.")]
- public double BorderDashOffset { get; set; }
-
- ///
- /// Arc border join style.
- /// Supported values are 'round', 'bevel', 'miter'.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the arc border join style.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? BorderJoinStyle { get; set; } // TODO: change this to enum
-
- ///
- /// It is applied to all corners of the arc (outerStart, outerEnd, innerStart, innerRight).
- ///
- ///
- /// Default value is 0.
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(0)]
- [Description("Gets or sets the arc border radius.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? BorderRadius { get; set; }
-
- ///
- /// Arc border width (in pixels).
- ///
- ///
- /// Default value is 2.
- ///
- [AddedVersion("1.0.0")]
- [DefaultValue(2)]
- [Description("Gets or sets the arc border width in pixels.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? BorderWidth { get; set; }
-
- ///
- /// Per-dataset override for the sweep that the arcs cover.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the sweep covered by the arcs.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public double? Circumference { get; set; }
-
- [AddedVersion("1.10.2")]
- [Description("Gets or sets the dataset data label configuration.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public DoughnutChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link
-
- ///
- /// Arc background color when hovered.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("1.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the arc background color when hovered.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? HoverBackgroundColor { get; set; }
-
- ///
- /// Arc border color when hovered.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("1.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the arc border color when hovered.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? HoverBorderColor { get; set; }
-
- ///
- /// Arc border length and spacing of dashes when hovered.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the hovered arc border dash pattern.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? HoverBorderDash { get; set; }
-
- ///
- /// Arc border offset for line dashes when hovered.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the hovered arc border dash offset.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public double? HoverBorderDashOffset { get; set; }
-
- ///
- /// Arc border join style when hovered.
- /// Supported values are 'round', 'bevel', 'miter'.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the hovered arc border join style.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? HoverBorderJoinStyle { get; set; } // TODO: change this to enum
-
- ///
- /// Arc border width when hovered (in pixels).
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the hovered arc border width in pixels.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? HoverBorderWidth { get; set; }
-
- ///
- /// Arc offset when hovered (in pixels).
- ///
- ///
- /// Default value is 0.
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(0)]
- [Description("Gets or sets the hovered arc offset in pixels.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? HoverOffset { get; set; }
-
- ///
- /// Arc offset (in pixels).
- ///
- ///
- /// Default value is 0.
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(0)]
- [Description("Gets or sets the arc offset in pixels.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? Offset { get; set; }
-
- ///
- /// Per-dataset override for the starting angle to draw arcs from.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the starting rotation angle for the arcs.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public double? Rotation { get; set; }
-
- ///
- /// Fixed arc offset (in pixels). Similar to but applies to all arcs.
- ///
- ///
- /// Default value is 0.
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(0)]
- [Description("Gets or sets the fixed arc spacing in pixels.")]
- public double Spacing { get; set; }
-
- ///
- /// The relative thickness of the dataset.
- /// Providing a value for weight will cause the pie or doughnut dataset to be drawn
- /// with a thickness relative to the sum of all the dataset weight values.
- ///
- ///
- /// Default value is 1.
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(1d)]
- [Description("Gets or sets the relative dataset thickness.")]
- public double Weight { get; set; } = 1;
-
- #endregion
-}
-
-///
-/// Represents data label options for a doughnut chart dataset.
-///
-[AddedVersion("1.10.2")]
-public class DoughnutChartDatasetDataLabels : ChartDatasetDataLabels { }
diff --git a/blazorbootstrap/Models/Charts/ChartDataset/DoughnutChart/DoughnutChartDatasetData.cs b/blazorbootstrap/Models/Charts/ChartDataset/DoughnutChart/DoughnutChartDatasetData.cs
deleted file mode 100644
index 41d660077..000000000
--- a/blazorbootstrap/Models/Charts/ChartDataset/DoughnutChart/DoughnutChartDatasetData.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-namespace BlazorBootstrap;
-
-///
-/// Represents a doughnut chart data item for dynamic updates.
-///
-[AddedVersion("1.10.0")]
-public record DoughnutChartDatasetData : ChartDatasetData
-{
- #region Constructors
-
- public DoughnutChartDatasetData(string? datasetLabel, double data, string? backgroundColor) : base(datasetLabel, data)
- {
- BackgroundColor = backgroundColor;
- }
-
- #endregion
-
- #region Properties, Indexers
-
- ///
- /// Gets the background color for the generated arc.
- ///
- [AddedVersion("1.10.0")]
- public string? BackgroundColor { get; init; }
-
- #endregion
-}
diff --git a/blazorbootstrap/Models/Charts/ChartDataset/LineChart/LineChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/LineChart/LineChartDataset.cs
deleted file mode 100644
index 7d489af0b..000000000
--- a/blazorbootstrap/Models/Charts/ChartDataset/LineChart/LineChartDataset.cs
+++ /dev/null
@@ -1,586 +0,0 @@
-namespace BlazorBootstrap;
-
-///
-/// The line chart allows a number of properties to be specified for each dataset.
-/// These are used to set display properties for a specific dataset.
-/// .
-///
-[AddedVersion("1.0.0")]
-public class LineChartDataset : ChartDataset
-{
- #region Constructors
-
- public LineChartDataset()
- {
- Type = "line";
- }
-
- #endregion
-
- #region Methods
-
- ///
- /// Fill between this dataset and the other dataset, specified by absolute index (zero based) or relative index.
- ///
- /// The index of the dataset to fill to
- /// Whether the specified index is relative or absolute (zero based)
- /// The dataset, for method chaining
- /// If the relative index is zero.
- [AddedVersion("3.1.0")]
- [Description("Fills the area between this dataset and another dataset by index.")]
- public LineChartDataset FillToDataset(int index, bool relativeIndex = false)
- {
- if (relativeIndex && index == 0)
- throw new ArgumentException("The relative index must be non-zero.");
-
- Fill = relativeIndex ? index.ToString("+0;-0", CultureInfo.InvariantCulture) : index;
-
- return this;
- }
-
- ///
- /// Fill between this dataset and the other dataset, specified by passing a dataset in the same chart.
- ///
- /// The chart data of the chart both datasets live in.
- /// The other dataset to fill to.
- /// Whether to specify the fill index relative ("+/-n" string) or absolute (as zero-based int)
- /// The dataset, for method chaining
- /// If any of the datasets is not in the chart data, or if both datasets are the same.
- [AddedVersion("3.1.0")]
- [Description("Fills the area between this dataset and another dataset in the same chart.")]
- public LineChartDataset FillToDataset(ChartData chartData, IChartDataset dataset, bool relativeIndex = false)
- {
- var index = chartData?.Datasets?.IndexOf(dataset) ?? -1;
-
- if (index < 0)
- throw new ArgumentException("The dataset is not in the chart data.");
-
- if (relativeIndex)
- {
- var myIndex = relativeIndex ? chartData.Datasets.IndexOf(this) : 0;
-
- if (myIndex < 0)
- throw new ArgumentException("The dataset is not in the chart data.");
-
- if (myIndex == index)
- throw new ArgumentException("The dataset is the same as this dataset.");
-
- Fill = (index - myIndex).ToString("+0;-0", CultureInfo.InvariantCulture);
- }
- else
- {
- Fill = index;
- }
-
- return this;
- }
-
- ///
- /// Fills between the current dataset and the top of the chart (fill: 'end').
- ///
- /// The dataset, for method chaining
- [AddedVersion("3.1.0")]
- [Description("Fills between the current dataset and the end of the chart.")]
- public LineChartDataset FillToEnd()
- {
- Fill = "end";
-
- return this;
- }
-
- ///
- /// Fills between the current dataset and the origin. For legacy reasons, this is the same as fill: true.
- ///
- /// The dataset, for method chaining
- [AddedVersion("3.1.0")]
- [Description("Fills between the current dataset and the origin.")]
- public LineChartDataset FillToOrigin()
- {
- Fill = "origin";
-
- return this;
- }
-
- ///
- /// Fill to the line below the current dataset (fill: 'stack').
- ///
- /// The dataset, for method chaining
- [AddedVersion("3.1.0")]
- [Description("Fills to the stacked value below the current dataset.")]
- public LineChartDataset FillToStackedValueBelow()
- {
- Fill = "stack";
-
- return this;
- }
-
- ///
- /// Fills between the current dataset and the start (fill: 'start').
- ///
- /// The dataset, for method chaining
- [AddedVersion("3.1.0")]
- [Description("Fills between the current dataset and the start of the chart.")]
- public LineChartDataset FillToStart()
- {
- Fill = "start";
-
- return this;
- }
-
- ///
- /// Fill to the line of the given constant value.
- ///
- /// The value to fill to
- /// The dataset, for method chaining
- [AddedVersion("3.1.0")]
- [Description("Fills to a constant value.")]
- public LineChartDataset FillToValue(double value)
- {
- Fill = new { value };
-
- return this;
- }
-
- #endregion
-
- #region Properties, Indexers
-
- ///
- /// Gets or sets the line fill color.
- ///
- ///
- /// Default value is 'rgba(0, 0, 0, 0.1)'.
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue("rgba(0, 0, 0, 0.1)")]
- [Description("Gets or sets the line fill color.")]
- public string BackgroundColor { get; set; } = "rgba(0, 0, 0, 0.1)";
-
- ///
- /// Cap style of the line.
- /// Supported values are 'butt', 'round', and 'square'.
- ///
- ///
- /// Default value is 'butt'.
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue("butt")]
- [Description("Gets or sets the line border cap style.")]
- public string BorderCapStyle { get; set; } = "butt";
-
- ///
- /// Gets or sets the line color.
- ///
- ///
- /// Default value is 'rgba(0, 0, 0, 0.1)'.
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue("rgba(0, 0, 0, 0.1)")]
- [Description("Gets or sets the line color.")]
- public string BorderColor { get; set; } = "rgba(0, 0, 0, 0.1)";
-
- ///
- /// Gets or sets the length and spacing of dashes.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the line border dash pattern.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? BorderDash { get; set; }
-
- ///
- /// Offset for line dashes.
- ///
- ///
- /// Default value is 0.0.
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(0d)]
- [Description("Gets or sets the line border dash offset.")]
- public double BorderDashOffset { get; set; }
-
- ///
- /// Line joint style.
- /// There are three possible values for this property: 'round', 'bevel', and 'miter'.
- ///
- ///
- /// Default value is 'miter'.
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue("miter")]
- [Description("Gets or sets the line border join style.")]
- public string BorderJoinStyle { get; set; } = "miter";
-
- ///
- /// Gets or sets the line width (in pixels).
- ///
- ///
- /// Default value is 3.
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(3d)]
- [Description("Gets or sets the line border width in pixels.")]
- public double BorderWidth { get; set; } = 3;
-
- ///
- /// .
- /// Supported values are 'default', and 'monotone'.
- ///
- ///
- /// Default value is 'default'.
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue("default")]
- [Description("Gets or sets the cubic interpolation mode.")]
- public string CubicInterpolationMode { get; set; } = "default";
-
- [AddedVersion("1.10.2")]
- [Description("Gets or sets the dataset data label configuration.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public LineChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link
-
- ///
- /// Draw the active points of a dataset over the other points of the dataset.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets whether active points are drawn over other points.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? DrawActiveElementsOnTop { get; set; }
-
- ///
- /// How to fill the area under the line.
- ///
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("3.1.0")]
- [DefaultValue(false)]
- [Description("Gets or sets how the area under the line is filled.")]
- public object Fill { get; set; } = false;
-
- ///
- /// The line fill color when hovered.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the line fill color when hovered.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public string? HoverBackgroundColor { get; set; }
-
- ///
- /// Cap style of the line when hovered.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the line border cap style when hovered.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public string? HoverBorderCapStyle { get; set; }
-
- ///
- /// The line color when hovered.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the line color when hovered.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public string? HoverBorderColor { get; set; }
-
- ///
- /// Gets or sets the length and spacing of dashes when hovered.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the line border dash pattern when hovered.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? HoverBorderDash { get; set; }
-
- ///
- /// Offset for line dashes when hovered.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the line border dash offset when hovered.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public double? HoverBorderDashOffset { get; set; }
-
- ///
- /// Line joint style.
- /// There are three possible values for this property: 'round', 'bevel', and 'miter'.
- ///
- ///
- /// Default value is 'miter'.
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue("miter")]
- [Description("Gets or sets the line border join style when hovered.")]
- public string HoverBorderJoinStyle { get; set; } = "miter";
-
- ///
- /// The bar border width when hovered (in pixels) when hovered.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the line border width in pixels when hovered.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public double? HoverBorderWidth { get; set; }
-
- ///
- /// The base axis of the dataset. 'x' for horizontal lines and 'y' for vertical lines.
- ///
- ///
- /// Default value is 'x'.
- ///
- [AddedVersion("3.0.0")]
- [DefaultValue("x")]
- [Description("Gets or sets the base axis of the dataset.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public string? IndexAxis { get; set; }
-
- ///
- /// The fill color for points.
- ///
- ///
- /// Default value is 'rgba(0, 0, 0, 0.1)'.
- ///
- [AddedVersion("1.0.0")]
- [DefaultValue("rgba(0, 0, 0, 0.1)")]
- [Description("Gets or sets the point fill color.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? PointBackgroundColor { get; set; }
-
- ///
- /// The border color for points.
- ///
- ///
- /// Default value is 'rgba(0, 0, 0, 0.1)'.
- ///
- [AddedVersion("1.0.0")]
- [DefaultValue("rgba(0, 0, 0, 0.1)")]
- [Description("Gets or sets the point border color.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? PointBorderColor { get; set; }
-
- ///
- /// The width of the point border in pixels.
- ///
- ///
- /// Default value is 1.
- ///
- [AddedVersion("1.0.0")]
- [DefaultValue(1d)]
- [Description("Gets or sets the point border width in pixels.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? PointBorderWidth { get; set; }
-
- ///
- /// The pixel size of the non-displayed point that reacts to mouse events.
- ///
- ///
- /// Default value is 1.
- ///
- [AddedVersion("1.0.0")]
- [DefaultValue(1d)]
- [Description("Gets or sets the point hit radius.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? PointHitRadius { get; set; }
-
- ///
- /// Point background color when hovered.
- ///
- ///
- /// Default value is .
- ///
- [AddedVersion("1.0.0")]
- [DefaultValue(null)]
- [Description("Gets or sets the point background color when hovered.")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List? PointHoverBackgroundColor { get; set; }
-
- ///
- /// Point border color when hovered.
- ///
- ///
- /// Default value is