From 04301d9dbce40c5d75fbbeb0ee1d70cd13c9432d Mon Sep 17 00:00:00 2001 From: gvreddy04 Date: Thu, 14 May 2026 00:05:30 +0530 Subject: [PATCH 1/5] feat: Add Bubble Chart component and related features - Introduced BubbleChart component for visualizing three dimensions of data. - Added BubbleChartOptions for configuration including responsiveness and interaction settings. - Implemented BubbleChartDataset and BubbleChartDataPoint for dataset management. - Enhanced documentation for Bubble Chart with examples and key types. - Updated existing chart components to support new animation and stacking features. - Added demo pages for Bubble Chart showcasing dynamic updates and interaction options. --- .../Layout/DemosMainLayout.razor.cs | 13 +- .../Components/Layout/DocsMainLayout.razor.cs | 13 +- .../Components/Layout/MainLayout.razor.cs | 13 +- .../BarCharts/BarChartDocumentation.razor | 12 ++ ...BarChart_Demo_02_Horizontal_BarChart.razor | 2 +- .../BarChart_Demo_03_Stacked_BarChart.razor | 2 +- .../BarCharts/BarChart_Demo_04_Locale.razor | 2 +- ..._05_Stacked_BarChart_with_Datalabels.razor | 2 +- .../BarChart_Demo_07_Dataset_Animation.razor | 61 ++++++++ .../BarChart_Demo_08_Grouped_Stacks.razor | 77 ++++++++++ .../BubbleChartDocumentation.razor | 39 +++++ .../BubbleChart_Demo_01_Examples.razor | 137 +++++++++++++++++ .../Demos/Charts/ChartsDocumentation.razor | 5 +- .../BarChart_Doc_01_Documentation.razor | 4 + .../BubbleChart_Doc_01_Documentation.razor | 61 ++++++++ .../DoughnutChart_Doc_01_Documentation.razor | 4 + .../LineChart_Doc_01_Documentation.razor | 4 + .../PieChart_Doc_01_Documentation.razor | 4 + .../PolarAreaChart_Doc_01_Documentation.razor | 4 + .../RadarChart_Doc_01_Documentation.razor | 4 + .../ScatterChart_Doc_01_Documentation.razor | 4 + .../Components/Pages/Home/Index.razor | 5 + .../Constants/DemoRouteConstants.cs | 2 + .../Constants/DemoScreenshotSrcConstants.cs | 1 + .../Components/Charts/BarChart.razor.cs | 55 ++++--- .../Components/Charts/BarLineChartSupport.cs | 66 ++++++++ .../Components/Charts/BlazorBootstrapChart.cs | 6 + .../Components/Charts/BubbleChart.razor | 6 + .../Components/Charts/BubbleChart.razor.cs | 141 ++++++++++++++++++ .../Components/Charts/LineChart.razor.cs | 27 ++-- .../ChartDataset/BarChart/BarChartDataset.cs | 9 ++ .../BubbleChart/BubbleChartDataPoint.cs | 6 + .../BubbleChart/BubbleChartDataset.cs | 63 ++++++++ .../BubbleChart/BubbleChartDatasetData.cs | 10 ++ .../Charts/ChartDataset/ChartDataset.cs | 17 ++- .../LineChart/LineChartDataset.cs | 9 ++ .../Charts/ChartOptions/BubbleChartOptions.cs | 19 +++ .../Charts/ChartOptions/ChartOptions.cs | 122 +++++++++++++-- .../Charts/ChartPlugins/BubbleChartPlugins.cs | 34 +++++ blazorbootstrap/wwwroot/blazor.bootstrap.js | 138 ++++++++++++++++- ...01-a-getting-started-webassembly-NET-8.mdx | 2 +- ...ing-started-webapp-server-global-NET-8.mdx | 2 +- ...tting-started-webapp-auto-global-NET-8.mdx | 2 +- docs/docs/05-components/charts.mdx | 11 +- docs/docs/06-data-visualization/bar-chart.mdx | 95 +++++++++++- .../06-data-visualization/bubble-chart.mdx | 101 +++++++++++++ .../docs/06-data-visualization/line-chart.mdx | 14 ++ .../06-data-visualization/scatter-chart.mdx | 12 ++ 48 files changed, 1350 insertions(+), 92 deletions(-) create mode 100644 BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_07_Dataset_Animation.razor create mode 100644 BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_08_Grouped_Stacks.razor create mode 100644 BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BubbleCharts/BubbleChartDocumentation.razor create mode 100644 BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BubbleCharts/BubbleChart_Demo_01_Examples.razor create mode 100644 BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/BubbleCharts/BubbleChart_Doc_01_Documentation.razor create mode 100644 blazorbootstrap/Components/Charts/BarLineChartSupport.cs create mode 100644 blazorbootstrap/Components/Charts/BubbleChart.razor create mode 100644 blazorbootstrap/Components/Charts/BubbleChart.razor.cs create mode 100644 blazorbootstrap/Models/Charts/ChartDataset/BubbleChart/BubbleChartDataPoint.cs create mode 100644 blazorbootstrap/Models/Charts/ChartDataset/BubbleChart/BubbleChartDataset.cs create mode 100644 blazorbootstrap/Models/Charts/ChartDataset/BubbleChart/BubbleChartDatasetData.cs create mode 100644 blazorbootstrap/Models/Charts/ChartOptions/BubbleChartOptions.cs create mode 100644 blazorbootstrap/Models/Charts/ChartPlugins/BubbleChartPlugins.cs create mode 100644 docs/docs/06-data-visualization/bubble-chart.mdx diff --git a/BlazorBootstrap.Demo.RCL/Components/Layout/DemosMainLayout.razor.cs b/BlazorBootstrap.Demo.RCL/Components/Layout/DemosMainLayout.razor.cs index 081401204..d1e6f1d92 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Layout/DemosMainLayout.razor.cs +++ b/BlazorBootstrap.Demo.RCL/Components/Layout/DemosMainLayout.razor.cs @@ -93,12 +93,13 @@ internal override IEnumerable GetNavItems() new (){ Id = "6", Text = "Data Visualization", IconName = IconName.BarChartFill, IconColor = IconColor.Warning }, new (){ Id = "600", Text = "Bar Chart", Href = DemoRouteConstants.Demos_URL_BarChart, IconName = IconName.BarChartFill, ParentId = "6", Match = NavLinkMatch.All }, - new (){ Id = "601", Text = "Doughnut Chart", Href = DemoRouteConstants.Demos_URL_DoughnutChart, IconName = IconName.CircleFill, ParentId = "6", Match = NavLinkMatch.All }, - new (){ Id = "602", Text = "Line Chart", Href = DemoRouteConstants.Demos_URL_LineChart, IconName = IconName.GraphUp, ParentId = "6", Match = NavLinkMatch.All }, - new (){ Id = "603", Text = "Pie Chart", Href = DemoRouteConstants.Demos_URL_PieChart, IconName = IconName.PieChartFill, ParentId = "6", Match = NavLinkMatch.All }, - new (){ Id = "604", Text = "Polar Area Chart", Href = DemoRouteConstants.Demos_URL_PolarAreaChart, IconName = IconName.PieChartFill, ParentId = "6", Match = NavLinkMatch.All }, - new (){ Id = "605", Text = "Radar Chart", Href = DemoRouteConstants.Demos_URL_RadarChart, IconName = IconName.Radar, ParentId = "6", Match = NavLinkMatch.All }, - new (){ Id = "605", Text = "Scatter Chart", Href = DemoRouteConstants.Demos_URL_ScatterChart, IconName = IconName.GraphUpArrow, ParentId = "6", Match = NavLinkMatch.All }, + new (){ Id = "601", Text = "Bubble Chart", Href = DemoRouteConstants.Demos_URL_BubbleChart, IconName = IconName.CircleFill, ParentId = "6", Match = NavLinkMatch.All }, + new (){ Id = "602", Text = "Doughnut Chart", Href = DemoRouteConstants.Demos_URL_DoughnutChart, IconName = IconName.CircleFill, ParentId = "6", Match = NavLinkMatch.All }, + new (){ Id = "603", Text = "Line Chart", Href = DemoRouteConstants.Demos_URL_LineChart, IconName = IconName.GraphUp, ParentId = "6", Match = NavLinkMatch.All }, + new (){ Id = "604", Text = "Pie Chart", Href = DemoRouteConstants.Demos_URL_PieChart, IconName = IconName.PieChartFill, ParentId = "6", Match = NavLinkMatch.All }, + new (){ Id = "605", Text = "Polar Area Chart", Href = DemoRouteConstants.Demos_URL_PolarAreaChart, IconName = IconName.PieChartFill, ParentId = "6", Match = NavLinkMatch.All }, + new (){ Id = "606", Text = "Radar Chart", Href = DemoRouteConstants.Demos_URL_RadarChart, IconName = IconName.Radar, ParentId = "6", Match = NavLinkMatch.All }, + new (){ Id = "607", Text = "Scatter Chart", Href = DemoRouteConstants.Demos_URL_ScatterChart, IconName = IconName.GraphUpArrow, ParentId = "6", Match = NavLinkMatch.All }, new(){ Id = "7", Text = "Services", IconName = IconName.WrenchAdjustableCircleFill, IconColor = IconColor.Success }, new (){ Id = "700", Text = "Breadcrumb Service", Href = DemoRouteConstants.Demos_URL_BreadcrumbService, IconName = IconName.SegmentedNav, ParentId = "7" }, diff --git a/BlazorBootstrap.Demo.RCL/Components/Layout/DocsMainLayout.razor.cs b/BlazorBootstrap.Demo.RCL/Components/Layout/DocsMainLayout.razor.cs index fed5c4c02..9df45dc94 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Layout/DocsMainLayout.razor.cs +++ b/BlazorBootstrap.Demo.RCL/Components/Layout/DocsMainLayout.razor.cs @@ -69,12 +69,13 @@ internal override IEnumerable GetNavItems() new (){ Id = "6", Text = "Data Visualization", IconName = IconName.BarChartFill, IconColor = IconColor.Warning }, new (){ Id = "600", Text = "Bar Chart", Href = DemoRouteConstants.Docs_URL_BarChart, IconName = IconName.BarChartFill, ParentId = "6", Match = NavLinkMatch.All }, - new (){ Id = "601", Text = "Doughnut Chart", Href = DemoRouteConstants.Docs_URL_DoughnutChart, IconName = IconName.CircleFill, ParentId = "6", Match = NavLinkMatch.All }, - new (){ Id = "602", Text = "Line Chart", Href = DemoRouteConstants.Docs_URL_LineChart, IconName = IconName.GraphUp, ParentId = "6", Match = NavLinkMatch.All }, - new (){ Id = "603", Text = "Pie Chart", Href = DemoRouteConstants.Docs_URL_PieChart, IconName = IconName.PieChartFill, ParentId = "6", Match = NavLinkMatch.All }, - new (){ Id = "604", Text = "Polar Area Chart", Href = DemoRouteConstants.Docs_URL_PolarAreaChart, IconName = IconName.PieChartFill, ParentId = "6", Match = NavLinkMatch.All }, - new (){ Id = "605", Text = "Radar Chart", Href = DemoRouteConstants.Docs_URL_RadarChart, IconName = IconName.Radar, ParentId = "6", Match = NavLinkMatch.All }, - new (){ Id = "605", Text = "Scatter Chart", Href = DemoRouteConstants.Docs_URL_ScatterChart, IconName = IconName.GraphUpArrow, ParentId = "6", Match = NavLinkMatch.All }, + new (){ Id = "601", Text = "Bubble Chart", Href = DemoRouteConstants.Docs_URL_BubbleChart, IconName = IconName.CircleFill, ParentId = "6", Match = NavLinkMatch.All }, + new (){ Id = "602", Text = "Doughnut Chart", Href = DemoRouteConstants.Docs_URL_DoughnutChart, IconName = IconName.CircleFill, ParentId = "6", Match = NavLinkMatch.All }, + new (){ Id = "603", Text = "Line Chart", Href = DemoRouteConstants.Docs_URL_LineChart, IconName = IconName.GraphUp, ParentId = "6", Match = NavLinkMatch.All }, + new (){ Id = "604", Text = "Pie Chart", Href = DemoRouteConstants.Docs_URL_PieChart, IconName = IconName.PieChartFill, ParentId = "6", Match = NavLinkMatch.All }, + new (){ Id = "605", Text = "Polar Area Chart", Href = DemoRouteConstants.Docs_URL_PolarAreaChart, IconName = IconName.PieChartFill, ParentId = "6", Match = NavLinkMatch.All }, + new (){ Id = "606", Text = "Radar Chart", Href = DemoRouteConstants.Docs_URL_RadarChart, IconName = IconName.Radar, ParentId = "6", Match = NavLinkMatch.All }, + new (){ Id = "607", Text = "Scatter Chart", Href = DemoRouteConstants.Docs_URL_ScatterChart, IconName = IconName.GraphUpArrow, ParentId = "6", Match = NavLinkMatch.All }, new(){ Id = "7", Text = "Services", IconName = IconName.WrenchAdjustableCircleFill, IconColor = IconColor.Success }, new (){ Id = "700", Text = "Breadcrumb Service", Href = DemoRouteConstants.Docs_URL_BreadcrumbService, IconName = IconName.SegmentedNav, ParentId = "7" }, diff --git a/BlazorBootstrap.Demo.RCL/Components/Layout/MainLayout.razor.cs b/BlazorBootstrap.Demo.RCL/Components/Layout/MainLayout.razor.cs index f20977c51..0a5391509 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Layout/MainLayout.razor.cs +++ b/BlazorBootstrap.Demo.RCL/Components/Layout/MainLayout.razor.cs @@ -92,12 +92,13 @@ internal override IEnumerable GetNavItems() new (){ Id = "6", Text = "Data Visualization", IconName = IconName.BarChartFill, IconColor = IconColor.Warning }, new (){ Id = "600", Text = "Bar Chart", Href = DemoRouteConstants.Demos_URL_BarChart, IconName = IconName.BarChartFill, ParentId = "6", Match = NavLinkMatch.All }, - new (){ Id = "601", Text = "Doughnut Chart", Href = DemoRouteConstants.Demos_URL_DoughnutChart, IconName = IconName.CircleFill, ParentId = "6", Match = NavLinkMatch.All }, - new (){ Id = "602", Text = "Line Chart", Href = DemoRouteConstants.Demos_URL_LineChart, IconName = IconName.GraphUp, ParentId = "6", Match = NavLinkMatch.All }, - new (){ Id = "603", Text = "Pie Chart", Href = DemoRouteConstants.Demos_URL_PieChart, IconName = IconName.PieChartFill, ParentId = "6", Match = NavLinkMatch.All }, - new (){ Id = "604", Text = "Polar Area Chart", Href = DemoRouteConstants.Demos_URL_PolarAreaChart, IconName = IconName.PieChartFill, ParentId = "6", Match = NavLinkMatch.All }, - new (){ Id = "605", Text = "Radar Chart", Href = DemoRouteConstants.Demos_URL_RadarChart, IconName = IconName.Radar, ParentId = "6", Match = NavLinkMatch.All }, - new (){ Id = "605", Text = "Scatter Chart", Href = DemoRouteConstants.Demos_URL_ScatterChart, IconName = IconName.GraphUpArrow, ParentId = "6", Match = NavLinkMatch.All }, + new (){ Id = "601", Text = "Bubble Chart", Href = DemoRouteConstants.Demos_URL_BubbleChart, IconName = IconName.CircleFill, ParentId = "6", Match = NavLinkMatch.All }, + new (){ Id = "602", Text = "Doughnut Chart", Href = DemoRouteConstants.Demos_URL_DoughnutChart, IconName = IconName.CircleFill, ParentId = "6", Match = NavLinkMatch.All }, + new (){ Id = "603", Text = "Line Chart", Href = DemoRouteConstants.Demos_URL_LineChart, IconName = IconName.GraphUp, ParentId = "6", Match = NavLinkMatch.All }, + new (){ Id = "604", Text = "Pie Chart", Href = DemoRouteConstants.Demos_URL_PieChart, IconName = IconName.PieChartFill, ParentId = "6", Match = NavLinkMatch.All }, + new (){ Id = "605", Text = "Polar Area Chart", Href = DemoRouteConstants.Demos_URL_PolarAreaChart, IconName = IconName.PieChartFill, ParentId = "6", Match = NavLinkMatch.All }, + new (){ Id = "606", Text = "Radar Chart", Href = DemoRouteConstants.Demos_URL_RadarChart, IconName = IconName.Radar, ParentId = "6", Match = NavLinkMatch.All }, + new (){ Id = "607", Text = "Scatter Chart", Href = DemoRouteConstants.Demos_URL_ScatterChart, IconName = IconName.GraphUpArrow, ParentId = "6", Match = NavLinkMatch.All }, new(){ Id = "7", Text = "Services", IconName = IconName.WrenchAdjustableCircleFill, IconColor = IconColor.Success }, new (){ Id = "700", Text = "Modal Service", Href = DemoRouteConstants.Demos_URL_ModalService, IconName = IconName.WindowStack, ParentId = "7" }, diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChartDocumentation.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChartDocumentation.razor index 8eb2308ef..a4809dd71 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChartDocumentation.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChartDocumentation.razor @@ -31,6 +31,12 @@
+
+
+ Set the Stack property on each dataset to group bars into separate stacked series within the same chart. +
+ +
By default, the chart is using the default locale of the platform on which it is running. @@ -41,6 +47,12 @@
+
+
+ You can configure animations globally on the chart options or per dataset to stagger how each series enters the chart. +
+ +
diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_02_Horizontal_BarChart.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_02_Horizontal_BarChart.razor index 948bf9ce0..de6d838c4 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_02_Horizontal_BarChart.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_02_Horizontal_BarChart.razor @@ -23,7 +23,7 @@ barChartOptions = new BarChartOptions(); barChartOptions.Responsive = true; - barChartOptions.Interaction = new Interaction { Mode = InteractionMode.Y }; + barChartOptions.Interaction = new Interaction { Mode = InteractionMode.Index, Axis = InteractionAxis.Y }; barChartOptions.IndexAxis = "y"; barChartOptions.Scales.X!.Title = new ChartAxesTitle { Text = "Visitors", Display = true }; diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_03_Stacked_BarChart.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_03_Stacked_BarChart.razor index 83b824549..8d9ad4349 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_03_Stacked_BarChart.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_03_Stacked_BarChart.razor @@ -46,7 +46,7 @@ barChartOptions = new(); barChartOptions.Responsive = true; - barChartOptions.Interaction = new Interaction { Mode = InteractionMode.Y }; + barChartOptions.Interaction = new Interaction { Mode = InteractionMode.Index, Axis = InteractionAxis.Y }; barChartOptions.IndexAxis = "y"; barChartOptions.Scales.X!.Title = new ChartAxesTitle { Text = "Visitors", Display = true }; diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_04_Locale.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_04_Locale.razor index c28f87227..8fcd906e9 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_04_Locale.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_04_Locale.razor @@ -47,7 +47,7 @@ barChartOptions = new(); barChartOptions.Locale = "de-DE"; barChartOptions.Responsive = true; - barChartOptions.Interaction = new Interaction { Mode = InteractionMode.Y }; + barChartOptions.Interaction = new Interaction { Mode = InteractionMode.Index, Axis = InteractionAxis.Y }; barChartOptions.IndexAxis = "y"; barChartOptions.Scales.X!.Title = new ChartAxesTitle { Text = "Visitors", Display = true }; diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_05_Stacked_BarChart_with_Datalabels.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_05_Stacked_BarChart_with_Datalabels.razor index a0f29f319..b49273038 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_05_Stacked_BarChart_with_Datalabels.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_05_Stacked_BarChart_with_Datalabels.razor @@ -50,7 +50,7 @@ barChartOptions = new(); barChartOptions.Responsive = true; - barChartOptions.Interaction = new Interaction { Mode = InteractionMode.Y }; + barChartOptions.Interaction = new Interaction { Mode = InteractionMode.Index, Axis = InteractionAxis.Y }; barChartOptions.IndexAxis = "y"; barChartOptions.Scales.X!.Title = new ChartAxesTitle { Text = "Visitors", Display = true }; diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_07_Dataset_Animation.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_07_Dataset_Animation.razor new file mode 100644 index 000000000..8eb7a6285 --- /dev/null +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_07_Dataset_Animation.razor @@ -0,0 +1,61 @@ + + +@code { + private BarChart barChart = default!; + private BarChartOptions barChartOptions = default!; + private ChartData chartData = default!; + + protected override void OnInitialized() + { + var colors = ColorUtility.CategoricalTwelveColors; + + chartData = new ChartData + { + Labels = new List { "January", "February", "March", "April", "May", "June" }, + Datasets = new List + { + new BarChartDataset + { + Label = "Product A", + Data = new List { 65, 59, 80, 81, 56, 55 }, + BackgroundColor = new List { colors[0].ToColor().ToRgbString() }, + BorderColor = new List { colors[0].ToColor().ToRgbString() }, + BorderWidth = new List { 0 }, + Animation = new ChartAnimation { Delay = 0, Duration = 1200 } + }, + new BarChartDataset + { + Label = "Product B", + Data = new List { 28, 48, 40, 19, 86, 27 }, + BackgroundColor = new List { colors[1].ToColor().ToRgbString() }, + BorderColor = new List { colors[1].ToColor().ToRgbString() }, + BorderWidth = new List { 0 }, + Animation = new ChartAnimation { Delay = 250, Duration = 1200 } + }, + new BarChartDataset + { + Label = "Product C", + Data = new List { 18, 38, 50, 29, 66, 47 }, + BackgroundColor = new List { colors[2].ToColor().ToRgbString() }, + BorderColor = new List { colors[2].ToColor().ToRgbString() }, + BorderWidth = new List { 0 }, + Animation = new ChartAnimation { Delay = 500, Duration = 1200 } + } + } + }; + + barChartOptions = new BarChartOptions + { + Responsive = true, + Animation = new ChartAnimation { Duration = 1200, Easing = "easeOutQuart" } + }; + } + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + await barChart.InitializeAsync(chartData, barChartOptions); + + await base.OnAfterRenderAsync(firstRender); + } +} \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_08_Grouped_Stacks.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_08_Grouped_Stacks.razor new file mode 100644 index 000000000..77360876b --- /dev/null +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_08_Grouped_Stacks.razor @@ -0,0 +1,77 @@ + + +@code { + private BarChart barChart = default!; + private BarChartOptions barChartOptions = default!; + private ChartData chartData = default!; + + protected override void OnInitialized() + { + var colors = ColorUtility.CategoricalTwelveColors; + + chartData = new ChartData + { + Labels = new List { "Q1", "Q2", "Q3", "Q4" }, + Datasets = new List + { + new BarChartDataset + { + Label = "North Budget", + Data = new List { 42, 47, 44, 50 }, + BackgroundColor = new List { colors[0] }, + BorderColor = new List { colors[0] }, + BorderWidth = new List { 0 }, + Stack = "North" + }, + new BarChartDataset + { + Label = "North Actual", + Data = new List { 39, 45, 48, 53 }, + BackgroundColor = new List { colors[1] }, + BorderColor = new List { colors[1] }, + BorderWidth = new List { 0 }, + Stack = "North" + }, + new BarChartDataset + { + Label = "South Budget", + Data = new List { 35, 38, 41, 46 }, + BackgroundColor = new List { colors[4] }, + BorderColor = new List { colors[4] }, + BorderWidth = new List { 0 }, + Stack = "South" + }, + new BarChartDataset + { + Label = "South Actual", + Data = new List { 33, 40, 43, 45 }, + BackgroundColor = new List { colors[5] }, + BorderColor = new List { colors[5] }, + BorderWidth = new List { 0 }, + Stack = "South" + } + } + }; + + barChartOptions = new BarChartOptions + { + Responsive = true, + Interaction = new Interaction { Mode = InteractionMode.Index } + }; + + barChartOptions.Scales.X!.Stacked = true; + barChartOptions.Scales.Y!.Stacked = true; + barChartOptions.Scales.X.Title = new ChartAxesTitle { Text = "Quarter", Display = true }; + barChartOptions.Scales.Y.Title = new ChartAxesTitle { Text = "Revenue (in millions)", Display = true }; + barChartOptions.Plugins.Title!.Text = "Grouped stacked revenue by region"; + barChartOptions.Plugins.Title.Display = true; + } + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + await barChart.InitializeAsync(chartData, barChartOptions); + + await base.OnAfterRenderAsync(firstRender); + } +} \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BubbleCharts/BubbleChartDocumentation.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BubbleCharts/BubbleChartDocumentation.razor new file mode 100644 index 000000000..4389e2389 --- /dev/null +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BubbleCharts/BubbleChartDocumentation.razor @@ -0,0 +1,39 @@ +@attribute [Route(pageUrl)] +@layout DemosMainLayout + + + + + +
+
+ Refer to the getting started guide for setting up charts. +
+
+ +
+
+ The bubble chart visualizes three dimensions of data by mapping each point to X, Y, and R values. +
+ + For data visualization, you can use the predefined palettes ColorUtility.CategoricalTwelveColors for a 12-color palette and ColorUtility.CategoricalSixColors for a 6-color palette. + These palettes offer a range of distinct and visually appealing colors that can be applied to represent different categories or data elements in your visualizations. + + +
+ + + +@code { + private const string pageUrl = DemoRouteConstants.Demos_URL_BubbleChart; + private const string pageTitle = "Blazor Bubble Chart"; + private const string pageDescription = "A Blazor Bootstrap bubble chart component 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 size of each bubble represents a third value."; + private const string metaTitle = "Blazor Bubble Chart Component"; + private const string metaDescription = "A Blazor Bootstrap bubble chart component 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 size of each bubble represents a third value."; + private const string imageUrl = "https://i.imgur.com/GEox0tS.png"; +} \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BubbleCharts/BubbleChart_Demo_01_Examples.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BubbleCharts/BubbleChart_Demo_01_Examples.razor new file mode 100644 index 000000000..f6bd3d9b1 --- /dev/null +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BubbleCharts/BubbleChart_Demo_01_Examples.razor @@ -0,0 +1,137 @@ + + +
+ + + +
+ +@code { + private BubbleChart bubbleChart = default!; + private BubbleChartOptions bubbleChartOptions = default!; + private ChartData chartData = default!; + + private int datasetsCount = 0; + private int labelsCount = 0; + private readonly string[] months = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; + private readonly Random random = new(); + + protected override void OnInitialized() + { + chartData = new ChartData { Labels = GetDefaultDataLabels(6), Datasets = GetDefaultDataSets(3) }; + bubbleChartOptions = new BubbleChartOptions { Responsive = true, Interaction = new Interaction { Mode = InteractionMode.Index } }; + } + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + await bubbleChart.InitializeAsync(chartData, bubbleChartOptions); + + await base.OnAfterRenderAsync(firstRender); + } + + private async Task RandomizeAsync() + { + if (chartData is null || chartData.Datasets is null || !chartData.Datasets.Any()) + return; + + var newDatasets = new List(); + + foreach (var dataset in chartData.Datasets) + if (dataset is BubbleChartDataset bubbleChartDataset && bubbleChartDataset.Data is not null) + { + var count = bubbleChartDataset.Data.Count; + var newData = new List(); + + for (var i = 0; i < count; i++) + newData.Add(NewBubbleChartDataPoint); + + bubbleChartDataset.Data = newData; + newDatasets.Add(bubbleChartDataset); + } + + chartData.Datasets = newDatasets; + + await bubbleChart.UpdateAsync(chartData, bubbleChartOptions); + } + + private async Task AddDatasetAsync() + { + if (chartData is null || chartData.Datasets is null || datasetsCount >= 12) + return; + + chartData = await bubbleChart.AddDatasetAsync(chartData, GetRandomBubbleChartDataset(), bubbleChartOptions); + } + + private async Task AddDataAsync() + { + if (chartData is null || chartData.Datasets is null || labelsCount >= 12) + return; + + var data = new List(); + + foreach (var dataset in chartData.Datasets) + if (dataset is BubbleChartDataset bubbleChartDataset) + data.Add(new BubbleChartDatasetData(bubbleChartDataset.Label, NewBubbleChartDataPoint)); + + chartData = await bubbleChart.AddDataAsync(chartData, GetNextDataLabel(), data); + } + + #region Data Preparation + + private List GetDefaultDataSets(int numberOfDatasets) + { + var datasets = new List(); + + for (var index = 0; index < numberOfDatasets; index++) + datasets.Add(GetRandomBubbleChartDataset()); + + return datasets; + } + + private BubbleChartDataset GetRandomBubbleChartDataset() + { + var color = ColorUtility.CategoricalTwelveColors[datasetsCount].ToColor(); + + datasetsCount += 1; + + return new BubbleChartDataset + { + Label = $"Product {datasetsCount}", + Data = GetRandomData(), + BackgroundColor = new List { color.ToRgbString() }, + BorderColor = new List { color.ToRgbString() }, + HoverBorderWidth = new List { 4 } + }; + } + + private List GetRandomData() + { + var data = new List(); + + for (var index = 0; index < labelsCount; index++) + data.Add(NewBubbleChartDataPoint); + + return data; + } + + private List GetDefaultDataLabels(int numberOfLabels) + { + var labels = new List(); + + for (var index = 0; index < numberOfLabels; index++) + labels.Add(GetNextDataLabel()); + + return labels; + } + + private string GetNextDataLabel() + { + labelsCount += 1; + return months[labelsCount - 1]; + } + + private BubbleChartDataPoint NewBubbleChartDataPoint => new(random.Next(40), random.Next(40), random.Next(10)); + + #endregion Data Preparation +} \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/ChartsDocumentation.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/ChartsDocumentation.razor index 134a26ef8..637aecb10 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/ChartsDocumentation.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/ChartsDocumentation.razor @@ -15,9 +15,10 @@
-
At this moment we are supporting seven blazor chart types.
+
At this moment we are supporting eight blazor chart types.
  1. Bar Chart
  2. +
  3. Bubble Chart
  4. Doughnut Chart
  5. Line Chart
  6. Pie Chart
  7. @@ -27,7 +28,7 @@
- We will add Bubble Chart and Mixed Chart support in the subsequent versions. + BarChart and LineChart now support mixed bar/line datasets, and BubbleChart is available alongside the rest of the chart gallery.
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 6359f74d3..3f92b816e 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 @@ -46,6 +46,10 @@
+
+ +
+ @code { private const string componentName = nameof(BarChart); private const string pageUrl = DemoRouteConstants.Docs_URL_BarChart; diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/BubbleCharts/BubbleChart_Doc_01_Documentation.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/BubbleCharts/BubbleChart_Doc_01_Documentation.razor new file mode 100644 index 000000000..f2fcaa26c --- /dev/null +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/BubbleCharts/BubbleChart_Doc_01_Documentation.razor @@ -0,0 +1,61 @@ +@attribute [Route(pageUrl)] +@layout DocsMainLayout + + + + + +
+ @metaTitle +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +@code { + private const string componentName = nameof(BubbleChart); + private const string pageUrl = DemoRouteConstants.Docs_URL_BubbleChart; + private const string pageTitle = componentName; + private const string pageDescription = $"This documentation provides a comprehensive reference for the {componentName} component, guiding you through its configuration options."; + 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 2942f774c..0768d373e 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 @@ -46,6 +46,10 @@
+
+ +
+ @code { private const string componentName = nameof(DoughnutChart); private const string pageUrl = DemoRouteConstants.Docs_URL_DoughnutChart; diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/LineCharts/LineChart_Doc_01_Documentation.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/LineCharts/LineChart_Doc_01_Documentation.razor index 8da0ace5e..b5325d5c5 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/LineCharts/LineChart_Doc_01_Documentation.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/LineCharts/LineChart_Doc_01_Documentation.razor @@ -46,6 +46,10 @@
+
+ +
+ @code { private const string componentName = nameof(LineChart); private const string pageUrl = DemoRouteConstants.Docs_URL_LineChart; diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/PieCharts/PieChart_Doc_01_Documentation.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/PieCharts/PieChart_Doc_01_Documentation.razor index 6a499aa53..e40ca8355 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/PieCharts/PieChart_Doc_01_Documentation.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/PieCharts/PieChart_Doc_01_Documentation.razor @@ -46,6 +46,10 @@
+
+ +
+ @code { private const string componentName = nameof(PieChart); private const string pageUrl = DemoRouteConstants.Docs_URL_PieChart; diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/PolarAreaCharts/PolarAreaChart_Doc_01_Documentation.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/PolarAreaCharts/PolarAreaChart_Doc_01_Documentation.razor index 9602c6066..1f4c4ec3b 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/PolarAreaCharts/PolarAreaChart_Doc_01_Documentation.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/PolarAreaCharts/PolarAreaChart_Doc_01_Documentation.razor @@ -46,6 +46,10 @@
+
+ +
+ @code { private const string componentName = nameof(PolarAreaChart); private const string pageUrl = DemoRouteConstants.Docs_URL_PolarAreaChart; diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/RadarCharts/RadarChart_Doc_01_Documentation.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/RadarCharts/RadarChart_Doc_01_Documentation.razor index 8f5edb2a6..329aafb5d 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/RadarCharts/RadarChart_Doc_01_Documentation.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/RadarCharts/RadarChart_Doc_01_Documentation.razor @@ -46,6 +46,10 @@ +
+ +
+ @code { private const string componentName = nameof(RadarChart); private const string pageUrl = DemoRouteConstants.Docs_URL_RadarChart; diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/ScatterCharts/ScatterChart_Doc_01_Documentation.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/ScatterCharts/ScatterChart_Doc_01_Documentation.razor index 21686b2ee..691e83df2 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/ScatterCharts/ScatterChart_Doc_01_Documentation.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/ScatterCharts/ScatterChart_Doc_01_Documentation.razor @@ -46,6 +46,10 @@ +
+ +
+ @code { private const string componentName = nameof(ScatterChart); private const string pageUrl = DemoRouteConstants.Docs_URL_ScatterChart; diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Home/Index.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Home/Index.razor index 75f780ea2..bc6747647 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Home/Index.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Home/Index.razor @@ -383,6 +383,11 @@

Bar Chart

+

Doughnut Chart

diff --git a/BlazorBootstrap.Demo.RCL/Constants/DemoRouteConstants.cs b/BlazorBootstrap.Demo.RCL/Constants/DemoRouteConstants.cs index 9df346203..3dccaee09 100644 --- a/BlazorBootstrap.Demo.RCL/Constants/DemoRouteConstants.cs +++ b/BlazorBootstrap.Demo.RCL/Constants/DemoRouteConstants.cs @@ -101,6 +101,7 @@ public static class DemoRouteConstants // Data Visualization public const string Demos_URL_Charts_Prefix = Demos_URL_Prefix + "/charts"; public const string Demos_URL_BarChart = Demos_URL_Charts_Prefix + "/bar-chart"; + public const string Demos_URL_BubbleChart = Demos_URL_Charts_Prefix + "/bubble-chart"; public const string Demos_URL_DoughnutChart = Demos_URL_Charts_Prefix + "/doughnut-chart"; public const string Demos_URL_LineChart = Demos_URL_Charts_Prefix + "/line-chart"; public const string Demos_URL_PieChart = Demos_URL_Charts_Prefix + "/pie-chart"; @@ -193,6 +194,7 @@ public static class DemoRouteConstants // Data Visualization public const string Docs_URL_Charts_Prefix = Docs_URL_Prefix + "/charts"; public const string Docs_URL_BarChart = Docs_URL_Charts_Prefix + "/bar-chart"; + public const string Docs_URL_BubbleChart = Docs_URL_Charts_Prefix + "/bubble-chart"; public const string Docs_URL_DoughnutChart = Docs_URL_Charts_Prefix + "/doughnut-chart"; public const string Docs_URL_LineChart = Docs_URL_Charts_Prefix + "/line-chart"; public const string Docs_URL_PieChart = Docs_URL_Charts_Prefix + "/pie-chart"; diff --git a/BlazorBootstrap.Demo.RCL/Constants/DemoScreenshotSrcConstants.cs b/BlazorBootstrap.Demo.RCL/Constants/DemoScreenshotSrcConstants.cs index 67d975ea7..127097a7b 100644 --- a/BlazorBootstrap.Demo.RCL/Constants/DemoScreenshotSrcConstants.cs +++ b/BlazorBootstrap.Demo.RCL/Constants/DemoScreenshotSrcConstants.cs @@ -93,6 +93,7 @@ public class DemoScreenshotSrcConstants // Data Visualization public const string Demos_URL_Charts_Prefix = DemoScreenshotSrcPrefix + "home.png"; public const string Demos_URL_BarChart = DemoScreenshotSrcPrefix + "bar-chart.png"; + public const string Demos_URL_BubbleChart = DemoScreenshotSrcPrefix + "charts.png"; // TODO: add a dedicated screenshot public const string Demos_URL_DoughnutChart = DemoScreenshotSrcPrefix + "doughnut-chart.png"; public const string Demos_URL_LineChart = DemoScreenshotSrcPrefix + "line-chart.png"; public const string Demos_URL_PieChart = DemoScreenshotSrcPrefix + "pie-chart.png"; diff --git a/blazorbootstrap/Components/Charts/BarChart.razor.cs b/blazorbootstrap/Components/Charts/BarChart.razor.cs index a8da064a6..2596cfc7d 100644 --- a/blazorbootstrap/Components/Charts/BarChart.razor.cs +++ b/blazorbootstrap/Components/Charts/BarChart.razor.cs @@ -31,9 +31,7 @@ public override async Task AddDataAsync(ChartData chartData, string d throw new ArgumentNullException(nameof(data)); foreach (var dataset in chartData.Datasets) - if (dataset is BarChartDataset barChartDataset && barChartDataset.Label == dataLabel) - if (data is BarChartDatasetData barChartDatasetData) - barChartDataset.Data?.Add(barChartDatasetData.Data as double?); + BarLineChartSupport.AppendDataPoint(dataset, data); await SafeInvokeVoidAsync($"{_jsObjectName}.addDatasetData", Id, dataLabel, data); @@ -72,15 +70,14 @@ public override async Task AddDataAsync(ChartData chartData, string d chartData.Labels.Add(dataLabel); foreach (var dataset in chartData.Datasets) - if (dataset is BarChartDataset barChartDataset) - { - var chartDatasetData = data.FirstOrDefault(x => x is BarChartDatasetData barChartDatasetData && barChartDatasetData.DatasetLabel == barChartDataset.Label); + { + var chartDatasetData = data.FirstOrDefault(x => x is ChartDatasetData chartDataPoint && chartDataPoint.DatasetLabel == (dataset as dynamic).Label); - if (chartDatasetData is BarChartDatasetData barChartDatasetData) - barChartDataset.Data?.Add(barChartDatasetData.Data as double?); - } + if (chartDatasetData is not null) + BarLineChartSupport.AppendDataPoint(dataset, chartDatasetData); + } - await SafeInvokeVoidAsync($"{_jsObjectName}.addDatasetsData", Id, dataLabel, data?.Select(x => (BarChartDatasetData)x)); + await SafeInvokeVoidAsync($"{_jsObjectName}.addDatasetsData", Id, dataLabel, data?.OfType()); return chartData; } @@ -96,10 +93,10 @@ public override async Task AddDatasetAsync(ChartData chartData, IChar if (chartDataset is null) throw new ArgumentNullException(nameof(chartDataset)); - if (chartDataset is BarChartDataset) + if (BarLineChartSupport.IsSupportedDataset(chartDataset)) { chartData.Datasets.Add(chartDataset); - await SafeInvokeVoidAsync($"{_jsObjectName}.addDataset", Id, (BarChartDataset)chartDataset); + await SafeInvokeVoidAsync($"{_jsObjectName}.addDataset", Id, chartDataset); } return chartData; @@ -107,22 +104,32 @@ public override async Task AddDatasetAsync(ChartData chartData, IChar 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, (BarChartOptions)chartOptions, plugins, ObjRef); - } + 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); } 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, (BarChartOptions)chartOptions, ObjRef); - } + 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 new file mode 100644 index 000000000..0e7f935a3 --- /dev/null +++ b/blazorbootstrap/Components/Charts/BarLineChartSupport.cs @@ -0,0 +1,66 @@ +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 index 58a1eaf68..c36574031 100644 --- a/blazorbootstrap/Components/Charts/BlazorBootstrapChart.cs +++ b/blazorbootstrap/Components/Charts/BlazorBootstrapChart.cs @@ -178,6 +178,8 @@ private object GetChartDataObject(ChartData chartData) 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) @@ -186,6 +188,10 @@ private object GetChartDataObject(ChartData chartData) 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 }; diff --git a/blazorbootstrap/Components/Charts/BubbleChart.razor b/blazorbootstrap/Components/Charts/BubbleChart.razor new file mode 100644 index 000000000..9aa25e1e2 --- /dev/null +++ b/blazorbootstrap/Components/Charts/BubbleChart.razor @@ -0,0 +1,6 @@ +@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 new file mode 100644 index 000000000..df328f40f --- /dev/null +++ b/blazorbootstrap/Components/Charts/BubbleChart.razor.cs @@ -0,0 +1,141 @@ +namespace BlazorBootstrap; + +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 + + 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; + } + + 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; + } + + 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; + } + + 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); + } + + 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/LineChart.razor.cs b/blazorbootstrap/Components/Charts/LineChart.razor.cs index 48378d852..5f763af0e 100644 --- a/blazorbootstrap/Components/Charts/LineChart.razor.cs +++ b/blazorbootstrap/Components/Charts/LineChart.razor.cs @@ -25,9 +25,7 @@ public override async Task AddDataAsync(ChartData chartData, string d throw new ArgumentNullException(nameof(data)); foreach (var dataset in chartData.Datasets) - if (dataset is LineChartDataset lineChartDataset && lineChartDataset.Label == dataLabel) - if (data is LineChartDatasetData lineChartDatasetData) - lineChartDataset.Data?.Add(lineChartDatasetData.Data as double?); + BarLineChartSupport.AppendDataPoint(dataset, data); await SafeInvokeVoidAsync("window.blazorChart.line.addDatasetData", Id, dataLabel, data); @@ -66,15 +64,14 @@ public override async Task AddDataAsync(ChartData chartData, string d chartData.Labels.Add(dataLabel); foreach (var dataset in chartData.Datasets) - if (dataset is LineChartDataset lineChartDataset) - { - var chartDatasetData = data.FirstOrDefault(x => x is LineChartDatasetData lineChartDatasetData && lineChartDatasetData.DatasetLabel == lineChartDataset.Label); + { + var chartDatasetData = data.FirstOrDefault(x => x is ChartDatasetData chartDataPoint && chartDataPoint.DatasetLabel == (dataset as dynamic).Label); - if (chartDatasetData is LineChartDatasetData lineChartDatasetData) - lineChartDataset.Data?.Add(lineChartDatasetData.Data as double?); - } + if (chartDatasetData is not null) + BarLineChartSupport.AppendDataPoint(dataset, chartDatasetData); + } - await SafeInvokeVoidAsync("window.blazorChart.line.addDatasetsData", Id, dataLabel, data?.Select(x => (LineChartDatasetData)x)); + await SafeInvokeVoidAsync("window.blazorChart.line.addDatasetsData", Id, dataLabel, data?.OfType()); return chartData; } @@ -90,10 +87,10 @@ public override async Task AddDatasetAsync(ChartData chartData, IChar if (chartDataset is null) throw new ArgumentNullException(nameof(chartDataset)); - if (chartDataset is LineChartDataset) + if (BarLineChartSupport.IsSupportedDataset(chartDataset)) { chartData.Datasets.Add(chartDataset); - await SafeInvokeVoidAsync("window.blazorChart.line.addDataset", Id, (LineChartDataset)chartDataset); + await SafeInvokeVoidAsync("window.blazorChart.line.addDataset", Id, chartDataset); } return chartData; @@ -110,8 +107,7 @@ public override async Task InitializeAsync(ChartData chartData, IChartOptions ch if (chartOptions is null) throw new ArgumentNullException(nameof(chartOptions)); - var datasets = chartData.Datasets.OfType(); - var data = new { chartData.Labels, Datasets = datasets }; + var data = new { chartData.Labels, Datasets = BarLineChartSupport.GetSupportedDatasets(chartData) }; await SafeInvokeVoidAsync("window.blazorChart.line.initialize", Id, GetChartType(), data, (LineChartOptions)chartOptions, plugins, ObjRef); } @@ -126,8 +122,7 @@ public override async Task UpdateAsync(ChartData chartData, IChartOptions chartO if (chartOptions is null) throw new ArgumentNullException(nameof(chartOptions)); - var datasets = chartData.Datasets.OfType(); - var data = new { chartData.Labels, Datasets = datasets }; + var data = new { chartData.Labels, Datasets = BarLineChartSupport.GetSupportedDatasets(chartData) }; await SafeInvokeVoidAsync("window.blazorChart.line.update", Id, GetChartType(), data, (LineChartOptions)chartOptions, ObjRef); } diff --git a/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDataset.cs index 441930f61..720b7544b 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDataset.cs @@ -8,6 +8,15 @@ /// public class BarChartDataset : ChartDataset { + #region Constructors + + public BarChartDataset() + { + Type = "bar"; + } + + #endregion + #region Properties, Indexers /// diff --git a/blazorbootstrap/Models/Charts/ChartDataset/BubbleChart/BubbleChartDataPoint.cs b/blazorbootstrap/Models/Charts/ChartDataset/BubbleChart/BubbleChartDataPoint.cs new file mode 100644 index 000000000..61c04ca45 --- /dev/null +++ b/blazorbootstrap/Models/Charts/ChartDataset/BubbleChart/BubbleChartDataPoint.cs @@ -0,0 +1,6 @@ +namespace BlazorBootstrap; + +/// +/// +/// +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 new file mode 100644 index 000000000..c29228929 --- /dev/null +++ b/blazorbootstrap/Models/Charts/ChartDataset/BubbleChart/BubbleChartDataset.cs @@ -0,0 +1,63 @@ +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. +/// . +/// +public class BubbleChartDataset : ChartDataset +{ + #region Constructors + + public BubbleChartDataset() + { + Type = "bubble"; + } + + #endregion + + #region Properties, Indexers + + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? BackgroundColor { get; set; } + + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? BorderColor { get; set; } + + public double BorderWidth { get; set; } = 3; + + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public BubbleChartDatasetDataLabels Datalabels { get; set; } = new(); + + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? DrawActiveElementsOnTop { get; set; } + + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? HoverBackgroundColor { get; set; } + + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? HoverBorderColor { get; set; } + + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? HoverBorderWidth { get; set; } + + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? HitRadius { get; set; } + + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? HoverRadius { get; set; } + + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? PointStyle { get; set; } + + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? Radius { get; set; } + + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? Rotation { get; set; } + + #endregion +} + +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 new file mode 100644 index 000000000..1c86596d9 --- /dev/null +++ b/blazorbootstrap/Models/Charts/ChartDataset/BubbleChart/BubbleChartDatasetData.cs @@ -0,0 +1,10 @@ +namespace BlazorBootstrap; + +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 index fb768abeb..67819bbd2 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/ChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/ChartDataset.cs @@ -18,6 +18,14 @@ public ChartDataset() #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. + /// . + /// + [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. @@ -68,8 +76,13 @@ public ChartDataset() /// public int Order { get; set; } - //Stack - //https://www.chartjs.org/docs/latest/general/data-structures.html#dataset-configuration + /// + /// 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. + /// . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? Stack { get; set; } /// /// Gets or sets the chart type. diff --git a/blazorbootstrap/Models/Charts/ChartDataset/LineChart/LineChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/LineChart/LineChartDataset.cs index 8c035851b..b5810f614 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/LineChart/LineChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/LineChart/LineChartDataset.cs @@ -7,6 +7,15 @@ /// public class LineChartDataset : ChartDataset { + #region Constructors + + public LineChartDataset() + { + Type = "line"; + } + + #endregion + #region Methods /// diff --git a/blazorbootstrap/Models/Charts/ChartOptions/BubbleChartOptions.cs b/blazorbootstrap/Models/Charts/ChartOptions/BubbleChartOptions.cs new file mode 100644 index 000000000..a3fb7d9f7 --- /dev/null +++ b/blazorbootstrap/Models/Charts/ChartOptions/BubbleChartOptions.cs @@ -0,0 +1,19 @@ +namespace BlazorBootstrap; + +public class BubbleChartOptions : ChartOptions +{ + #region Properties, Indexers + + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? IndexAxis { get; set; } + + public Interaction Interaction { get; set; } = new(); + + public ChartLayout Layout { get; set; } = new(); + + public BubbleChartPlugins Plugins { get; set; } = new(); + + public Scales Scales { get; set; } = new(); + + #endregion +} \ No newline at end of file diff --git a/blazorbootstrap/Models/Charts/ChartOptions/ChartOptions.cs b/blazorbootstrap/Models/Charts/ChartOptions/ChartOptions.cs index 686eebea3..0b7148fe3 100644 --- a/blazorbootstrap/Models/Charts/ChartOptions/ChartOptions.cs +++ b/blazorbootstrap/Models/Charts/ChartOptions/ChartOptions.cs @@ -9,8 +9,20 @@ public class ChartOptions : IChartOptions { #region Properties, Indexers - //aspectRatio - //https://www.chartjs.org/docs/latest/configuration/responsive.html#configuration-options + /// + /// 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. + /// . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public ChartAnimation? Animation { get; set; } + + /// + /// Canvas aspect ratio (i.e. width / height). + /// . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public double? AspectRatio { get; set; } /// /// Gets or sets the locale. @@ -31,8 +43,12 @@ public class ChartOptions : IChartOptions //onResize //https://www.chartjs.org/docs/latest/configuration/responsive.html#configuration-options - //resizeDelay - //https://www.chartjs.org/docs/latest/configuration/responsive.html#configuration-options + /// + /// Delay the resize update by the given amount of milliseconds. + /// . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public int? ResizeDelay { get; set; } /// /// Resizes the chart canvas when its container does. @@ -78,6 +94,7 @@ public class Interaction { #region Fields and Constants + private InteractionAxis? axis; private InteractionMode mode; #endregion @@ -105,18 +122,34 @@ private void SetMode(InteractionMode interactionMode) => _ => "" }; + private void SetAxis(InteractionAxis? interactionAxis) => + ChartInteractionAxis = interactionAxis switch + { + InteractionAxis.X => "x", + InteractionAxis.Y => "y", + InteractionAxis.XY => "xy", + InteractionAxis.R => "r", + _ => null + }; + #endregion #region Properties, Indexers - //axis - //https://www.chartjs.org/docs/latest/configuration/interactions.html#interactions + /// + /// Defines which directions are used in calculating distances. + /// Supported values are x, y, xy, and r. + /// . + /// + [JsonPropertyName("axis")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? ChartInteractionAxis { get; private set; } /// /// Sets which elements appear in the interaction. /// [JsonPropertyName("mode")] - public string ChartInteractionMode { get; private set; } + public string ChartInteractionMode { get; private set; } = string.Empty; /// /// if , the interaction mode only applies when the mouse position intersects an item on the chart. @@ -126,6 +159,27 @@ private void SetMode(InteractionMode interactionMode) => /// public bool Intersect { get; set; } = true; + /// + /// If , invisible points that are outside of the chart area are included when evaluating interactions. + /// . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public bool? IncludeInvisible { get; set; } + + /// + /// Defines which directions are used in calculating distances for interactions. + /// + [JsonIgnore] + public InteractionAxis? Axis + { + get => axis; + set + { + axis = value; + SetAxis(value); + } + } + /// /// Sets which elements appear in the tooltip. See Interaction Modes for details. /// @@ -141,9 +195,29 @@ public InteractionMode Mode } #endregion +} + +public enum InteractionAxis +{ + /// + /// Calculate interaction distances on the x-axis only. + /// + X, + + /// + /// Calculate interaction distances on the y-axis only. + /// + Y, + + /// + /// Calculate interaction distances on both x-axis and y-axis. + /// + XY, - //includeInvisible - //https://www.chartjs.org/docs/latest/configuration/interactions.html#interactions + /// + /// Calculate interaction distances on the radial axis. + /// + R } public enum InteractionMode @@ -649,3 +723,33 @@ public class ChartFont #endregion } + +/// +/// 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. +/// . +/// +public class ChartAnimation +{ + /// + /// Delay before starting the animations. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public double? Delay { get; set; } + + /// + /// The number of milliseconds an animation takes. + /// + public double Duration { get; set; } = 1000; + + /// + /// Easing function to use. + /// + public string Easing { get; set; } = "easeOutQuart"; + + /// + /// If , the animations loop endlessly. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public bool? Loop { get; set; } +} diff --git a/blazorbootstrap/Models/Charts/ChartPlugins/BubbleChartPlugins.cs b/blazorbootstrap/Models/Charts/ChartPlugins/BubbleChartPlugins.cs new file mode 100644 index 000000000..58c42b08c --- /dev/null +++ b/blazorbootstrap/Models/Charts/ChartPlugins/BubbleChartPlugins.cs @@ -0,0 +1,34 @@ +namespace BlazorBootstrap; + +public class BubbleChartPlugins : ChartPlugins +{ + #region Properties, Indexers + + public BubbleChartDataLabels Datalabels { get; set; } = new(); + + #endregion +} + +public class BubbleChartDataLabels +{ + #region Properties, Indexers + + public double BorderRadius { get; set; } = 4; + + public string? Color { get; set; } = "white"; + + public BubbleChartDataLabelsFont Font { get; set; } = new(); + + public double Padding { get; set; } = 6; + + #endregion +} + +public class BubbleChartDataLabelsFont +{ + #region Properties, Indexers + + public string? Weight { get; set; } = "bold"; + + #endregion +} \ No newline at end of file diff --git a/blazorbootstrap/wwwroot/blazor.bootstrap.js b/blazorbootstrap/wwwroot/blazor.bootstrap.js index 9794e33cf..31401f0fe 100644 --- a/blazorbootstrap/wwwroot/blazor.bootstrap.js +++ b/blazorbootstrap/wwwroot/blazor.bootstrap.js @@ -14,6 +14,10 @@ if (!window.blazorChart.bar) { window.blazorChart.bar = {}; } +if (!window.blazorChart.bubble) { + window.blazorChart.bubble = {}; +} + if (!window.blazorChart.doughnut) { window.blazorChart.doughnut = {}; } @@ -1243,7 +1247,7 @@ window.blazorChart = { get: (elementId) => { let chart; Chart.helpers.each(Chart.instances, function (instance) { - if (instance.canvas.id === elementId) { + if (instance && instance.canvas && instance.canvas.id === elementId) { chart = instance; } }); @@ -1376,7 +1380,7 @@ window.blazorChart.bar = { get: (elementId) => { let chart; Chart.helpers.each(Chart.instances, function (instance) { - if (instance.canvas.id === elementId) { + if (instance && instance.canvas && instance.canvas.id === elementId) { chart = instance; } }); @@ -1435,6 +1439,124 @@ window.blazorChart.bar = { } } +window.blazorChart.bubble = { + addDatasetData: (elementId, dataLabel, data) => { + let chart = window.blazorChart.get(elementId); + if (chart) { + const chartData = chart.data; + const chartDatasetData = data; + + if (!chartData.labels.includes(dataLabel)) + chartData.labels.push(dataLabel); + + const chartDatasets = chartData.datasets; + + if (chartDatasets.length > 0) { + let datasetIndex = chartDatasets.findIndex(dataset => dataset.label === chartDatasetData.datasetLabel); + if (datasetIndex > -1) { + chartDatasets[datasetIndex].data.push(chartDatasetData.data); + chart.update(); + } + } + } + }, + addDatasetsData: (elementId, dataLabel, data) => { + let chart = window.blazorChart.get(elementId); + if (chart && data) { + const chartData = chart.data; + + if (!chartData.labels.includes(dataLabel)) { + chartData.labels.push(dataLabel); + + if (chartData.datasets.length > 0 && chartData.datasets.length === data.length) { + data.forEach(chartDatasetData => { + let datasetIndex = chartData.datasets.findIndex(dataset => dataset.label === chartDatasetData.datasetLabel); + chartData.datasets[datasetIndex].data.push(chartDatasetData.data); + }); + chart.update(); + } + } + } + }, + addDataset: (elementId, newDataset) => { + let chart = window.blazorChart.get(elementId); + if (chart) { + chart.data.datasets.push(newDataset); + chart.update(); + } + }, + create: (elementId, type, data, options, plugins, dotNetHelper) => { + let chartEl = document.getElementById(elementId); + let _plugins = []; + + window.blazorChart.setOnClickHandler(options, dotNetHelper); + + if (plugins && plugins.length > 0) { + if (plugins.includes('ChartDataLabels')) { + _plugins.push(ChartDataLabels); + + options.plugins.datalabels.backgroundColor = function (context) { + return context.dataset.backgroundColor; + }; + } + } + + const config = { + type: type, + data: data, + options: options, + plugins: _plugins + }; + + const chart = new Chart( + chartEl, + config + ); + }, + get: (elementId) => { + let chart; + Chart.helpers.each(Chart.instances, function (instance) { + if (instance && instance.canvas && instance.canvas.id === elementId) { + chart = instance; + } + }); + + return chart; + }, + initialize: (elementId, type, data, options, plugins, dotNetHelper) => { + let chart = window.blazorChart.bubble.get(elementId); + if (chart) return; + else + window.blazorChart.bubble.create(elementId, type, data, options, plugins, dotNetHelper); + }, + resize: (elementId, width, height) => { + let chart = window.blazorChart.bubble.get(elementId); + if (chart) { + chart.canvas.parentNode.style.height = height; + chart.canvas.parentNode.style.width = width; + } + }, + update: (elementId, type, data, options, dotNetHelper) => { + let chart = window.blazorChart.bubble.get(elementId); + if (chart) { + if (chart.config.plugins && chart.config.plugins.findIndex(x => x.id == 'datalabels') > -1) { + options.plugins.datalabels.backgroundColor = function (context) { + return context.dataset.backgroundColor; + }; + } + + window.blazorChart.setOnClickHandler(options, dotNetHelper); + + chart.data = data; + chart.options = options; + chart.update(); + } + else { + console.warn(`The chart is not initialized. Initialize it and then call update.`); + } + } +} + window.blazorChart.doughnut = { addDatasetData: (elementId, dataLabel, data) => { let chart = window.blazorChart.get(elementId); @@ -1515,7 +1637,7 @@ window.blazorChart.doughnut = { get: (elementId) => { let chart; Chart.helpers.each(Chart.instances, function (instance) { - if (instance.canvas.id === elementId) { + if (instance && instance.canvas && instance.canvas.id === elementId) { chart = instance; } }); @@ -1686,7 +1808,7 @@ window.blazorChart.line = { get: (elementId) => { let chart; Chart.helpers.each(Chart.instances, function (instance) { - if (instance.canvas.id === elementId) { + if (instance && instance.canvas && instance.canvas.id === elementId) { chart = instance; } }); @@ -1826,7 +1948,7 @@ window.blazorChart.pie = { get: (elementId) => { let chart; Chart.helpers.each(Chart.instances, function (instance) { - if (instance.canvas.id === elementId) { + if (instance && instance.canvas && instance.canvas.id === elementId) { chart = instance; } }); @@ -1966,7 +2088,7 @@ window.blazorChart.polarArea = { get: (elementId) => { let chart; Chart.helpers.each(Chart.instances, function (instance) { - if (instance.canvas.id === elementId) { + if (instance && instance.canvas && instance.canvas.id === elementId) { chart = instance; } }); @@ -2105,7 +2227,7 @@ window.blazorChart.radar = { get: (elementId) => { let chart; Chart.helpers.each(Chart.instances, function (instance) { - if (instance.canvas.id === elementId) { + if (instance && instance.canvas && instance.canvas.id === elementId) { chart = instance; } }); @@ -2244,7 +2366,7 @@ window.blazorChart.scatter = { get: (elementId) => { let chart; Chart.helpers.each(Chart.instances, function (instance) { - if (instance.canvas.id === elementId) { + if (instance && instance.canvas && instance.canvas.id === elementId) { chart = instance; } }); diff --git a/docs/docs/01-getting-started/01-a-getting-started-webassembly-NET-8.mdx b/docs/docs/01-getting-started/01-a-getting-started-webassembly-NET-8.mdx index fb267111c..b510b18bf 100644 --- a/docs/docs/01-getting-started/01-a-getting-started-webassembly-NET-8.mdx +++ b/docs/docs/01-getting-started/01-a-getting-started-webassembly-NET-8.mdx @@ -38,7 +38,7 @@ Insert the following references into the **body** section of the **wwwroot/index ``` js showLineNumbers - + diff --git a/docs/docs/01-getting-started/01-b-getting-started-webapp-server-global-NET-8.mdx b/docs/docs/01-getting-started/01-b-getting-started-webapp-server-global-NET-8.mdx index 1506766f2..2ad1cbf66 100644 --- a/docs/docs/01-getting-started/01-b-getting-started-webapp-server-global-NET-8.mdx +++ b/docs/docs/01-getting-started/01-b-getting-started-webapp-server-global-NET-8.mdx @@ -38,7 +38,7 @@ Insert the following references into the **body** section of the **Components/Ap ``` js showLineNumbers - + diff --git a/docs/docs/01-getting-started/01-c-getting-started-webapp-auto-global-NET-8.mdx b/docs/docs/01-getting-started/01-c-getting-started-webapp-auto-global-NET-8.mdx index 32f9a8dc2..84cb6de3b 100644 --- a/docs/docs/01-getting-started/01-c-getting-started-webapp-auto-global-NET-8.mdx +++ b/docs/docs/01-getting-started/01-c-getting-started-webapp-auto-global-NET-8.mdx @@ -40,7 +40,7 @@ Insert the following references into the **body** section of the **Components/Ap ``` js showLineNumbers - + diff --git a/docs/docs/05-components/charts.mdx b/docs/docs/05-components/charts.mdx index b5d9b9eb2..21d04e48a 100644 --- a/docs/docs/05-components/charts.mdx +++ b/docs/docs/05-components/charts.mdx @@ -25,8 +25,9 @@ Blazor Bootstrap charts are well-designed chart components on top of Chart.js to ## Chart Types -At this moment we are supporting seven blazor chart types. +At this moment we are supporting eight blazor chart types. 1. Bar Chart +1. Bubble Chart 1. Doughnut Chart 1. Line Chart 1. Pie Chart @@ -35,7 +36,7 @@ At this moment we are supporting seven blazor chart types. 1. Scatter Chart :::info -We will add **Bubble Chart** and **Mixed Chart** support in the subsequent versions. +**Bubble Chart** is now available, and **Bar Chart** and **Line Chart** support mixed bar/line datasets. ::: ## Bar Chart @@ -54,6 +55,12 @@ We will add **Bubble Chart** and **Mixed Chart** support in the subsequent versi
See blazor doughnut chart full documentation here. +## Bubble Chart + +See blazor bubble chart demo here. +
+See blazor bubble chart full documentation here. + ## Line Chart Blazor Chart Component - Blazor Line Chart diff --git a/docs/docs/06-data-visualization/bar-chart.mdx b/docs/docs/06-data-visualization/bar-chart.mdx index 65a6873e5..763d62ed2 100644 --- a/docs/docs/06-data-visualization/bar-chart.mdx +++ b/docs/docs/06-data-visualization/bar-chart.mdx @@ -53,6 +53,7 @@ It is sometimes used to show trend data and to compare multiple data sets side b | Property Name | Type | Default | Required | Description | Added / Modified Version | |:--|:--|:--|:--|:--|:--| +| Animation | `ChartAnimation?` | null | | Configures dataset-level animation including delay, duration, easing, and looping. | 4.4.0 | | BackgroundColor | `List?` | null | | Get or sets the BackgroundColor. | 1.0.0 | | BarPercentage | double | 0.9 | | 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. | 1.0.0 | | BarThickness | `double?` | null | | It is applied to the width of each bar, in pixels. When this is enforced, barPercentage and categoryPercentage are ignored. | 3.0.0 | @@ -74,6 +75,7 @@ It is sometimes used to show trend data and to compare multiple data sets side b | MaxBarThickness | `double?` | null | Set this to ensure that bars are not sized thicker than this. | 3.0.0 | | MinBarLength | `double?` | null | Set this to ensure that bars have a minimum length in pixels. | 3.0.0 | | Order | int | 0 | | The drawing order of dataset. Also affects order for stacking, tooltip and legend. | 3.0.0 | +| Stack | `string?` | null | | The ID of the group to which this dataset belongs when stacked. Datasets with the same value are rendered in the same stack group. | 4.4.0 | | SkipNull | bool | false | If true, null or undefined values will not be used for spacing calculations when determining bar size. | 3.0.0 | | XAxisID | `string?` | null | | The ID of the x axis to plot this dataset on. | 1.0.0 | | YAxisID | `string?` | null | | The ID of the y axis to plot this dataset on. | 1.0.0 | @@ -98,15 +100,27 @@ It is sometimes used to show trend data and to compare multiple data sets side b | Property Name | Type | Default | Required | Description | Added / Modified Version | |:--|:--|:--|:--|:--|:--| +| Animation | `ChartAnimation?` | null | | Configures chart-level animation including delay, duration, easing, and looping. | 4.4.0 | +| AspectRatio | `double?` | null | | Sets the canvas aspect ratio (`width / height`) when responsive resizing is enabled. | 4.4.0 | | IndexAxis | string | x | | The base axis of the chart. 'x' for vertical charts and 'y' for horizontal charts. | 1.0.0 | | Interaction | `Interaction` | | | Gets or sets the Interaction. | 1.0.0 | | Layout | `ChartLayout` | | | Gets or sets the ChartLayout. | 1.0.0 | | Locale | `string?` | | | Gets or sets the locale. By default, the chart is using the default locale of the platform which is running on. | 1.10.0 | | MaintainAspectRatio | bool | true | | Maintain the original canvas aspect ratio (width / height) when resizing. | 3.0.0 | | Plugins | `BarChartPlugins` | | | Gets or sets the Plugins. | 1.10.2 | +| ResizeDelay | `int?` | null | | Delays the resize update by the given number of milliseconds. | 4.4.0 | | Responsive | bool | false | | Resizes the chart canvas when its container does. | 1.0.0 | | Scales | `Scales` | | | Gets or sets the Scales. | 1.0.0 | +## Interaction Members + +| Property Name | Type | Default | Required | Description | Added / Modified Version | +|:--|:--|:--|:--|:--|:--| +| Axis | `InteractionAxis?` | null | | Defines which directions are used in calculating distances. Supported values are `X`, `Y`, `XY`, and `R`. | 4.4.0 | +| IncludeInvisible | `bool?` | null | | Includes invisible points outside the chart area when evaluating interactions. | 4.4.0 | +| Intersect | bool | true | | If true, the interaction mode only applies when the mouse position intersects an item on the chart. | 1.0.0 | +| Mode | `InteractionMode` | `Nearest` | | Sets which elements appear in the interaction. | 1.0.0 | + ## Examples ### Prerequisites @@ -329,7 +343,7 @@ These palettes offer a range of distinct and visually appealing colors that can barChartOptions = new BarChartOptions(); barChartOptions.Responsive = true; - barChartOptions.Interaction = new Interaction { Mode = InteractionMode.Y }; + barChartOptions.Interaction = new Interaction { Mode = InteractionMode.Index, Axis = InteractionAxis.Y }; barChartOptions.IndexAxis = "y"; barChartOptions.Scales.X.Title.Text = "Visitors"; @@ -413,7 +427,7 @@ These palettes offer a range of distinct and visually appealing colors that can barChartOptions = new(); barChartOptions.Responsive = true; - barChartOptions.Interaction = new Interaction { Mode = InteractionMode.Y }; + barChartOptions.Interaction = new Interaction { Mode = InteractionMode.Index, Axis = InteractionAxis.Y }; barChartOptions.IndexAxis = "y"; barChartOptions.Scales.X.Title.Text = "Visitors"; @@ -442,6 +456,79 @@ These palettes offer a range of distinct and visually appealing colors that can [See the demo here.](https://demos.blazorbootstrap.com/charts/bar-chart#stacked-bar-chart) +### Grouped stacks + +Use the `Stack` property on each dataset when you want multiple stacked groups in the same chart. Datasets with the same stack ID are rendered together, while different IDs create separate stacked groups. + +```cs {} showLineNumbers +@code { + private BarChart barChart = default!; + private BarChartOptions barChartOptions = default!; + private ChartData chartData = default!; + + protected override void OnInitialized() + { + var colors = ColorBuilder.CategoricalTwelveColors; + + chartData = new ChartData + { + Labels = new List { "Q1", "Q2", "Q3", "Q4" }, + Datasets = new List + { + new BarChartDataset + { + Label = "North Budget", + Data = new List { 42, 47, 44, 50 }, + BackgroundColor = new List { colors[0] }, + BorderColor = new List { colors[0] }, + BorderWidth = new List { 0 }, + Stack = "North" + }, + new BarChartDataset + { + Label = "North Actual", + Data = new List { 39, 45, 48, 53 }, + BackgroundColor = new List { colors[1] }, + BorderColor = new List { colors[1] }, + BorderWidth = new List { 0 }, + Stack = "North" + }, + new BarChartDataset + { + Label = "South Budget", + Data = new List { 35, 38, 41, 46 }, + BackgroundColor = new List { colors[4] }, + BorderColor = new List { colors[4] }, + BorderWidth = new List { 0 }, + Stack = "South" + }, + new BarChartDataset + { + Label = "South Actual", + Data = new List { 33, 40, 43, 45 }, + BackgroundColor = new List { colors[5] }, + BorderColor = new List { colors[5] }, + BorderWidth = new List { 0 }, + Stack = "South" + } + } + }; + + barChartOptions = new() { Responsive = true, Interaction = new Interaction { Mode = InteractionMode.Index } }; + barChartOptions.Scales.X.Stacked = true; + barChartOptions.Scales.Y.Stacked = true; + } + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + await barChart.InitializeAsync(chartData, barChartOptions); + } +} +``` + +[See the demo here.](https://demos.blazorbootstrap.com/charts/bar-chart#grouped-stacks) + ### Locale By default, the chart is using the default locale of the platform on which it is running. @@ -505,7 +592,7 @@ In the following example, you will see the chart in the **German** locale (**de_ barChartOptions = new(); barChartOptions.Locale = "de-DE"; barChartOptions.Responsive = true; - barChartOptions.Interaction = new Interaction { Mode = InteractionMode.Y }; + barChartOptions.Interaction = new Interaction { Mode = InteractionMode.Index, Axis = InteractionAxis.Y }; barChartOptions.IndexAxis = "y"; barChartOptions.Scales.X.Title.Text = "Visitors"; @@ -593,7 +680,7 @@ In the following example, you will see the chart in the **German** locale (**de_ barChartOptions = new(); barChartOptions.Responsive = true; - barChartOptions.Interaction = new Interaction { Mode = InteractionMode.Y }; + barChartOptions.Interaction = new Interaction { Mode = InteractionMode.Index, Axis = InteractionAxis.Y }; barChartOptions.IndexAxis = "y"; barChartOptions.Scales.X.Title.Text = "Visitors"; diff --git a/docs/docs/06-data-visualization/bubble-chart.mdx b/docs/docs/06-data-visualization/bubble-chart.mdx new file mode 100644 index 000000000..d37f5d254 --- /dev/null +++ b/docs/docs/06-data-visualization/bubble-chart.mdx @@ -0,0 +1,101 @@ +--- +title: Blazor Bubble Chart Component +description: A Blazor Bootstrap bubble chart component 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 size of each bubble represents a third value. +image: https://i.imgur.com/JLV7oss.png + +sidebar_label: Bubble Chart +sidebar_position: 2 +--- + +import CarbonAd from '/carbon-ad.mdx' + +# Blazor Bubble Chart + +A Blazor Bootstrap bubble chart component is used to visualize three dimensions of data at the same time. Each data point is represented by a bubble where the `X` and `Y` coordinates determine the position and `R` controls the bubble size. + + + +## Demo and Documentation + +See blazor bubble chart demo here. +
+See blazor bubble chart API documentation here. + +## Basic Example + +```razor showLineNumbers + + +@code { + private BubbleChart bubbleChart = default!; + private BubbleChartOptions bubbleChartOptions = new() { Responsive = true }; + private ChartData chartData = new() + { + Labels = new List { "January", "February", "March" }, + Datasets = new List + { + new BubbleChartDataset + { + Label = "Product 1", + Data = new List + { + new(10, 20, 8), + new(14, 11, 6), + new(18, 24, 10) + }, + BackgroundColor = new List { "rgba(13, 110, 253, 0.6)" }, + BorderColor = new List { "rgb(13, 110, 253)" } + } + } + }; + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + await bubbleChart.InitializeAsync(chartData, bubbleChartOptions); + } +} +``` + +## Key Types + +- `BubbleChart` renders the Chart.js bubble chart canvas. +- `BubbleChartOptions` configures responsiveness, interaction, scales, layout, and plugins. +- `BubbleChartDataset` contains the dataset styling and the `List` values. +- `BubbleChartDataPoint` is the core data shape and contains `X`, `Y`, and `R` values. +- `BubbleChartDatasetData` supports dynamic `AddDataAsync` updates. + +## Interaction Options + +Bubble charts use the shared `Interaction` model, so you can control hover and tooltip behavior with the same properties used by the other cartesian charts. + +```razor showLineNumbers +@code { + private BubbleChartOptions bubbleChartOptions = new() + { + Responsive = true, + Interaction = new Interaction + { + Mode = InteractionMode.Index, + Axis = InteractionAxis.XY, + IncludeInvisible = false + } + }; +} +``` + +## Dynamic Updates + +Use the same methods available on the other chart components: + +- `AddDatasetAsync` to append a dataset. +- `AddDataAsync` to append a new bubble to existing datasets. +- `UpdateAsync` to replace chart data or options. +- `ResizeAsync` to resize the chart container. + +## Related Pages + +- [Charts Overview](/components/charts) +- [Scatter Chart](/data-visualization/scatter-chart) +- [Bar Chart](/data-visualization/bar-chart) +- [Line Chart](/data-visualization/line-chart) \ No newline at end of file diff --git a/docs/docs/06-data-visualization/line-chart.mdx b/docs/docs/06-data-visualization/line-chart.mdx index 6cc5e71e6..529d8cdc9 100644 --- a/docs/docs/06-data-visualization/line-chart.mdx +++ b/docs/docs/06-data-visualization/line-chart.mdx @@ -53,6 +53,7 @@ A Blazor Bootstrap line chart component is a graphical representation of data th | Property Name | Type | Default | Required | Description | Added / Modified Version | |:--|:--|:--|:--|:--|:--| +| Animation | `ChartAnimation?` | null | | Configures dataset-level animation including delay, duration, easing, and looping. | 4.4.0 | | BackgroundColor | `string` | `rgba(0, 0, 0, 0.1)` | | Get or sets the line fill color. | 3.0.0 | | BorderCapStyle | `string` | `butt` | | Cap style of the line. Supported values are 'butt', 'round', and 'square'. | 3.0.0 | | BorderColor | `string` | `rgba(0, 0, 0, 0.1)` | | Get or sets the line color. | 3.0.0 | @@ -77,6 +78,7 @@ A Blazor Bootstrap line chart component is a graphical representation of data th | IndexAxis | `string?` | null | | The base axis of the dataset. 'x' for horizontal lines and 'y' for vertical lines. | 3.0.0 | | Label | `string?` | null | | The label for the dataset which appears in the legend and tooltips. | 1.0.0 | | Order | int | 0 | | The drawing order of dataset. Also affects order for stacking, tooltip and legend. | 3.0.0 | +| Stack | `string?` | null | | The ID of the group to which this dataset belongs when stacked. Datasets with the same value are rendered in the same stack group. | 4.4.0 | | PointBackgroundColor | `List?` | null | | The fill color for points. | 1.0.0 | | PointBorderColor | `List?` | null | | The border color for points. | 1.0.0 | | PointBorderWidth | `List?` | null | | The width of the point border in pixels. | 1.0.0 | @@ -115,15 +117,27 @@ A Blazor Bootstrap line chart component is a graphical representation of data th | Property Name | Type | Default | Required | Description | Added / Modified Version | |:--|:--|:--|:--|:--|:--| +| Animation | `ChartAnimation?` | null | | Configures chart-level animation including delay, duration, easing, and looping. | 4.4.0 | +| AspectRatio | `double?` | null | | Sets the canvas aspect ratio (`width / height`) when responsive resizing is enabled. | 4.4.0 | | IndexAxis | `string?` | null | | The base axis of the chart. 'x' for vertical charts and 'y' for horizontal charts. | 3.0.0 | | Interaction | `Interaction` | | | Gets or sets the Interaction. | 1.0.0 | | Layout | `ChartLayout` | | | Gets or sets the ChartLayout. | 1.0.0 | | Locale | `string?` | | | Gets or sets the locale. By default, the chart is using the default locale of the platform which is running on. | 1.10.0 | | MaintainAspectRatio | bool | true | | Maintain the original canvas aspect ratio (width / height) when resizing. | 3.0.0 | | Plugins | `LineChartPlugins` | | | Gets or sets the Plugins. | 1.10.2 | +| ResizeDelay | `int?` | null | | Delays the resize update by the given number of milliseconds. | 4.4.0 | | Responsive | bool | false | | Resizes the chart canvas when its container does. | 1.0.0 | | Scales | `Scales` | | | Gets or sets the Scales. | 1.0.0 | +## Interaction Members + +| Property Name | Type | Default | Required | Description | Added / Modified Version | +|:--|:--|:--|:--|:--|:--| +| Axis | `InteractionAxis?` | null | | Defines which directions are used in calculating distances. Supported values are `X`, `Y`, `XY`, and `R`. | 4.4.0 | +| IncludeInvisible | `bool?` | null | | Includes invisible points outside the chart area when evaluating interactions. | 4.4.0 | +| Intersect | bool | true | | If true, the interaction mode only applies when the mouse position intersects an item on the chart. | 1.0.0 | +| Mode | `InteractionMode` | `Nearest` | | Sets which elements appear in the interaction. | 1.0.0 | + ## Examples ### Prerequisites diff --git a/docs/docs/06-data-visualization/scatter-chart.mdx b/docs/docs/06-data-visualization/scatter-chart.mdx index e8953db7d..5bf80a213 100644 --- a/docs/docs/06-data-visualization/scatter-chart.mdx +++ b/docs/docs/06-data-visualization/scatter-chart.mdx @@ -121,15 +121,27 @@ A Blazor Bootstrap scatter chart components are based on basic line charts with | Property Name | Type | Default | Required | Description | Added Version | |:--|:--|:--|:--|:--|:--| +| Animation | `ChartAnimation?` | null | | Configures chart-level animation including delay, duration, easing, and looping. | 4.4.0 | +| AspectRatio | `double?` | null | | Sets the canvas aspect ratio (`width / height`) when responsive resizing is enabled. | 4.4.0 | | IndexAxis | `string?` | null | | The base axis of the chart. 'x' for vertical charts and 'y' for horizontal charts. | 3.0.0 | | Interaction | `Interaction` | | | Gets or sets the Interaction. | 3.0.0 | | Layout | `ChartLayout` | | | Gets or sets the ChartLayout. | 3.0.0 | | Locale | `string?` | | | Gets or sets the locale. By default, the chart is using the default locale of the platform which is running on. | 3.0.0 | | MaintainAspectRatio | bool | true | | Maintain the original canvas aspect ratio (width / height) when resizing. | 3.0.0 | | Plugins | `ScatterChartPlugins` | | | Gets or sets the Plugins. | 3.0.0 | +| ResizeDelay | `int?` | null | | Delays the resize update by the given number of milliseconds. | 4.4.0 | | Responsive | bool | false | | Gets or sets the Responsive. | 3.0.0 | | Scales | `Scales` | | | Gets or sets the Scales. | 3.0.0 | +## Interaction Members + +| Property Name | Type | Default | Required | Description | Added Version | +|:--|:--|:--|:--|:--|:--| +| Axis | `InteractionAxis?` | null | | Defines which directions are used in calculating distances. Supported values are `X`, `Y`, `XY`, and `R`. | 4.4.0 | +| IncludeInvisible | `bool?` | null | | Includes invisible points outside the chart area when evaluating interactions. | 4.4.0 | +| Intersect | bool | true | | If true, the interaction mode only applies when the mouse position intersects an item on the chart. | 3.0.0 | +| Mode | `InteractionMode` | `Nearest` | | Sets which elements appear in the interaction. | 3.0.0 | + ## Examples ### Prerequisites From 2dd7445c2681a1763a26b20965f31f2222c9debf Mon Sep 17 00:00:00 2001 From: gvreddy04 Date: Thu, 14 May 2026 00:57:02 +0530 Subject: [PATCH 2/5] feat: Enhance chart documentation with new features and examples --- .../BarCharts/BarChartDocumentation.razor | 18 ++++ .../BarChart_Demo_09_Border_Radius.razor | 94 +++++++++++++++++++ .../BarChart_Demo_10_Animation_Delay.razor | 64 +++++++++++++ .../BarChart_Demo_11_Combo_Bar_Line.razor | 52 ++++++++++ .../LineCharts/LineChartDocumentation.razor | 14 +++ ...ineChart_Demo_08_Interpolation_Modes.razor | 72 ++++++++++++++ .../LineChart_Demo_09_Combo_Bar_Line.razor | 54 +++++++++++ 7 files changed, 368 insertions(+) create mode 100644 BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_09_Border_Radius.razor create mode 100644 BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_10_Animation_Delay.razor create mode 100644 BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_11_Combo_Bar_Line.razor create mode 100644 BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/LineCharts/LineChart_Demo_08_Interpolation_Modes.razor create mode 100644 BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/LineCharts/LineChart_Demo_09_Combo_Bar_Line.razor diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChartDocumentation.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChartDocumentation.razor index a4809dd71..746f4c0ec 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChartDocumentation.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChartDocumentation.razor @@ -37,6 +37,12 @@ +
+
+ Use BorderRadius on each dataset to soften bar edges and create rounded columns. +
+ +
By default, the chart is using the default locale of the platform on which it is running. @@ -47,12 +53,24 @@
+
+
+ Configure chart-level animation timing through ChartOptions.Animation to delay or pace the initial render. +
+ +
You can configure animations globally on the chart options or per dataset to stagger how each series enters the chart.
+
+
+ Mix BarChartDataset and LineChartDataset in the same chart to combine columns with a trend line. +
+ +
diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_09_Border_Radius.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_09_Border_Radius.razor new file mode 100644 index 000000000..da17a4d78 --- /dev/null +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_09_Border_Radius.razor @@ -0,0 +1,94 @@ + + +
+ +
+ +@code { + private BarChart barChart = default!; + private BarChartOptions barChartOptions = default!; + private ChartData chartData = default!; + + private int datasetsCount; + private int labelsCount; + private readonly string[] months = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; + private readonly Random random = new(); + + protected override void OnInitialized() + { + chartData = new ChartData { Labels = GetDefaultDataLabels(6), Datasets = GetDefaultDataSets(3) }; + barChartOptions = new BarChartOptions { Responsive = true, Interaction = new Interaction { Mode = InteractionMode.Index } }; + } + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + await barChart.InitializeAsync(chartData, barChartOptions); + + await base.OnAfterRenderAsync(firstRender); + } + + private async Task RandomizeAsync() + { + if (chartData.Datasets is null || !chartData.Datasets.Any()) + return; + + foreach (var dataset in chartData.Datasets.OfType()) + dataset.Data = Enumerable.Range(0, dataset.Data?.Count ?? 0) + .Select(_ => (double?)random.Next(-100, 100)) + .ToList(); + + await barChart.UpdateAsync(chartData, barChartOptions); + } + + private List GetDefaultDataSets(int numberOfDatasets) + { + var datasets = new List(); + + for (var index = 0; index < numberOfDatasets; index++) + datasets.Add(GetRandomBarChartDataset()); + + return datasets; + } + + private BarChartDataset GetRandomBarChartDataset() + { + var color = ColorUtility.CategoricalTwelveColors[datasetsCount].ToColor(); + + datasetsCount += 1; + + return new BarChartDataset + { + Label = $"Product {datasetsCount}", + Data = GetRandomData(), + BackgroundColor = new List { color.ToRgbaString(0.5) }, + BorderColor = new List { color.ToRgbString() }, + BorderWidth = new List { 2 }, + BorderRadius = new List { 10 } + }; + } + + private List GetRandomData() + { + var data = new List(); + for (var index = 0; index < labelsCount; index++) + data.Add(random.Next(-100, 100)); + + return data; + } + + private List GetDefaultDataLabels(int numberOfLabels) + { + var labels = new List(); + for (var index = 0; index < numberOfLabels; index++) + labels.Add(GetNextDataLabel()); + + return labels; + } + + private string GetNextDataLabel() + { + labelsCount += 1; + return months[labelsCount - 1]; + } +} \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_10_Animation_Delay.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_10_Animation_Delay.razor new file mode 100644 index 000000000..7f38635cf --- /dev/null +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_10_Animation_Delay.razor @@ -0,0 +1,64 @@ + + +@code { + private BarChart barChart = default!; + private BarChartOptions barChartOptions = default!; + private ChartData chartData = default!; + + protected override void OnInitialized() + { + var colors = ColorUtility.CategoricalTwelveColors; + + chartData = new ChartData + { + Labels = new List { "Chrome", "Firefox", "Safari", "Edge" }, + Datasets = new List + { + new BarChartDataset + { + Label = "Windows", + Data = new List { 28000, 8000, 2000, 17000 }, + BackgroundColor = new List { colors[3] }, + BorderColor = new List { colors[3] }, + BorderWidth = new List { 0 } + }, + new BarChartDataset + { + Label = "macOS", + Data = new List { 8000, 10000, 14000, 8000 }, + BackgroundColor = new List { colors[4] }, + BorderColor = new List { colors[4] }, + BorderWidth = new List { 0 } + }, + new BarChartDataset + { + Label = "Other", + Data = new List { 28000, 10000, 14000, 8000 }, + BackgroundColor = new List { colors[5] }, + BorderColor = new List { colors[5] }, + BorderWidth = new List { 0 } + } + } + }; + + barChartOptions = new(); + barChartOptions.Responsive = true; + barChartOptions.Interaction = new Interaction { Mode = InteractionMode.Index, Axis = InteractionAxis.Y }; + barChartOptions.IndexAxis = "y"; + barChartOptions.Scales.X!.Title = new ChartAxesTitle { Text = "Visitors", Display = true }; + barChartOptions.Scales.Y!.Title = new ChartAxesTitle { Text = "Browser", Display = true }; + barChartOptions.Scales.X.Stacked = true; + barChartOptions.Scales.Y.Stacked = true; + barChartOptions.Plugins.Title!.Text = "Operating system"; + barChartOptions.Plugins.Title.Display = true; + barChartOptions.Animation = new ChartAnimation { Duration = 1000, Delay = 1500 }; + } + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + await barChart.InitializeAsync(chartData, barChartOptions); + + await base.OnAfterRenderAsync(firstRender); + } +} \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_11_Combo_Bar_Line.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_11_Combo_Bar_Line.razor new file mode 100644 index 000000000..b7670e9d6 --- /dev/null +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/BarCharts/BarChart_Demo_11_Combo_Bar_Line.razor @@ -0,0 +1,52 @@ + + +@code { + private BarChart barChart = default!; + private BarChartOptions barChartOptions = default!; + private ChartData chartData = default!; + + protected override void OnInitialized() + { + var revenueColor = ColorUtility.CategoricalTwelveColors[0].ToColor(); + var targetColor = ColorUtility.CategoricalTwelveColors[1].ToColor(); + + chartData = new ChartData + { + Labels = new List { "January", "February", "March", "April", "May", "June" }, + Datasets = new List + { + new BarChartDataset + { + Label = "Revenue", + Data = new List { 65, 59, 80, 81, 56, 55 }, + BackgroundColor = new List { revenueColor.ToRgbaString() }, + BorderColor = new List { revenueColor.ToRgbString() }, + BorderWidth = new List { 0 } + }, + new LineChartDataset + { + Label = "Target", + Data = new List { 50, 55, 60, 70, 72, 78 }, + BackgroundColor = targetColor.ToRgbaString(), + BorderColor = targetColor.ToRgbString(), + PointRadius = new List { 4 }, + PointHoverRadius = new List { 6 } + } + } + }; + + barChartOptions = new BarChartOptions + { + Responsive = true, + Interaction = new Interaction { Mode = InteractionMode.Index, Intersect = false } + }; + } + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + await barChart.InitializeAsync(chartData, barChartOptions); + + await base.OnAfterRenderAsync(firstRender); + } +} \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/LineCharts/LineChartDocumentation.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/LineCharts/LineChartDocumentation.razor index f62dfbc3b..1f8820631 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/LineCharts/LineChartDocumentation.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/LineCharts/LineChartDocumentation.razor @@ -49,10 +49,24 @@
+
+
+ Compare monotone cubic interpolation, regular cubic interpolation, and the default linear rendering to control how line segments are smoothed. +
+ +
+
+
+
+ Combine LineChartDataset and BarChartDataset in a single line chart to compare forecast and actual values. +
+ +
+
diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/LineCharts/LineChart_Demo_08_Interpolation_Modes.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/LineCharts/LineChart_Demo_08_Interpolation_Modes.razor new file mode 100644 index 000000000..1d0dccd56 --- /dev/null +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/LineCharts/LineChart_Demo_08_Interpolation_Modes.razor @@ -0,0 +1,72 @@ +
+ +
+ +@code { + private LineChart lineChart = default!; + private LineChartOptions lineChartOptions = default!; + private ChartData chartData = default!; + + private readonly int dataCount = 13; + private readonly List dataPoints = new() { 0, 20, 20, 60, 60, 120, null, 180, 120, 125, 105, 110, 170 }; + + protected override void OnInitialized() + { + chartData = new ChartData { Labels = GetDefaultDataLabels(), Datasets = GetDefaultDataSets() }; + lineChartOptions = new LineChartOptions + { + IndexAxis = "x", + Interaction = new Interaction { Mode = InteractionMode.Index, Intersect = false }, + Responsive = true + }; + } + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + await lineChart.InitializeAsync(chartData, lineChartOptions); + + await base.OnAfterRenderAsync(firstRender); + } + + private List GetDefaultDataLabels() + { + var labels = new List(); + + for (var index = 0; index < dataCount; index++) + labels.Add(index.ToString()); + + return labels; + } + + private List GetDefaultDataSets() + { + return new List + { + new LineChartDataset + { + Label = "Cubic interpolation (monotone)", + Data = dataPoints, + BorderColor = ColorUtility.CategoricalSixColors[0].ToColor().ToRgbString(), + CubicInterpolationMode = "monotone", + Fill = false, + Tension = 0.4 + }, + new LineChartDataset + { + Label = "Cubic interpolation", + Data = dataPoints, + BorderColor = ColorUtility.CategoricalSixColors[1].ToColor().ToRgbString(), + Fill = false, + Tension = 0.4 + }, + new LineChartDataset + { + Label = "Linear interpolation (default)", + Data = dataPoints, + BorderColor = ColorUtility.CategoricalSixColors[2].ToColor().ToRgbString(), + Fill = false + } + }; + } +} \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/LineCharts/LineChart_Demo_09_Combo_Bar_Line.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/LineCharts/LineChart_Demo_09_Combo_Bar_Line.razor new file mode 100644 index 000000000..fdd65ae79 --- /dev/null +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Demos/Charts/LineCharts/LineChart_Demo_09_Combo_Bar_Line.razor @@ -0,0 +1,54 @@ +
+ +
+ +@code { + private LineChart lineChart = default!; + private LineChartOptions lineChartOptions = default!; + private ChartData chartData = default!; + + protected override void OnInitialized() + { + var forecastColor = ColorUtility.CategoricalTwelveColors[2].ToColor(); + var actualColor = ColorUtility.CategoricalTwelveColors[3].ToColor(); + + chartData = new ChartData + { + Labels = new List { "January", "February", "March", "April", "May", "June" }, + Datasets = new List + { + new LineChartDataset + { + Label = "Forecast", + Data = new List { 45, 52, 61, 66, 73, 79 }, + BackgroundColor = forecastColor.ToRgbaString(), + BorderColor = forecastColor.ToRgbString(), + PointRadius = new List { 4 }, + PointHoverRadius = new List { 6 } + }, + new BarChartDataset + { + Label = "Actual", + Data = new List { 41, 49, 58, 70, 75, 82 }, + BackgroundColor = new List { actualColor.ToRgbaString() }, + BorderColor = new List { actualColor.ToRgbString() }, + BorderWidth = new List { 0 } + } + } + }; + + lineChartOptions = new LineChartOptions + { + Responsive = true, + Interaction = new Interaction { Mode = InteractionMode.Index, Intersect = false } + }; + } + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + await lineChart.InitializeAsync(chartData, lineChartOptions); + + await base.OnAfterRenderAsync(firstRender); + } +} \ No newline at end of file From b4b0c5585c93d91e60cf835fcdeceea2e0087c4b Mon Sep 17 00:00:00 2001 From: gvreddy04 Date: Thu, 14 May 2026 01:46:58 +0530 Subject: [PATCH 3/5] feat: Add versioning and new properties to chart datasets and options - Added [AddedVersion] attributes to various properties in LineChartDataset, PieChartDataset, PolarAreaChartDataset, RadarChartDataset, ScatterChartDataset, and their respective data labels classes to indicate version changes. - Introduced new properties in chart options classes such as BarChartOptions, BubbleChartOptions, DoughnutChartOptions, LineChartOptions, PieChartOptions, PolarAreaChartOptions, RadarChartOptions, and ScatterChartOptions, along with version annotations. - Updated documentation for bar, line, and scatter charts to reflect the correct version numbers for properties related to animations, axes, and interactions. --- .../BarChart_Doc_01_Documentation.razor | 10 +++- .../BubbleChart_Doc_01_Documentation.razor | 4 +- .../DoughnutChart_Doc_01_Documentation.razor | 4 +- .../LineChart_Doc_01_Documentation.razor | 10 +++- .../PieChart_Doc_01_Documentation.razor | 10 +++- .../PolarAreaChart_Doc_01_Documentation.razor | 4 +- .../RadarChart_Doc_01_Documentation.razor | 4 +- .../ScatterChart_Doc_01_Documentation.razor | 4 +- .../Shared/DocxTable/DocxMethodRow.razor.cs | 5 +- .../Shared/DocxTable/DocxPropertyRow.razor.cs | 8 ++- .../Shared/DocxTable/DocxTable.razor | 16 ++++-- .../Extensions/MethodInfoExtensions.cs | 33 +++++++++++ .../Extensions/PropertyInfoExtenstions.cs | 42 ++++++++++++++ .../Extensions/TypeExtensions.cs | 5 +- .../Components/Charts/BarChart.razor.cs | 11 ++++ .../Components/Charts/BlazorBootstrapChart.cs | 57 +++++++++++++++---- .../Components/Charts/BubbleChart.razor.cs | 11 ++++ .../Components/Charts/DoughnutChart.razor.cs | 11 ++++ .../Components/Charts/LineChart.razor.cs | 11 ++++ .../Components/Charts/PieChart.razor.cs | 11 ++++ .../Components/Charts/PolarAreaChart.razor.cs | 11 ++++ .../Components/Charts/RadarChart.razor.cs | 11 ++++ .../Components/Charts/ScatterChart.razor.cs | 11 ++++ blazorbootstrap/Models/Charts/ChartData.cs | 8 +++ .../ChartDataset/BarChart/BarChartDataset.cs | 10 ++++ .../BubbleChart/BubbleChartDataset.cs | 15 +++++ .../BubbleChart/BubbleChartDatasetData.cs | 1 + .../Charts/ChartDataset/ChartDataset.cs | 7 +++ .../ChartDataset/ChartDatasetDataLabels.cs | 6 ++ .../DoughnutChart/DoughnutChartDataset.cs | 17 ++++++ .../LineChart/LineChartDataset.cs | 18 ++++++ .../ChartDataset/PieChart/PieChartDataset.cs | 16 ++++++ .../PolarAreaChart/PolarAreaChartDataset.cs | 2 + .../RadarChart/RadarChartDataset.cs | 2 + .../ScatterChart/ScatterChartDataset.cs | 2 + .../Charts/ChartOptions/BarChartOptions.cs | 3 + .../Charts/ChartOptions/BubbleChartOptions.cs | 6 ++ .../Charts/ChartOptions/ChartOptions.cs | 16 ++++++ .../ChartOptions/DoughnutChartOptions.cs | 2 + .../Charts/ChartOptions/LineChartOptions.cs | 3 + .../Charts/ChartOptions/PieChartOptions.cs | 2 + .../ChartOptions/PolarAreaChartOptions.cs | 2 + .../Charts/ChartOptions/RadarChartOptions.cs | 1 + .../ChartOptions/ScatterChartOptions.cs | 1 + docs/docs/06-data-visualization/bar-chart.mdx | 14 ++--- .../docs/06-data-visualization/line-chart.mdx | 14 ++--- .../06-data-visualization/scatter-chart.mdx | 10 ++-- 47 files changed, 426 insertions(+), 56 deletions(-) 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 3f92b816e..f5534bc98 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 @@ -31,11 +31,11 @@
- +
- +
@@ -47,7 +47,7 @@
- +
@code { @@ -58,4 +58,8 @@ 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_BarChart; + private static readonly IReadOnlyDictionary barChartDatasetAddedVersionOverrides = new Dictionary + { + ["Data"] = "3.0.0" + }; } \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/BubbleCharts/BubbleChart_Doc_01_Documentation.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/BubbleCharts/BubbleChart_Doc_01_Documentation.razor index f2fcaa26c..d2d7c20c5 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/BubbleCharts/BubbleChart_Doc_01_Documentation.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/BubbleCharts/BubbleChart_Doc_01_Documentation.razor @@ -27,7 +27,7 @@
- +
@@ -47,7 +47,7 @@
- +
@code { 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 0768d373e..27debe28b 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 @@ -31,7 +31,7 @@
- +
@@ -47,7 +47,7 @@
- +
@code { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/LineCharts/LineChart_Doc_01_Documentation.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/LineCharts/LineChart_Doc_01_Documentation.razor index b5325d5c5..1b4fa5ed5 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/LineCharts/LineChart_Doc_01_Documentation.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/LineCharts/LineChart_Doc_01_Documentation.razor @@ -31,11 +31,11 @@
- +
- +
@@ -47,7 +47,7 @@
- +
@code { @@ -58,4 +58,8 @@ 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_LineChart; + private static readonly IReadOnlyDictionary lineChartDatasetAddedVersionOverrides = new Dictionary + { + ["Data"] = "3.0.0" + }; } \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/PieCharts/PieChart_Doc_01_Documentation.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/PieCharts/PieChart_Doc_01_Documentation.razor index e40ca8355..ad79234d7 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/PieCharts/PieChart_Doc_01_Documentation.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/PieCharts/PieChart_Doc_01_Documentation.razor @@ -31,11 +31,11 @@
- +
- +
@@ -47,7 +47,7 @@
- +
@code { @@ -58,4 +58,8 @@ 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_PieChart; + private static readonly IReadOnlyDictionary pieChartDatasetAddedVersionOverrides = new Dictionary + { + ["Label"] = "3.0.0" + }; } \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/PolarAreaCharts/PolarAreaChart_Doc_01_Documentation.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/PolarAreaCharts/PolarAreaChart_Doc_01_Documentation.razor index 1f4c4ec3b..3def6ace1 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/PolarAreaCharts/PolarAreaChart_Doc_01_Documentation.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/PolarAreaCharts/PolarAreaChart_Doc_01_Documentation.razor @@ -31,7 +31,7 @@
- +
@@ -47,7 +47,7 @@
- +
@code { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/RadarCharts/RadarChart_Doc_01_Documentation.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/RadarCharts/RadarChart_Doc_01_Documentation.razor index 329aafb5d..ffc5e9185 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/RadarCharts/RadarChart_Doc_01_Documentation.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/RadarCharts/RadarChart_Doc_01_Documentation.razor @@ -31,7 +31,7 @@
- +
@@ -47,7 +47,7 @@
- +
@code { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/ScatterCharts/ScatterChart_Doc_01_Documentation.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/ScatterCharts/ScatterChart_Doc_01_Documentation.razor index 691e83df2..ca7bc5e6d 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/ScatterCharts/ScatterChart_Doc_01_Documentation.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Charts/ScatterCharts/ScatterChart_Doc_01_Documentation.razor @@ -31,7 +31,7 @@
- +
@@ -47,7 +47,7 @@
- +
@code { diff --git a/BlazorBootstrap.Demo.RCL/Components/Shared/DocxTable/DocxMethodRow.razor.cs b/BlazorBootstrap.Demo.RCL/Components/Shared/DocxTable/DocxMethodRow.razor.cs index cde6a0a9a..e344d1ceb 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Shared/DocxTable/DocxMethodRow.razor.cs +++ b/BlazorBootstrap.Demo.RCL/Components/Shared/DocxTable/DocxMethodRow.razor.cs @@ -5,7 +5,7 @@ ///
public partial class DocxMethodRow : BlazorBootstrapComponentBase { - private string AddedVersion => MethodInfo.GetMethodAddedVersion(); + private string AddedVersion => MethodInfo.GetMethodAddedVersion(VersionContextType ?? typeof(TItem)); private string Description => MethodInfo.GetMethodDescription(); @@ -15,4 +15,7 @@ public partial class DocxMethodRow : BlazorBootstrapComponentBase [Parameter] public MethodInfo MethodInfo { get; set; } = default!; + + [Parameter] + public Type? VersionContextType { get; set; } } diff --git a/BlazorBootstrap.Demo.RCL/Components/Shared/DocxTable/DocxPropertyRow.razor.cs b/BlazorBootstrap.Demo.RCL/Components/Shared/DocxTable/DocxPropertyRow.razor.cs index d01c13b18..508786a0c 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Shared/DocxTable/DocxPropertyRow.razor.cs +++ b/BlazorBootstrap.Demo.RCL/Components/Shared/DocxTable/DocxPropertyRow.razor.cs @@ -11,10 +11,16 @@ public partial class DocxPropertyRow : BlazorBootstrapComponentBase private bool IsRequired => PropertyInfo.IsPropertyRequired(); - private string AddedVersion => PropertyInfo.GetPropertyAddedVersion(); + private string AddedVersion => PropertyInfo.GetPropertyAddedVersion(VersionContextType ?? typeof(TItem), AddedVersionOverrides); private string Description => PropertyInfo.GetPropertyDescription(); [Parameter] public PropertyInfo PropertyInfo { get; set; } = default!; + + [Parameter] + public IReadOnlyDictionary? AddedVersionOverrides { get; set; } + + [Parameter] + public Type? VersionContextType { get; set; } } diff --git a/BlazorBootstrap.Demo.RCL/Components/Shared/DocxTable/DocxTable.razor b/BlazorBootstrap.Demo.RCL/Components/Shared/DocxTable/DocxTable.razor index 4077c43c0..4a2a0f45b 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Shared/DocxTable/DocxTable.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Shared/DocxTable/DocxTable.razor @@ -20,7 +20,7 @@ @foreach (var propertyInfo in typeof(TItem).GetComponentParametersOnly()) { - + } @@ -43,7 +43,7 @@ @foreach (var propertyInfo in typeof(TItem).GetModelProperties()) { - + } @@ -64,7 +64,7 @@ @foreach (var methodInfo in typeof(TItem).GetComponentMethods()) { - + } @@ -115,4 +115,12 @@ } - \ No newline at end of file + + +@code { + [Parameter] + public IReadOnlyDictionary? AddedVersionOverrides { get; set; } + + [Parameter] + public Type? VersionContextType { get; set; } +} \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Extensions/MethodInfoExtensions.cs b/BlazorBootstrap.Demo.RCL/Extensions/MethodInfoExtensions.cs index e47aa468b..6c0534aa6 100644 --- a/BlazorBootstrap.Demo.RCL/Extensions/MethodInfoExtensions.cs +++ b/BlazorBootstrap.Demo.RCL/Extensions/MethodInfoExtensions.cs @@ -22,6 +22,30 @@ public static string GetMethodAddedVersion(this MethodInfo methodInfo) return addedVersionAttribute?.Version ?? string.Empty; } + /// + /// Get the effective added version of a method using an optional docs context. + /// + /// + /// + /// string + public static string GetMethodAddedVersion(this MethodInfo methodInfo, Type? versionContextType) + { + var methodVersion = methodInfo.GetMethodAddedVersion(); + var contextVersion = versionContextType.GetTypeAddedVersion(); + + if (string.IsNullOrWhiteSpace(methodVersion)) + return contextVersion; + + if (string.IsNullOrWhiteSpace(contextVersion)) + return methodVersion; + + if (Version.TryParse(methodVersion, out var parsedMethodVersion) + && Version.TryParse(contextVersion, out var parsedContextVersion)) + return parsedMethodVersion >= parsedContextVersion ? methodVersion : contextVersion; + + return methodVersion; + } + /// /// Get method description. /// @@ -62,4 +86,13 @@ public static string GetMethodReturnType(this MethodInfo methodInfo) var nullabilityInfo = _nullabilityInfoContext.Create(methodInfo.ReturnParameter); return nullabilityInfo.GetFriendlyTypeName(); } + + private static string GetTypeAddedVersion(this Type? type) + { + if (type is null) + return string.Empty; + + var addedVersionAttribute = (AddedVersionAttribute?)Attribute.GetCustomAttribute(type, typeof(AddedVersionAttribute)); + return addedVersionAttribute?.Version ?? string.Empty; + } } diff --git a/BlazorBootstrap.Demo.RCL/Extensions/PropertyInfoExtenstions.cs b/BlazorBootstrap.Demo.RCL/Extensions/PropertyInfoExtenstions.cs index c5f5ca87c..e199cc3fc 100644 --- a/BlazorBootstrap.Demo.RCL/Extensions/PropertyInfoExtenstions.cs +++ b/BlazorBootstrap.Demo.RCL/Extensions/PropertyInfoExtenstions.cs @@ -54,6 +54,24 @@ public static string GetPropertyAddedVersion(this PropertyInfo propertyInfo) return addedVersionAttribute?.Version ?? string.Empty; } + /// + /// Get the effective added version of a property using an optional docs context and overrides. + /// + /// + /// + /// + /// string + public static string GetPropertyAddedVersion(this PropertyInfo propertyInfo, Type? versionContextType, IReadOnlyDictionary? addedVersionOverrides = null) + { + if (addedVersionOverrides is not null && addedVersionOverrides.TryGetValue(propertyInfo.Name, out var overrideVersion)) + return overrideVersion; + + var propertyVersion = propertyInfo.GetPropertyAddedVersion(); + var contextVersion = versionContextType.GetTypeAddedVersion(); + + return GetEffectiveAddedVersion(propertyVersion, contextVersion); + } + /// /// Get default value of a property. /// @@ -115,4 +133,28 @@ public static bool IsPropertyRequired(this PropertyInfo propertyInfo) var editorRequiredAttribute = (EditorRequiredAttribute?)Attribute.GetCustomAttribute(propertyInfo, typeof(EditorRequiredAttribute)); return editorRequiredAttribute is not null; } + + private static string GetEffectiveAddedVersion(string propertyVersion, string contextVersion) + { + if (string.IsNullOrWhiteSpace(propertyVersion)) + return contextVersion; + + if (string.IsNullOrWhiteSpace(contextVersion)) + return propertyVersion; + + if (Version.TryParse(propertyVersion, out var parsedPropertyVersion) + && Version.TryParse(contextVersion, out var parsedContextVersion)) + return parsedPropertyVersion >= parsedContextVersion ? propertyVersion : contextVersion; + + return propertyVersion; + } + + private static string GetTypeAddedVersion(this Type? type) + { + if (type is null) + return string.Empty; + + var addedVersionAttribute = (AddedVersionAttribute?)Attribute.GetCustomAttribute(type, typeof(AddedVersionAttribute)); + return addedVersionAttribute?.Version ?? string.Empty; + } } \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Extensions/TypeExtensions.cs b/BlazorBootstrap.Demo.RCL/Extensions/TypeExtensions.cs index 8d8a6b9a1..7d539e964 100644 --- a/BlazorBootstrap.Demo.RCL/Extensions/TypeExtensions.cs +++ b/BlazorBootstrap.Demo.RCL/Extensions/TypeExtensions.cs @@ -67,11 +67,14 @@ public static HashSet GetComponentMethods(this Type type) { var methods = new HashSet(); + var includeBlazorBootstrapChartMethods = typeof(BlazorBootstrapChart).IsAssignableFrom(type); + foreach (MethodInfo method in type.GetMethods(BindingFlags.Public | BindingFlags.Instance)) { // Filter out methods inherited from System.Object (if needed) if (method.DeclaringType != typeof(object) - && method.DeclaringType == type // Exclude methods declared in base classes + && (method.DeclaringType == type + || (includeBlazorBootstrapChartMethods && method.DeclaringType == typeof(BlazorBootstrapChart))) && !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 diff --git a/blazorbootstrap/Components/Charts/BarChart.razor.cs b/blazorbootstrap/Components/Charts/BarChart.razor.cs index 2596cfc7d..ca3f90ce1 100644 --- a/blazorbootstrap/Components/Charts/BarChart.razor.cs +++ b/blazorbootstrap/Components/Charts/BarChart.razor.cs @@ -1,5 +1,6 @@ namespace BlazorBootstrap; +[AddedVersion("1.0.0")] public partial class BarChart : BlazorBootstrapChart { #region Fields and Constants @@ -19,6 +20,8 @@ public BarChart() #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) @@ -38,6 +41,8 @@ public override async Task AddDataAsync(ChartData chartData, string d 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) @@ -82,6 +87,8 @@ public override async Task AddDataAsync(ChartData chartData, string d 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) @@ -102,6 +109,8 @@ public override async Task AddDatasetAsync(ChartData chartData, IChar 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) @@ -117,6 +126,8 @@ public override async Task InitializeAsync(ChartData chartData, IChartOptions ch 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) diff --git a/blazorbootstrap/Components/Charts/BlazorBootstrapChart.cs b/blazorbootstrap/Components/Charts/BlazorBootstrapChart.cs index c36574031..761270c32 100644 --- a/blazorbootstrap/Components/Charts/BlazorBootstrapChart.cs +++ b/blazorbootstrap/Components/Charts/BlazorBootstrapChart.cs @@ -18,10 +18,37 @@ public class BlazorBootstrapChart : BlazorBootstrapComponentBase, IDisposable, I //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); /// @@ -37,11 +64,13 @@ public class BlazorBootstrapChart : BlazorBootstrapComponentBase, IDisposable, I //public async Task Clear() { } /// - /// Initialize Bar Chart. + /// 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()) @@ -73,12 +102,14 @@ protected override void OnInitialized() //public async Task Reset() { } /// - /// Resize the chart. + /// 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()}"; @@ -90,8 +121,10 @@ public async Task ResizeAsync(int width, int height, Unit widthUnit = Unit.Px, U /// 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()) @@ -128,6 +161,8 @@ protected override ValueTask DisposeAsyncCore(bool disposing) /// 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()) diff --git a/blazorbootstrap/Components/Charts/BubbleChart.razor.cs b/blazorbootstrap/Components/Charts/BubbleChart.razor.cs index df328f40f..cbc0e901b 100644 --- a/blazorbootstrap/Components/Charts/BubbleChart.razor.cs +++ b/blazorbootstrap/Components/Charts/BubbleChart.razor.cs @@ -1,5 +1,6 @@ namespace BlazorBootstrap; +[AddedVersion("4.0.0")] public partial class BubbleChart : BlazorBootstrapChart { #region Fields and Constants @@ -19,6 +20,8 @@ public BubbleChart() #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) @@ -40,6 +43,8 @@ public override async Task AddDataAsync(ChartData chartData, string d 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) @@ -85,6 +90,8 @@ public override async Task AddDataAsync(ChartData chartData, string d 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) @@ -105,6 +112,8 @@ public override async Task AddDatasetAsync(ChartData chartData, IChar 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) @@ -121,6 +130,8 @@ public override async Task InitializeAsync(ChartData chartData, IChartOptions ch 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) diff --git a/blazorbootstrap/Components/Charts/DoughnutChart.razor.cs b/blazorbootstrap/Components/Charts/DoughnutChart.razor.cs index 3774f0cf3..d5ceb4b0d 100644 --- a/blazorbootstrap/Components/Charts/DoughnutChart.razor.cs +++ b/blazorbootstrap/Components/Charts/DoughnutChart.razor.cs @@ -1,5 +1,6 @@ namespace BlazorBootstrap; +[AddedVersion("1.0.0")] public partial class DoughnutChart : BlazorBootstrapChart { #region Fields and Constants @@ -19,6 +20,8 @@ public DoughnutChart() #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) @@ -43,6 +46,8 @@ public override async Task AddDataAsync(ChartData chartData, string d 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) @@ -91,6 +96,8 @@ public override async Task AddDataAsync(ChartData chartData, string d 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) @@ -111,6 +118,8 @@ public override async Task AddDatasetAsync(ChartData chartData, IChar 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) @@ -121,6 +130,8 @@ public override async Task InitializeAsync(ChartData chartData, IChartOptions ch } } + [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) diff --git a/blazorbootstrap/Components/Charts/LineChart.razor.cs b/blazorbootstrap/Components/Charts/LineChart.razor.cs index 5f763af0e..ad4c0f6dd 100644 --- a/blazorbootstrap/Components/Charts/LineChart.razor.cs +++ b/blazorbootstrap/Components/Charts/LineChart.razor.cs @@ -1,5 +1,6 @@ namespace BlazorBootstrap; +[AddedVersion("1.0.0")] public partial class LineChart : BlazorBootstrapChart { #region Constructors @@ -13,6 +14,8 @@ public LineChart() #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) @@ -32,6 +35,8 @@ public override async Task AddDataAsync(ChartData chartData, string d 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) @@ -76,6 +81,8 @@ public override async Task AddDataAsync(ChartData chartData, string d 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) @@ -96,6 +103,8 @@ public override async Task AddDatasetAsync(ChartData chartData, IChar 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) @@ -111,6 +120,8 @@ public override async Task InitializeAsync(ChartData chartData, IChartOptions ch 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) diff --git a/blazorbootstrap/Components/Charts/PieChart.razor.cs b/blazorbootstrap/Components/Charts/PieChart.razor.cs index edb16f2df..e3516b6e8 100644 --- a/blazorbootstrap/Components/Charts/PieChart.razor.cs +++ b/blazorbootstrap/Components/Charts/PieChart.razor.cs @@ -1,5 +1,6 @@ namespace BlazorBootstrap; +[AddedVersion("1.0.0")] public partial class PieChart : BlazorBootstrapChart { #region Fields and Constants @@ -19,6 +20,8 @@ public PieChart() #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) @@ -43,6 +46,8 @@ public override async Task AddDataAsync(ChartData chartData, string d 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) @@ -91,6 +96,8 @@ public override async Task AddDataAsync(ChartData chartData, string d 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) @@ -111,6 +118,8 @@ public override async Task AddDatasetAsync(ChartData chartData, IChar 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) @@ -121,6 +130,8 @@ public override async Task InitializeAsync(ChartData chartData, IChartOptions ch } } + [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) diff --git a/blazorbootstrap/Components/Charts/PolarAreaChart.razor.cs b/blazorbootstrap/Components/Charts/PolarAreaChart.razor.cs index 58d88266c..7f5b46001 100644 --- a/blazorbootstrap/Components/Charts/PolarAreaChart.razor.cs +++ b/blazorbootstrap/Components/Charts/PolarAreaChart.razor.cs @@ -1,5 +1,6 @@ namespace BlazorBootstrap; +[AddedVersion("3.0.0")] public partial class PolarAreaChart : BlazorBootstrapChart { #region Fields and Constants @@ -20,6 +21,8 @@ public PolarAreaChart() #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) @@ -41,6 +44,8 @@ public override async Task AddDataAsync(ChartData chartData, string d 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) @@ -86,6 +91,8 @@ public override async Task AddDataAsync(ChartData chartData, string d 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) @@ -106,6 +113,8 @@ public override async Task AddDatasetAsync(ChartData chartData, IChar 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) @@ -116,6 +125,8 @@ public override async Task InitializeAsync(ChartData chartData, IChartOptions ch } } + [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) diff --git a/blazorbootstrap/Components/Charts/RadarChart.razor.cs b/blazorbootstrap/Components/Charts/RadarChart.razor.cs index 664b2937b..c20da461f 100644 --- a/blazorbootstrap/Components/Charts/RadarChart.razor.cs +++ b/blazorbootstrap/Components/Charts/RadarChart.razor.cs @@ -1,5 +1,6 @@ namespace BlazorBootstrap; +[AddedVersion("3.0.0")] public partial class RadarChart : BlazorBootstrapChart { #region Fields and Constants @@ -20,6 +21,8 @@ public RadarChart() #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) @@ -41,6 +44,8 @@ public override async Task AddDataAsync(ChartData chartData, string d 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) @@ -86,6 +91,8 @@ public override async Task AddDataAsync(ChartData chartData, string d 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) @@ -106,6 +113,8 @@ public override async Task AddDatasetAsync(ChartData chartData, IChar 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) @@ -116,6 +125,8 @@ public override async Task InitializeAsync(ChartData chartData, IChartOptions ch } } + [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) diff --git a/blazorbootstrap/Components/Charts/ScatterChart.razor.cs b/blazorbootstrap/Components/Charts/ScatterChart.razor.cs index 9dbd84f3b..a30418cfa 100644 --- a/blazorbootstrap/Components/Charts/ScatterChart.razor.cs +++ b/blazorbootstrap/Components/Charts/ScatterChart.razor.cs @@ -1,5 +1,6 @@ namespace BlazorBootstrap; +[AddedVersion("3.0.0")] public partial class ScatterChart : BlazorBootstrapChart { #region Fields and Constants @@ -20,6 +21,8 @@ public ScatterChart() #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) @@ -41,6 +44,8 @@ public override async Task AddDataAsync(ChartData chartData, string d 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) @@ -86,6 +91,8 @@ public override async Task AddDataAsync(ChartData chartData, string d 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) @@ -106,6 +113,8 @@ public override async Task AddDatasetAsync(ChartData chartData, IChar 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) @@ -122,6 +131,8 @@ public override async Task InitializeAsync(ChartData chartData, IChartOptions ch 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) diff --git a/blazorbootstrap/Models/Charts/ChartData.cs b/blazorbootstrap/Models/Charts/ChartData.cs index a97b988f4..0b3f65fe8 100644 --- a/blazorbootstrap/Models/Charts/ChartData.cs +++ b/blazorbootstrap/Models/Charts/ChartData.cs @@ -4,9 +4,17 @@ public class ChartData { #region Properties, Indexers + /// + /// Gets or sets the datasets. + /// + [AddedVersion("1.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? Datasets { get; set; } + /// + /// Gets or sets the labels. + /// + [AddedVersion("1.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? Labels { get; set; } diff --git a/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDataset.cs index 720b7544b..a73766689 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDataset.cs @@ -6,6 +6,7 @@ /// /// ///
+[AddedVersion("1.0.0")] public class BarChartDataset : ChartDataset { #region Constructors @@ -44,6 +45,7 @@ public BarChartDataset() /// /// Default value is . /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public double? BarThickness { get; set; } @@ -62,6 +64,7 @@ public BarChartDataset() /// /// Default value is 0. /// + [AddedVersion("3.0.0")] public List? BorderRadius { get; set; } /// @@ -84,6 +87,7 @@ public BarChartDataset() /// public double CategoryPercentage { get; set; } = 0.8; + [AddedVersion("1.10.2")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public BarChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link @@ -96,6 +100,7 @@ public BarChartDataset() /// /// Default value is . /// + [AddedVersion("3.0.0")] public bool Grouped { get; set; } = true; /// @@ -122,6 +127,7 @@ public BarChartDataset() /// /// Default value is 0. /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? HoverBorderRadius { get; set; } @@ -141,6 +147,7 @@ public BarChartDataset() /// /// Default value is . /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? IndexAxis { get; set; } @@ -153,6 +160,7 @@ public BarChartDataset() /// /// Default value is . /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public double? MaxBarThickness { get; set; } @@ -162,6 +170,7 @@ public BarChartDataset() /// /// Default value is . /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public double? MinBarLength { get; set; } @@ -175,6 +184,7 @@ public BarChartDataset() /// /// Default value is . /// + [AddedVersion("3.0.0")] public bool SkipNull { get; set; } //Stack diff --git a/blazorbootstrap/Models/Charts/ChartDataset/BubbleChart/BubbleChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/BubbleChart/BubbleChartDataset.cs index c29228929..cb07739bc 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/BubbleChart/BubbleChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/BubbleChart/BubbleChartDataset.cs @@ -6,6 +6,7 @@ namespace BlazorBootstrap; /// The third dimension is represented by the size of the individual bubbles. /// . /// +[AddedVersion("4.0.0")] public class BubbleChartDataset : ChartDataset { #region Constructors @@ -19,45 +20,59 @@ public BubbleChartDataset() #region Properties, Indexers + [AddedVersion("4.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? BackgroundColor { get; set; } + [AddedVersion("4.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? BorderColor { get; set; } + [AddedVersion("4.0.0")] public double BorderWidth { get; set; } = 3; + [AddedVersion("4.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public BubbleChartDatasetDataLabels Datalabels { get; set; } = new(); + [AddedVersion("4.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? DrawActiveElementsOnTop { get; set; } + [AddedVersion("4.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? HoverBackgroundColor { get; set; } + [AddedVersion("4.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? HoverBorderColor { get; set; } + [AddedVersion("4.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? HoverBorderWidth { get; set; } + [AddedVersion("4.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? HitRadius { get; set; } + [AddedVersion("4.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? HoverRadius { get; set; } + [AddedVersion("4.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? PointStyle { get; set; } + [AddedVersion("4.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? Radius { get; set; } + [AddedVersion("4.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? Rotation { get; set; } #endregion } +[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 index 1c86596d9..1b04c4c73 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/BubbleChart/BubbleChartDatasetData.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/BubbleChart/BubbleChartDatasetData.cs @@ -1,5 +1,6 @@ namespace BlazorBootstrap; +[AddedVersion("4.0.0")] public record BubbleChartDatasetData : ChartDatasetData { #region Constructors diff --git a/blazorbootstrap/Models/Charts/ChartDataset/ChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/ChartDataset.cs index 67819bbd2..8e1e8d894 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/ChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/ChartDataset.cs @@ -23,6 +23,7 @@ public ChartDataset() /// A number of options are provided to configure how the animation looks and how long it takes. /// . /// + [AddedVersion("4.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public ChartAnimation? Animation { get; set; } @@ -34,6 +35,7 @@ public ChartDataset() /// /// Default value is . /// + [AddedVersion("1.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? Clip { get; set; } @@ -43,6 +45,7 @@ public ChartDataset() /// /// Default value is . /// + [AddedVersion("1.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? Data { get; set; } @@ -52,6 +55,7 @@ public ChartDataset() /// /// Default value is . /// + [AddedVersion("1.0.0")] public bool Hidden { get; set; } /// @@ -60,6 +64,7 @@ public ChartDataset() /// /// Default value is . /// + [AddedVersion("1.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? Label { get; set; } @@ -74,6 +79,7 @@ public ChartDataset() /// /// Default value is 0. /// + [AddedVersion("3.0.0")] public int Order { get; set; } /// @@ -81,6 +87,7 @@ public ChartDataset() /// Datasets with the same stack ID are rendered in the same stack group. /// . /// + [AddedVersion("4.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? Stack { get; set; } diff --git a/blazorbootstrap/Models/Charts/ChartDataset/ChartDatasetDataLabels.cs b/blazorbootstrap/Models/Charts/ChartDataset/ChartDatasetDataLabels.cs index 16ce8816e..4cb4218c5 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/ChartDatasetDataLabels.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/ChartDatasetDataLabels.cs @@ -4,6 +4,7 @@ /// 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 @@ -22,6 +23,7 @@ public class ChartDatasetDataLabels /// /// Default value is . /// + [AddedVersion("3.0.0")] [JsonIgnore] public Alignment Alignment { @@ -39,6 +41,7 @@ public Alignment Alignment /// /// Default value is . /// + [AddedVersion("3.0.0")] [JsonIgnore] public Anchor Anchor { @@ -52,6 +55,7 @@ public Anchor Anchor //public string? BackgroundColor { get; set; } + [AddedVersion("3.0.0")] public double BorderWidth { get; set; } = 2; /// @@ -61,6 +65,7 @@ public Anchor Anchor /// /// Default value is . /// + [AddedVersion("3.0.0")] [JsonPropertyName("align")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? DataLabelsAlignment { get; private set; } @@ -69,6 +74,7 @@ public Anchor Anchor /// Gets or sets the data labels anchor. /// Possible values: start, center, and end. /// + [AddedVersion("3.0.0")] [JsonPropertyName("anchor")] public string? DataLabelsAnchor { get; private set; } diff --git a/blazorbootstrap/Models/Charts/ChartDataset/DoughnutChart/DoughnutChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/DoughnutChart/DoughnutChartDataset.cs index a6554bff5..2ebef829b 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/DoughnutChart/DoughnutChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/DoughnutChart/DoughnutChartDataset.cs @@ -5,6 +5,7 @@ /// These are used to set display properties for a specific dataset. /// . ///
+[AddedVersion("1.0.0")] public class DoughnutChartDataset : ChartDataset { #region Properties, Indexers @@ -26,6 +27,7 @@ public class DoughnutChartDataset : ChartDataset /// /// Default value is 'center'. /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? BorderAlign { get; set; } // TODO: change this to enum @@ -44,6 +46,7 @@ public class DoughnutChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? BorderDash { get; set; } @@ -53,6 +56,7 @@ public class DoughnutChartDataset : ChartDataset /// /// Default value is 0.0. /// + [AddedVersion("3.0.0")] public double BorderDashOffset { get; set; } /// @@ -62,6 +66,7 @@ public class DoughnutChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? BorderJoinStyle { get; set; } // TODO: change this to enum @@ -71,6 +76,7 @@ public class DoughnutChartDataset : ChartDataset /// /// Default value is 0. /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? BorderRadius { get; set; } @@ -89,9 +95,11 @@ public class DoughnutChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public double? Circumference { get; set; } + [AddedVersion("1.10.2")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public DoughnutChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link @@ -119,6 +127,7 @@ public class DoughnutChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? HoverBorderDash { get; set; } @@ -128,6 +137,7 @@ public class DoughnutChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public double? HoverBorderDashOffset { get; set; } @@ -138,6 +148,7 @@ public class DoughnutChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? HoverBorderJoinStyle { get; set; } // TODO: change this to enum @@ -147,6 +158,7 @@ public class DoughnutChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? HoverBorderWidth { get; set; } @@ -156,6 +168,7 @@ public class DoughnutChartDataset : ChartDataset /// /// Default value is 0. /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? HoverOffset { get; set; } @@ -165,6 +178,7 @@ public class DoughnutChartDataset : ChartDataset /// /// Default value is 0. /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? Offset { get; set; } @@ -174,6 +188,7 @@ public class DoughnutChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public double? Rotation { get; set; } @@ -183,6 +198,7 @@ public class DoughnutChartDataset : ChartDataset /// /// Default value is 0. /// + [AddedVersion("3.0.0")] public double Spacing { get; set; } /// @@ -193,6 +209,7 @@ public class DoughnutChartDataset : ChartDataset /// /// Default value is 1. /// + [AddedVersion("3.0.0")] public double Weight { get; set; } = 1; #endregion diff --git a/blazorbootstrap/Models/Charts/ChartDataset/LineChart/LineChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/LineChart/LineChartDataset.cs index b5810f614..8b01d2ba5 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/LineChart/LineChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/LineChart/LineChartDataset.cs @@ -5,6 +5,7 @@ /// These are used to set display properties for a specific dataset. /// . /// +[AddedVersion("1.0.0")] public class LineChartDataset : ChartDataset { #region Constructors @@ -136,6 +137,7 @@ public LineChartDataset FillToValue(double value) /// /// Default value is 'rgba(0, 0, 0, 0.1)'. /// + [AddedVersion("3.0.0")] public string BackgroundColor { get; set; } = "rgba(0, 0, 0, 0.1)"; /// @@ -145,6 +147,7 @@ public LineChartDataset FillToValue(double value) /// /// Default value is 'butt'. /// + [AddedVersion("3.0.0")] public string BorderCapStyle { get; set; } = "butt"; /// @@ -153,6 +156,7 @@ public LineChartDataset FillToValue(double value) /// /// Default value is 'rgba(0, 0, 0, 0.1)'. /// + [AddedVersion("3.0.0")] public string BorderColor { get; set; } = "rgba(0, 0, 0, 0.1)"; /// @@ -161,6 +165,7 @@ public LineChartDataset FillToValue(double value) /// /// Default value is . /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? BorderDash { get; set; } @@ -179,6 +184,7 @@ public LineChartDataset FillToValue(double value) /// /// Default value is 'miter'. /// + [AddedVersion("3.0.0")] public string BorderJoinStyle { get; set; } = "miter"; /// @@ -187,6 +193,7 @@ public LineChartDataset FillToValue(double value) /// /// Default value is 3. /// + [AddedVersion("3.0.0")] public double BorderWidth { get; set; } = 3; /// @@ -196,8 +203,10 @@ public LineChartDataset FillToValue(double value) /// /// Default value is 'default'. /// + [AddedVersion("3.0.0")] public string CubicInterpolationMode { get; set; } = "default"; + [AddedVersion("1.10.2")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public LineChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link @@ -207,6 +216,7 @@ public LineChartDataset FillToValue(double value) /// /// Default value is . /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? DrawActiveElementsOnTop { get; set; } @@ -225,6 +235,7 @@ public LineChartDataset FillToValue(double value) /// /// Default value is . /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? HoverBackgroundColor { get; set; } @@ -234,6 +245,7 @@ public LineChartDataset FillToValue(double value) /// /// Default value is . /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? HoverBorderCapStyle { get; set; } @@ -243,6 +255,7 @@ public LineChartDataset FillToValue(double value) /// /// Default value is . /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? HoverBorderColor { get; set; } @@ -252,6 +265,7 @@ public LineChartDataset FillToValue(double value) /// /// Default value is . /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? HoverBorderDash { get; set; } @@ -261,6 +275,7 @@ public LineChartDataset FillToValue(double value) /// /// Default value is . /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public double? HoverBorderDashOffset { get; set; } @@ -271,6 +286,7 @@ public LineChartDataset FillToValue(double value) /// /// Default value is 'miter'. /// + [AddedVersion("3.0.0")] public string HoverBorderJoinStyle { get; set; } = "miter"; /// @@ -279,6 +295,7 @@ public LineChartDataset FillToValue(double value) /// /// Default value is . /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public double? HoverBorderWidth { get; set; } @@ -288,6 +305,7 @@ public LineChartDataset FillToValue(double value) /// /// Default value is 'x'. /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? IndexAxis { get; set; } diff --git a/blazorbootstrap/Models/Charts/ChartDataset/PieChart/PieChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/PieChart/PieChartDataset.cs index 80f91271c..d26204ba7 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/PieChart/PieChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/PieChart/PieChartDataset.cs @@ -5,6 +5,7 @@ /// These are used to set display properties for a specific dataset. /// . /// +[AddedVersion("1.0.0")] public class PieChartDataset : ChartDataset { #region Properties, Indexers @@ -26,6 +27,7 @@ public class PieChartDataset : ChartDataset /// /// Default value is 'center'. /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? BorderAlign { get; set; } // TODO: change this to enum @@ -44,6 +46,7 @@ public class PieChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? BorderDash { get; set; } @@ -53,6 +56,7 @@ public class PieChartDataset : ChartDataset /// /// Default value is 0.0. /// + [AddedVersion("3.0.0")] public double BorderDashOffset { get; set; } /// @@ -62,6 +66,7 @@ public class PieChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? BorderJoinStyle { get; set; } // TODO: change this to enum @@ -71,6 +76,7 @@ public class PieChartDataset : ChartDataset /// /// Default value is 0. /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? BorderRadius { get; set; } @@ -89,9 +95,11 @@ public class PieChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public double? Circumference { get; set; } + [AddedVersion("1.10.2")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public PieChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link @@ -119,6 +127,7 @@ public class PieChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? HoverBorderDash { get; set; } @@ -128,6 +137,7 @@ public class PieChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public double? HoverBorderDashOffset { get; set; } @@ -138,6 +148,7 @@ public class PieChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? HoverBorderJoinStyle { get; set; } // TODO: change this to enum @@ -156,6 +167,7 @@ public class PieChartDataset : ChartDataset /// /// Default value is 0. /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? HoverOffset { get; set; } @@ -165,6 +177,7 @@ public class PieChartDataset : ChartDataset /// /// Default value is 0. /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? Offset { get; set; } @@ -174,6 +187,7 @@ public class PieChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public double? Rotation { get; set; } @@ -183,6 +197,7 @@ public class PieChartDataset : ChartDataset /// /// Default value is 0. /// + [AddedVersion("3.0.0")] public double Spacing { get; set; } /// @@ -193,6 +208,7 @@ public class PieChartDataset : ChartDataset /// /// Default value is 1. /// + [AddedVersion("3.0.0")] public double Weight { get; set; } = 1; #endregion diff --git a/blazorbootstrap/Models/Charts/ChartDataset/PolarAreaChart/PolarAreaChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/PolarAreaChart/PolarAreaChartDataset.cs index dc749cad6..03a13ac3b 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/PolarAreaChart/PolarAreaChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/PolarAreaChart/PolarAreaChartDataset.cs @@ -1,5 +1,6 @@ namespace BlazorBootstrap; +[AddedVersion("3.0.0")] public class PolarAreaChartDataset : ChartDataset { #region Properties, Indexers @@ -138,4 +139,5 @@ public class PolarAreaChartDataset : ChartDataset #endregion } +[AddedVersion("3.0.0")] public class PolarAreaChartDatasetDataLabels : ChartDatasetDataLabels { } diff --git a/blazorbootstrap/Models/Charts/ChartDataset/RadarChart/RadarChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/RadarChart/RadarChartDataset.cs index 58655626d..bd8543083 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/RadarChart/RadarChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/RadarChart/RadarChartDataset.cs @@ -5,6 +5,7 @@ /// They are often useful for comparing the points of two or more different data sets. /// . /// +[AddedVersion("3.0.0")] public class RadarChartDataset : ChartDataset { #region Properties, Indexers @@ -268,4 +269,5 @@ public class RadarChartDataset : ChartDataset #endregion } +[AddedVersion("3.0.0")] public class RadarChartDatasetDataLabels : ChartDatasetDataLabels { } diff --git a/blazorbootstrap/Models/Charts/ChartDataset/ScatterChart/ScatterChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/ScatterChart/ScatterChartDataset.cs index 987823b5c..e45727f0c 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/ScatterChart/ScatterChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/ScatterChart/ScatterChartDataset.cs @@ -7,6 +7,7 @@ /// The scatter chart supports all the same properties as the line chart. /// By default, the scatter chart will override the showLine property of the line chart to . /// +[AddedVersion("3.0.0")] public class ScatterChartDataset : ChartDataset { #region Properties, Indexers @@ -338,4 +339,5 @@ public class ScatterChartDataset : ChartDataset #endregion } +[AddedVersion("3.0.0")] public class ScatterChartDatasetDataLabels : ChartDatasetDataLabels { } diff --git a/blazorbootstrap/Models/Charts/ChartOptions/BarChartOptions.cs b/blazorbootstrap/Models/Charts/ChartOptions/BarChartOptions.cs index dbc02fcb6..b3545f028 100644 --- a/blazorbootstrap/Models/Charts/ChartOptions/BarChartOptions.cs +++ b/blazorbootstrap/Models/Charts/ChartOptions/BarChartOptions.cs @@ -1,5 +1,6 @@ namespace BlazorBootstrap; +[AddedVersion("1.0.0")] public class BarChartOptions : ChartOptions { #region Properties, Indexers @@ -15,6 +16,7 @@ public class BarChartOptions : ChartOptions /// /// Default value is . /// + [AddedVersion("1.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? IndexAxis { get; set; } @@ -22,6 +24,7 @@ public class BarChartOptions : ChartOptions public ChartLayout Layout { get; set; } = new(); + [AddedVersion("1.10.2")] public BarChartPlugins Plugins { get; set; } = new(); public Scales Scales { get; set; } = new(); diff --git a/blazorbootstrap/Models/Charts/ChartOptions/BubbleChartOptions.cs b/blazorbootstrap/Models/Charts/ChartOptions/BubbleChartOptions.cs index a3fb7d9f7..cf79066f6 100644 --- a/blazorbootstrap/Models/Charts/ChartOptions/BubbleChartOptions.cs +++ b/blazorbootstrap/Models/Charts/ChartOptions/BubbleChartOptions.cs @@ -1,18 +1,24 @@ namespace BlazorBootstrap; +[AddedVersion("4.0.0")] public class BubbleChartOptions : ChartOptions { #region Properties, Indexers + [AddedVersion("4.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? IndexAxis { get; set; } + [AddedVersion("4.0.0")] public Interaction Interaction { get; set; } = new(); + [AddedVersion("4.0.0")] public ChartLayout Layout { get; set; } = new(); + [AddedVersion("4.0.0")] public BubbleChartPlugins Plugins { get; set; } = new(); + [AddedVersion("4.0.0")] public Scales Scales { get; set; } = new(); #endregion diff --git a/blazorbootstrap/Models/Charts/ChartOptions/ChartOptions.cs b/blazorbootstrap/Models/Charts/ChartOptions/ChartOptions.cs index 0b7148fe3..2db539e1b 100644 --- a/blazorbootstrap/Models/Charts/ChartOptions/ChartOptions.cs +++ b/blazorbootstrap/Models/Charts/ChartOptions/ChartOptions.cs @@ -14,6 +14,7 @@ public class ChartOptions : IChartOptions /// A number of options are provided to configure how the animation looks and how long it takes. /// . /// + [AddedVersion("4.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public ChartAnimation? Animation { get; set; } @@ -21,6 +22,7 @@ public class ChartOptions : IChartOptions /// Canvas aspect ratio (i.e. width / height). /// . /// + [AddedVersion("4.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public double? AspectRatio { get; set; } @@ -28,6 +30,7 @@ public class ChartOptions : IChartOptions /// Gets or sets the locale. /// By default, the chart is using the default locale of the platform which is running on. /// + [AddedVersion("1.10.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? Locale { get; set; } @@ -38,6 +41,7 @@ public class ChartOptions : IChartOptions /// /// Default value is . /// + [AddedVersion("3.0.0")] public bool MaintainAspectRatio { get; set; } = true; //onResize @@ -47,6 +51,7 @@ public class ChartOptions : IChartOptions /// Delay the resize update by the given amount of milliseconds. /// . /// + [AddedVersion("4.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public int? ResizeDelay { get; set; } @@ -57,6 +62,7 @@ public class ChartOptions : IChartOptions /// /// Default value is . /// + [AddedVersion("1.0.0")] public bool Responsive { get; set; } #endregion @@ -141,6 +147,7 @@ private void SetAxis(InteractionAxis? interactionAxis) => /// Supported values are x, y, xy, and r. /// . /// + [AddedVersion("4.0.0")] [JsonPropertyName("axis")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? ChartInteractionAxis { get; private set; } @@ -148,6 +155,7 @@ private void SetAxis(InteractionAxis? interactionAxis) => /// /// Sets which elements appear in the interaction. /// + [AddedVersion("1.0.0")] [JsonPropertyName("mode")] public string ChartInteractionMode { get; private set; } = string.Empty; @@ -157,18 +165,21 @@ private void SetAxis(InteractionAxis? interactionAxis) => /// /// Default value is . /// + [AddedVersion("1.0.0")] public bool Intersect { get; set; } = true; /// /// If , invisible points that are outside of the chart area are included when evaluating interactions. /// . /// + [AddedVersion("4.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public bool? IncludeInvisible { get; set; } /// /// Defines which directions are used in calculating distances for interactions. /// + [AddedVersion("4.0.0")] [JsonIgnore] public InteractionAxis? Axis { @@ -183,6 +194,7 @@ public InteractionAxis? Axis /// /// Sets which elements appear in the tooltip. See Interaction Modes for details. /// + [AddedVersion("1.0.0")] [JsonIgnore] public InteractionMode Mode { @@ -202,21 +214,25 @@ public enum InteractionAxis /// /// Calculate interaction distances on the x-axis only. /// + [AddedVersion("4.0.0")] X, /// /// Calculate interaction distances on the y-axis only. /// + [AddedVersion("4.0.0")] Y, /// /// Calculate interaction distances on both x-axis and y-axis. /// + [AddedVersion("4.0.0")] XY, /// /// Calculate interaction distances on the radial axis. /// + [AddedVersion("4.0.0")] R } diff --git a/blazorbootstrap/Models/Charts/ChartOptions/DoughnutChartOptions.cs b/blazorbootstrap/Models/Charts/ChartOptions/DoughnutChartOptions.cs index e516c0f7e..60e17058f 100644 --- a/blazorbootstrap/Models/Charts/ChartOptions/DoughnutChartOptions.cs +++ b/blazorbootstrap/Models/Charts/ChartOptions/DoughnutChartOptions.cs @@ -1,9 +1,11 @@ namespace BlazorBootstrap; +[AddedVersion("1.0.0")] public class DoughnutChartOptions : ChartOptions { #region Properties, Indexers + [AddedVersion("1.10.2")] public DoughnutChartPlugins Plugins { get; set; } = new(); #endregion diff --git a/blazorbootstrap/Models/Charts/ChartOptions/LineChartOptions.cs b/blazorbootstrap/Models/Charts/ChartOptions/LineChartOptions.cs index 58091b12a..1c40f4c45 100644 --- a/blazorbootstrap/Models/Charts/ChartOptions/LineChartOptions.cs +++ b/blazorbootstrap/Models/Charts/ChartOptions/LineChartOptions.cs @@ -1,5 +1,6 @@ namespace BlazorBootstrap; +[AddedVersion("1.0.0")] public class LineChartOptions : ChartOptions { #region Properties, Indexers @@ -14,6 +15,7 @@ public class LineChartOptions : ChartOptions /// /// Default value is . /// + [AddedVersion("3.0.0")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? IndexAxis { get; set; } @@ -21,6 +23,7 @@ public class LineChartOptions : ChartOptions public ChartLayout Layout { get; set; } = new(); + [AddedVersion("1.10.2")] public LineChartPlugins Plugins { get; set; } = new(); public Scales Scales { get; set; } = new(); diff --git a/blazorbootstrap/Models/Charts/ChartOptions/PieChartOptions.cs b/blazorbootstrap/Models/Charts/ChartOptions/PieChartOptions.cs index 6493382d5..c68dc04dd 100644 --- a/blazorbootstrap/Models/Charts/ChartOptions/PieChartOptions.cs +++ b/blazorbootstrap/Models/Charts/ChartOptions/PieChartOptions.cs @@ -1,9 +1,11 @@ namespace BlazorBootstrap; +[AddedVersion("1.0.0")] public class PieChartOptions : ChartOptions { #region Properties, Indexers + [AddedVersion("1.10.2")] public PieChartPlugins Plugins { get; set; } = new(); #endregion diff --git a/blazorbootstrap/Models/Charts/ChartOptions/PolarAreaChartOptions.cs b/blazorbootstrap/Models/Charts/ChartOptions/PolarAreaChartOptions.cs index 5148f3775..53bbf6e9c 100644 --- a/blazorbootstrap/Models/Charts/ChartOptions/PolarAreaChartOptions.cs +++ b/blazorbootstrap/Models/Charts/ChartOptions/PolarAreaChartOptions.cs @@ -1,9 +1,11 @@ namespace BlazorBootstrap; +[AddedVersion("3.0.0")] public class PolarAreaChartOptions : ChartOptions { #region Properties, Indexers + [AddedVersion("3.0.0")] public PolarAreaChartPlugins Plugins { get; set; } = new(); #endregion diff --git a/blazorbootstrap/Models/Charts/ChartOptions/RadarChartOptions.cs b/blazorbootstrap/Models/Charts/ChartOptions/RadarChartOptions.cs index 8ef0770b8..cb2174f7b 100644 --- a/blazorbootstrap/Models/Charts/ChartOptions/RadarChartOptions.cs +++ b/blazorbootstrap/Models/Charts/ChartOptions/RadarChartOptions.cs @@ -1,5 +1,6 @@ namespace BlazorBootstrap; +[AddedVersion("3.0.0")] public class RadarChartOptions : ChartOptions { } diff --git a/blazorbootstrap/Models/Charts/ChartOptions/ScatterChartOptions.cs b/blazorbootstrap/Models/Charts/ChartOptions/ScatterChartOptions.cs index 32fdab3f9..c7109283a 100644 --- a/blazorbootstrap/Models/Charts/ChartOptions/ScatterChartOptions.cs +++ b/blazorbootstrap/Models/Charts/ChartOptions/ScatterChartOptions.cs @@ -1,5 +1,6 @@ namespace BlazorBootstrap; +[AddedVersion("3.0.0")] public class ScatterChartOptions : ChartOptions { #region Properties, Indexers diff --git a/docs/docs/06-data-visualization/bar-chart.mdx b/docs/docs/06-data-visualization/bar-chart.mdx index 763d62ed2..143c240c1 100644 --- a/docs/docs/06-data-visualization/bar-chart.mdx +++ b/docs/docs/06-data-visualization/bar-chart.mdx @@ -53,7 +53,7 @@ It is sometimes used to show trend data and to compare multiple data sets side b | Property Name | Type | Default | Required | Description | Added / Modified Version | |:--|:--|:--|:--|:--|:--| -| Animation | `ChartAnimation?` | null | | Configures dataset-level animation including delay, duration, easing, and looping. | 4.4.0 | +| Animation | `ChartAnimation?` | null | | Configures dataset-level animation including delay, duration, easing, and looping. | 4.0.0 | | BackgroundColor | `List?` | null | | Get or sets the BackgroundColor. | 1.0.0 | | BarPercentage | double | 0.9 | | 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. | 1.0.0 | | BarThickness | `double?` | null | | It is applied to the width of each bar, in pixels. When this is enforced, barPercentage and categoryPercentage are ignored. | 3.0.0 | @@ -75,7 +75,7 @@ It is sometimes used to show trend data and to compare multiple data sets side b | MaxBarThickness | `double?` | null | Set this to ensure that bars are not sized thicker than this. | 3.0.0 | | MinBarLength | `double?` | null | Set this to ensure that bars have a minimum length in pixels. | 3.0.0 | | Order | int | 0 | | The drawing order of dataset. Also affects order for stacking, tooltip and legend. | 3.0.0 | -| Stack | `string?` | null | | The ID of the group to which this dataset belongs when stacked. Datasets with the same value are rendered in the same stack group. | 4.4.0 | +| Stack | `string?` | null | | The ID of the group to which this dataset belongs when stacked. Datasets with the same value are rendered in the same stack group. | 4.0.0 | | SkipNull | bool | false | If true, null or undefined values will not be used for spacing calculations when determining bar size. | 3.0.0 | | XAxisID | `string?` | null | | The ID of the x axis to plot this dataset on. | 1.0.0 | | YAxisID | `string?` | null | | The ID of the y axis to plot this dataset on. | 1.0.0 | @@ -100,15 +100,15 @@ It is sometimes used to show trend data and to compare multiple data sets side b | Property Name | Type | Default | Required | Description | Added / Modified Version | |:--|:--|:--|:--|:--|:--| -| Animation | `ChartAnimation?` | null | | Configures chart-level animation including delay, duration, easing, and looping. | 4.4.0 | -| AspectRatio | `double?` | null | | Sets the canvas aspect ratio (`width / height`) when responsive resizing is enabled. | 4.4.0 | +| Animation | `ChartAnimation?` | null | | Configures chart-level animation including delay, duration, easing, and looping. | 4.0.0 | +| AspectRatio | `double?` | null | | Sets the canvas aspect ratio (`width / height`) when responsive resizing is enabled. | 4.0.0 | | IndexAxis | string | x | | The base axis of the chart. 'x' for vertical charts and 'y' for horizontal charts. | 1.0.0 | | Interaction | `Interaction` | | | Gets or sets the Interaction. | 1.0.0 | | Layout | `ChartLayout` | | | Gets or sets the ChartLayout. | 1.0.0 | | Locale | `string?` | | | Gets or sets the locale. By default, the chart is using the default locale of the platform which is running on. | 1.10.0 | | MaintainAspectRatio | bool | true | | Maintain the original canvas aspect ratio (width / height) when resizing. | 3.0.0 | | Plugins | `BarChartPlugins` | | | Gets or sets the Plugins. | 1.10.2 | -| ResizeDelay | `int?` | null | | Delays the resize update by the given number of milliseconds. | 4.4.0 | +| ResizeDelay | `int?` | null | | Delays the resize update by the given number of milliseconds. | 4.0.0 | | Responsive | bool | false | | Resizes the chart canvas when its container does. | 1.0.0 | | Scales | `Scales` | | | Gets or sets the Scales. | 1.0.0 | @@ -116,8 +116,8 @@ It is sometimes used to show trend data and to compare multiple data sets side b | Property Name | Type | Default | Required | Description | Added / Modified Version | |:--|:--|:--|:--|:--|:--| -| Axis | `InteractionAxis?` | null | | Defines which directions are used in calculating distances. Supported values are `X`, `Y`, `XY`, and `R`. | 4.4.0 | -| IncludeInvisible | `bool?` | null | | Includes invisible points outside the chart area when evaluating interactions. | 4.4.0 | +| Axis | `InteractionAxis?` | null | | Defines which directions are used in calculating distances. Supported values are `X`, `Y`, `XY`, and `R`. | 4.0.0 | +| IncludeInvisible | `bool?` | null | | Includes invisible points outside the chart area when evaluating interactions. | 4.0.0 | | Intersect | bool | true | | If true, the interaction mode only applies when the mouse position intersects an item on the chart. | 1.0.0 | | Mode | `InteractionMode` | `Nearest` | | Sets which elements appear in the interaction. | 1.0.0 | diff --git a/docs/docs/06-data-visualization/line-chart.mdx b/docs/docs/06-data-visualization/line-chart.mdx index 529d8cdc9..b13d17ac1 100644 --- a/docs/docs/06-data-visualization/line-chart.mdx +++ b/docs/docs/06-data-visualization/line-chart.mdx @@ -53,7 +53,7 @@ A Blazor Bootstrap line chart component is a graphical representation of data th | Property Name | Type | Default | Required | Description | Added / Modified Version | |:--|:--|:--|:--|:--|:--| -| Animation | `ChartAnimation?` | null | | Configures dataset-level animation including delay, duration, easing, and looping. | 4.4.0 | +| Animation | `ChartAnimation?` | null | | Configures dataset-level animation including delay, duration, easing, and looping. | 4.0.0 | | BackgroundColor | `string` | `rgba(0, 0, 0, 0.1)` | | Get or sets the line fill color. | 3.0.0 | | BorderCapStyle | `string` | `butt` | | Cap style of the line. Supported values are 'butt', 'round', and 'square'. | 3.0.0 | | BorderColor | `string` | `rgba(0, 0, 0, 0.1)` | | Get or sets the line color. | 3.0.0 | @@ -78,7 +78,7 @@ A Blazor Bootstrap line chart component is a graphical representation of data th | IndexAxis | `string?` | null | | The base axis of the dataset. 'x' for horizontal lines and 'y' for vertical lines. | 3.0.0 | | Label | `string?` | null | | The label for the dataset which appears in the legend and tooltips. | 1.0.0 | | Order | int | 0 | | The drawing order of dataset. Also affects order for stacking, tooltip and legend. | 3.0.0 | -| Stack | `string?` | null | | The ID of the group to which this dataset belongs when stacked. Datasets with the same value are rendered in the same stack group. | 4.4.0 | +| Stack | `string?` | null | | The ID of the group to which this dataset belongs when stacked. Datasets with the same value are rendered in the same stack group. | 4.0.0 | | PointBackgroundColor | `List?` | null | | The fill color for points. | 1.0.0 | | PointBorderColor | `List?` | null | | The border color for points. | 1.0.0 | | PointBorderWidth | `List?` | null | | The width of the point border in pixels. | 1.0.0 | @@ -117,15 +117,15 @@ A Blazor Bootstrap line chart component is a graphical representation of data th | Property Name | Type | Default | Required | Description | Added / Modified Version | |:--|:--|:--|:--|:--|:--| -| Animation | `ChartAnimation?` | null | | Configures chart-level animation including delay, duration, easing, and looping. | 4.4.0 | -| AspectRatio | `double?` | null | | Sets the canvas aspect ratio (`width / height`) when responsive resizing is enabled. | 4.4.0 | +| Animation | `ChartAnimation?` | null | | Configures chart-level animation including delay, duration, easing, and looping. | 4.0.0 | +| AspectRatio | `double?` | null | | Sets the canvas aspect ratio (`width / height`) when responsive resizing is enabled. | 4.0.0 | | IndexAxis | `string?` | null | | The base axis of the chart. 'x' for vertical charts and 'y' for horizontal charts. | 3.0.0 | | Interaction | `Interaction` | | | Gets or sets the Interaction. | 1.0.0 | | Layout | `ChartLayout` | | | Gets or sets the ChartLayout. | 1.0.0 | | Locale | `string?` | | | Gets or sets the locale. By default, the chart is using the default locale of the platform which is running on. | 1.10.0 | | MaintainAspectRatio | bool | true | | Maintain the original canvas aspect ratio (width / height) when resizing. | 3.0.0 | | Plugins | `LineChartPlugins` | | | Gets or sets the Plugins. | 1.10.2 | -| ResizeDelay | `int?` | null | | Delays the resize update by the given number of milliseconds. | 4.4.0 | +| ResizeDelay | `int?` | null | | Delays the resize update by the given number of milliseconds. | 4.0.0 | | Responsive | bool | false | | Resizes the chart canvas when its container does. | 1.0.0 | | Scales | `Scales` | | | Gets or sets the Scales. | 1.0.0 | @@ -133,8 +133,8 @@ A Blazor Bootstrap line chart component is a graphical representation of data th | Property Name | Type | Default | Required | Description | Added / Modified Version | |:--|:--|:--|:--|:--|:--| -| Axis | `InteractionAxis?` | null | | Defines which directions are used in calculating distances. Supported values are `X`, `Y`, `XY`, and `R`. | 4.4.0 | -| IncludeInvisible | `bool?` | null | | Includes invisible points outside the chart area when evaluating interactions. | 4.4.0 | +| Axis | `InteractionAxis?` | null | | Defines which directions are used in calculating distances. Supported values are `X`, `Y`, `XY`, and `R`. | 4.0.0 | +| IncludeInvisible | `bool?` | null | | Includes invisible points outside the chart area when evaluating interactions. | 4.0.0 | | Intersect | bool | true | | If true, the interaction mode only applies when the mouse position intersects an item on the chart. | 1.0.0 | | Mode | `InteractionMode` | `Nearest` | | Sets which elements appear in the interaction. | 1.0.0 | diff --git a/docs/docs/06-data-visualization/scatter-chart.mdx b/docs/docs/06-data-visualization/scatter-chart.mdx index 5bf80a213..ef37d805b 100644 --- a/docs/docs/06-data-visualization/scatter-chart.mdx +++ b/docs/docs/06-data-visualization/scatter-chart.mdx @@ -121,15 +121,15 @@ A Blazor Bootstrap scatter chart components are based on basic line charts with | Property Name | Type | Default | Required | Description | Added Version | |:--|:--|:--|:--|:--|:--| -| Animation | `ChartAnimation?` | null | | Configures chart-level animation including delay, duration, easing, and looping. | 4.4.0 | -| AspectRatio | `double?` | null | | Sets the canvas aspect ratio (`width / height`) when responsive resizing is enabled. | 4.4.0 | +| Animation | `ChartAnimation?` | null | | Configures chart-level animation including delay, duration, easing, and looping. | 4.0.0 | +| AspectRatio | `double?` | null | | Sets the canvas aspect ratio (`width / height`) when responsive resizing is enabled. | 4.0.0 | | IndexAxis | `string?` | null | | The base axis of the chart. 'x' for vertical charts and 'y' for horizontal charts. | 3.0.0 | | Interaction | `Interaction` | | | Gets or sets the Interaction. | 3.0.0 | | Layout | `ChartLayout` | | | Gets or sets the ChartLayout. | 3.0.0 | | Locale | `string?` | | | Gets or sets the locale. By default, the chart is using the default locale of the platform which is running on. | 3.0.0 | | MaintainAspectRatio | bool | true | | Maintain the original canvas aspect ratio (width / height) when resizing. | 3.0.0 | | Plugins | `ScatterChartPlugins` | | | Gets or sets the Plugins. | 3.0.0 | -| ResizeDelay | `int?` | null | | Delays the resize update by the given number of milliseconds. | 4.4.0 | +| ResizeDelay | `int?` | null | | Delays the resize update by the given number of milliseconds. | 4.0.0 | | Responsive | bool | false | | Gets or sets the Responsive. | 3.0.0 | | Scales | `Scales` | | | Gets or sets the Scales. | 3.0.0 | @@ -137,8 +137,8 @@ A Blazor Bootstrap scatter chart components are based on basic line charts with | Property Name | Type | Default | Required | Description | Added Version | |:--|:--|:--|:--|:--|:--| -| Axis | `InteractionAxis?` | null | | Defines which directions are used in calculating distances. Supported values are `X`, `Y`, `XY`, and `R`. | 4.4.0 | -| IncludeInvisible | `bool?` | null | | Includes invisible points outside the chart area when evaluating interactions. | 4.4.0 | +| Axis | `InteractionAxis?` | null | | Defines which directions are used in calculating distances. Supported values are `X`, `Y`, `XY`, and `R`. | 4.0.0 | +| IncludeInvisible | `bool?` | null | | Includes invisible points outside the chart area when evaluating interactions. | 4.0.0 | | Intersect | bool | true | | If true, the interaction mode only applies when the mouse position intersects an item on the chart. | 3.0.0 | | Mode | `InteractionMode` | `Nearest` | | Sets which elements appear in the interaction. | 3.0.0 | From f4dd312d29bc24b4480a2299d7d64b89388075fc Mon Sep 17 00:00:00 2001 From: gvreddy04 Date: Thu, 14 May 2026 02:08:58 +0530 Subject: [PATCH 4/5] feat: Enhance chart options and plugins with new properties and descriptions - Added plugin configuration properties to Doughnut, Line, Pie, Polar Area, and Scatter chart options. - Introduced interaction and layout configurations for Line and Scatter charts. - Enhanced Bar, Bubble, Doughnut, Line, Pie, Polar Area, and Scatter chart plugins with data label configurations. - Updated ChartPlugins class with detailed descriptions for legend, title, and tooltip configurations. - Introduced RGB and RGBA color representation records with documentation. --- blazorbootstrap/Models/Charts/ChartData.cs | 8 + .../ChartDataset/BarChart/BarChartDataset.cs | 41 ++++ .../BarChart/BarChartDatasetData.cs | 4 + .../BubbleChart/BubbleChartDataPoint.cs | 1 + .../BubbleChart/BubbleChartDataset.cs | 28 +++ .../BubbleChart/BubbleChartDatasetData.cs | 3 + .../Charts/ChartDataset/ChartDataset.cs | 21 +- .../Charts/ChartDataset/ChartDatasetData.cs | 21 ++ .../DoughnutChart/DoughnutChartDataset.cs | 45 +++++ .../DoughnutChart/DoughnutChartDatasetData.cs | 8 + .../LineChart/LineChartDataset.cs | 4 + .../LineChart/LineChartDatasetData.cs | 4 + .../ChartDataset/PieChart/PieChartDataset.cs | 45 +++++ .../PieChart/PieChartDatasetData.cs | 8 + .../PolarAreaChart/PolarAreaChartDataset.cs | 33 ++++ .../PolarAreaChartDatasetData.cs | 12 ++ .../RadarChart/RadarChartDataset.cs | 3 + .../RadarChart/RadarChartDatasetData.cs | 12 ++ .../ScatterChart/ScatterChartDataPoint.cs | 6 + .../ScatterChart/ScatterChartDataset.cs | 3 + .../ScatterChart/ScatterChartDatasetData.cs | 4 + blazorbootstrap/Models/Charts/ChartLabel.cs | 4 + .../Charts/ChartOptions/BarChartOptions.cs | 9 + .../Charts/ChartOptions/BubbleChartOptions.cs | 6 + .../Charts/ChartOptions/ChartOptions.cs | 183 ++++++++++++++++++ .../ChartOptions/DoughnutChartOptions.cs | 1 + .../Charts/ChartOptions/LineChartOptions.cs | 9 + .../Charts/ChartOptions/PieChartOptions.cs | 1 + .../ChartOptions/PolarAreaChartOptions.cs | 1 + .../ChartOptions/ScatterChartOptions.cs | 11 ++ .../Charts/ChartPlugins/BarChartPlugins.cs | 35 ++++ .../Charts/ChartPlugins/BubbleChartPlugins.cs | 46 +++++ .../Charts/ChartPlugins/ChartPlugins.cs | 147 ++++++++++++++ .../ChartPlugins/DoughnutChartPlugins.cs | 63 ++++++ .../Charts/ChartPlugins/LineChartPlugins.cs | 49 +++++ .../Charts/ChartPlugins/PieChartPlugins.cs | 63 ++++++ .../ChartPlugins/PolarAreaChartPlugins.cs | 63 ++++++ .../ChartPlugins/ScatterChartPlugins.cs | 49 +++++ blazorbootstrap/Models/Charts/ChartRGB.cs | 7 + blazorbootstrap/Models/Charts/ChartRGBA.cs | 8 + 40 files changed, 1068 insertions(+), 1 deletion(-) diff --git a/blazorbootstrap/Models/Charts/ChartData.cs b/blazorbootstrap/Models/Charts/ChartData.cs index 0b3f65fe8..8041b8d32 100644 --- a/blazorbootstrap/Models/Charts/ChartData.cs +++ b/blazorbootstrap/Models/Charts/ChartData.cs @@ -1,5 +1,9 @@ namespace BlazorBootstrap; +/// +/// Represents the data payload for a chart. +/// +[AddedVersion("1.0.0")] public class ChartData { #region Properties, Indexers @@ -8,6 +12,8 @@ public class ChartData /// 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; } @@ -15,6 +21,8 @@ public class ChartData /// 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; } diff --git a/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDataset.cs index a73766689..c571eb249 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDataset.cs @@ -26,6 +26,8 @@ public BarChartDataset() /// /// Default value is 'rgba(0, 0, 0, 0.1)'. /// + [DefaultValue("rgba(0, 0, 0, 0.1)")] + [Description("Gets or sets the bar background color.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? BackgroundColor { get; set; } @@ -36,6 +38,8 @@ public BarChartDataset() /// /// Default value is 0.9. /// + [DefaultValue(0.9d)] + [Description("Gets or sets the percentage of the category width used by each bar.")] public double BarPercentage { get; set; } = 0.9; /// @@ -46,6 +50,8 @@ public BarChartDataset() /// 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; } @@ -55,6 +61,8 @@ public BarChartDataset() /// /// Default value is 'rgba(0, 0, 0, 0.1)'. /// + [DefaultValue("rgba(0, 0, 0, 0.1)")] + [Description("Gets or sets the bar border color.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? BorderColor { get; set; } @@ -65,6 +73,8 @@ public BarChartDataset() /// Default value is 0. /// [AddedVersion("3.0.0")] + [DefaultValue(0)] + [Description("Gets or sets the bar border radius.")] public List? BorderRadius { get; set; } /// @@ -73,6 +83,8 @@ public BarChartDataset() /// /// Default value is 0. /// + [DefaultValue(0)] + [Description("Gets or sets the border width in pixels.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? BorderWidth { get; set; } @@ -85,9 +97,12 @@ public BarChartDataset() /// /// Default value is 0.8. /// + [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 @@ -101,6 +116,8 @@ public BarChartDataset() /// 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; /// @@ -109,6 +126,8 @@ public BarChartDataset() /// /// Default value is . /// + [DefaultValue(null)] + [Description("Gets or sets the bar background color when hovered.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? HoverBackgroundColor { get; set; } @@ -118,6 +137,8 @@ public BarChartDataset() /// /// Default value is . /// + [DefaultValue(null)] + [Description("Gets or sets the bar border color when hovered.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? HoverBorderColor { get; set; } @@ -128,6 +149,8 @@ public BarChartDataset() /// 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; } @@ -137,6 +160,8 @@ public BarChartDataset() /// /// Default value is 1. /// + [DefaultValue(1)] + [Description("Gets or sets the hovered bar border width in pixels.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? HoverBorderWidth { get; set; } @@ -148,6 +173,8 @@ public BarChartDataset() /// 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; } @@ -161,6 +188,8 @@ public BarChartDataset() /// 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; } @@ -171,6 +200,8 @@ public BarChartDataset() /// 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; } @@ -185,6 +216,8 @@ public BarChartDataset() /// 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 @@ -196,6 +229,8 @@ public BarChartDataset() /// /// Default value is first x axis. /// + [DefaultValue("first x axis")] + [Description("Gets or sets the x-axis identifier for the dataset.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? XAxisID { get; set; } @@ -205,10 +240,16 @@ public BarChartDataset() /// /// Default value is first y axis. /// + [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 index dbefa0865..52df7ea65 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDatasetData.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDatasetData.cs @@ -1,5 +1,9 @@ namespace BlazorBootstrap; +/// +/// Represents a bar chart data item for dynamic updates. +/// +[AddedVersion("1.10.0")] public record BarChartDatasetData : ChartDatasetData { #region Constructors diff --git a/blazorbootstrap/Models/Charts/ChartDataset/BubbleChart/BubbleChartDataPoint.cs b/blazorbootstrap/Models/Charts/ChartDataset/BubbleChart/BubbleChartDataPoint.cs index 61c04ca45..d3946d7f9 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/BubbleChart/BubbleChartDataPoint.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/BubbleChart/BubbleChartDataPoint.cs @@ -3,4 +3,5 @@ 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 index cb07739bc..83446603c 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/BubbleChart/BubbleChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/BubbleChart/BubbleChartDataset.cs @@ -21,58 +21,86 @@ public BubbleChartDataset() #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 index 1b04c4c73..ea3bef763 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/BubbleChart/BubbleChartDatasetData.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/BubbleChart/BubbleChartDatasetData.cs @@ -1,5 +1,8 @@ namespace BlazorBootstrap; +/// +/// Represents a bubble chart data item for dynamic updates. +/// [AddedVersion("4.0.0")] public record BubbleChartDatasetData : ChartDatasetData { diff --git a/blazorbootstrap/Models/Charts/ChartDataset/ChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/ChartDataset.cs index 8e1e8d894..4fa01ea31 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/ChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/ChartDataset.cs @@ -5,6 +5,7 @@ public interface IChartDataset { } /// /// /// +[AddedVersion("1.0.0")] public class ChartDataset : IChartDataset { #region Constructors @@ -24,6 +25,8 @@ public ChartDataset() /// . /// [AddedVersion("4.0.0")] + [DefaultValue(null)] + [Description("Gets or sets the dataset animation configuration.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public ChartAnimation? Animation { get; set; } @@ -36,6 +39,8 @@ public ChartDataset() /// 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; } @@ -46,6 +51,8 @@ public ChartDataset() /// 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; } @@ -56,21 +63,26 @@ public ChartDataset() /// 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 . + /// 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. /// + [Description("Gets the unique object identifier.")] public Guid Oid { get; private set; } /// @@ -80,6 +92,8 @@ public ChartDataset() /// Default value is 0. /// [AddedVersion("3.0.0")] + [DefaultValue(0)] + [Description("Gets or sets the dataset drawing order.")] public int Order { get; set; } /// @@ -88,6 +102,8 @@ public ChartDataset() /// . /// [AddedVersion("4.0.0")] + [DefaultValue(null)] + [Description("Gets or sets the dataset stack identifier.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? Stack { get; set; } @@ -97,6 +113,9 @@ public ChartDataset() /// /// 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; } diff --git a/blazorbootstrap/Models/Charts/ChartDataset/ChartDatasetData.cs b/blazorbootstrap/Models/Charts/ChartDataset/ChartDatasetData.cs index 59b21517f..c040fa9d1 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/ChartDatasetData.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/ChartDatasetData.cs @@ -2,10 +2,19 @@ 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; @@ -16,8 +25,20 @@ public ChartDatasetData(string? datasetLabel, object? data) #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/DoughnutChart/DoughnutChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/DoughnutChart/DoughnutChartDataset.cs index 2ebef829b..dad707d39 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/DoughnutChart/DoughnutChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/DoughnutChart/DoughnutChartDataset.cs @@ -16,6 +16,8 @@ public class DoughnutChartDataset : ChartDataset /// /// Default value is 'rgba(0, 0, 0, 0.1)'. /// + [DefaultValue("rgba(0, 0, 0, 0.1)")] + [Description("Gets or sets the arc background color.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? BackgroundColor { get; set; } @@ -28,6 +30,8 @@ public class DoughnutChartDataset : ChartDataset /// 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 @@ -37,6 +41,8 @@ public class DoughnutChartDataset : ChartDataset /// /// Default value is '#fff'. /// + [DefaultValue("#fff")] + [Description("Gets or sets the arc border color.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? BorderColor { get; set; } @@ -47,6 +53,8 @@ public class DoughnutChartDataset : ChartDataset /// 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; } @@ -57,6 +65,8 @@ public class DoughnutChartDataset : ChartDataset /// 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; } /// @@ -67,6 +77,8 @@ public class DoughnutChartDataset : ChartDataset /// 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 @@ -77,6 +89,8 @@ public class DoughnutChartDataset : ChartDataset /// 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; } @@ -86,6 +100,8 @@ public class DoughnutChartDataset : ChartDataset /// /// Default value is 2. /// + [DefaultValue(2)] + [Description("Gets or sets the arc border width in pixels.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? BorderWidth { get; set; } @@ -96,10 +112,13 @@ public class DoughnutChartDataset : ChartDataset /// 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 @@ -109,6 +128,8 @@ public class DoughnutChartDataset : ChartDataset /// /// Default value is . /// + [DefaultValue(null)] + [Description("Gets or sets the arc background color when hovered.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? HoverBackgroundColor { get; set; } @@ -118,6 +139,8 @@ public class DoughnutChartDataset : ChartDataset /// /// Default value is . /// + [DefaultValue(null)] + [Description("Gets or sets the arc border color when hovered.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? HoverBorderColor { get; set; } @@ -128,6 +151,8 @@ public class DoughnutChartDataset : ChartDataset /// 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; } @@ -138,6 +163,8 @@ public class DoughnutChartDataset : ChartDataset /// 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; } @@ -149,6 +176,8 @@ public class DoughnutChartDataset : ChartDataset /// 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 @@ -159,6 +188,8 @@ public class DoughnutChartDataset : ChartDataset /// 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; } @@ -169,6 +200,8 @@ public class DoughnutChartDataset : ChartDataset /// 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; } @@ -179,6 +212,8 @@ public class DoughnutChartDataset : ChartDataset /// 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; } @@ -189,6 +224,8 @@ public class DoughnutChartDataset : ChartDataset /// 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; } @@ -199,6 +236,8 @@ public class DoughnutChartDataset : ChartDataset /// 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; } /// @@ -210,9 +249,15 @@ public class DoughnutChartDataset : ChartDataset /// 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 index 0749b0d39..41d660077 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/DoughnutChart/DoughnutChartDatasetData.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/DoughnutChart/DoughnutChartDatasetData.cs @@ -1,5 +1,9 @@ namespace BlazorBootstrap; +/// +/// Represents a doughnut chart data item for dynamic updates. +/// +[AddedVersion("1.10.0")] public record DoughnutChartDatasetData : ChartDatasetData { #region Constructors @@ -13,6 +17,10 @@ public DoughnutChartDatasetData(string? datasetLabel, double data, string? backg #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 index 8b01d2ba5..8422fd2ad 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/LineChart/LineChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/LineChart/LineChartDataset.cs @@ -475,4 +475,8 @@ public LineChartDataset FillToValue(double value) #endregion } +/// +/// Represents data label options for a line chart dataset. +/// +[AddedVersion("1.10.2")] public class LineChartDatasetDataLabels : ChartDatasetDataLabels { } diff --git a/blazorbootstrap/Models/Charts/ChartDataset/LineChart/LineChartDatasetData.cs b/blazorbootstrap/Models/Charts/ChartDataset/LineChart/LineChartDatasetData.cs index ee728de11..919383c68 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/LineChart/LineChartDatasetData.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/LineChart/LineChartDatasetData.cs @@ -1,5 +1,9 @@ namespace BlazorBootstrap; +/// +/// Represents a line chart data item for dynamic updates. +/// +[AddedVersion("1.10.0")] public record LineChartDatasetData : ChartDatasetData { #region Constructors diff --git a/blazorbootstrap/Models/Charts/ChartDataset/PieChart/PieChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/PieChart/PieChartDataset.cs index d26204ba7..a5e803a2f 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/PieChart/PieChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/PieChart/PieChartDataset.cs @@ -16,6 +16,8 @@ public class PieChartDataset : ChartDataset /// /// Default value is 'rgba(0, 0, 0, 0.1)'. /// + [DefaultValue("rgba(0, 0, 0, 0.1)")] + [Description("Gets or sets the arc background color.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? BackgroundColor { get; set; } @@ -28,6 +30,8 @@ public class PieChartDataset : ChartDataset /// 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 @@ -37,6 +41,8 @@ public class PieChartDataset : ChartDataset /// /// Default value is '#fff'. /// + [DefaultValue("#fff")] + [Description("Gets or sets the arc border color.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? BorderColor { get; set; } @@ -47,6 +53,8 @@ public class PieChartDataset : ChartDataset /// 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; } @@ -57,6 +65,8 @@ public class PieChartDataset : ChartDataset /// 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; } /// @@ -67,6 +77,8 @@ public class PieChartDataset : ChartDataset /// 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 @@ -77,6 +89,8 @@ public class PieChartDataset : ChartDataset /// 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; } @@ -86,6 +100,8 @@ public class PieChartDataset : ChartDataset /// /// Default value is 2. /// + [DefaultValue(2)] + [Description("Gets or sets the arc border width in pixels.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? BorderWidth { get; set; } @@ -96,10 +112,13 @@ public class PieChartDataset : ChartDataset /// 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 PieChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link @@ -109,6 +128,8 @@ public class PieChartDataset : ChartDataset /// /// Default value is . /// + [DefaultValue(null)] + [Description("Gets or sets the arc background color when hovered.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? HoverBackgroundColor { get; set; } @@ -118,6 +139,8 @@ public class PieChartDataset : ChartDataset /// /// Default value is . /// + [DefaultValue(null)] + [Description("Gets or sets the arc border color when hovered.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? HoverBorderColor { get; set; } @@ -128,6 +151,8 @@ public class PieChartDataset : ChartDataset /// 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; } @@ -138,6 +163,8 @@ public class PieChartDataset : ChartDataset /// 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; } @@ -149,6 +176,8 @@ public class PieChartDataset : ChartDataset /// 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 @@ -158,6 +187,8 @@ public class PieChartDataset : ChartDataset /// /// Default value is . /// + [DefaultValue(null)] + [Description("Gets or sets the hovered arc border width in pixels.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? HoverBorderWidth { get; set; } @@ -168,6 +199,8 @@ public class PieChartDataset : ChartDataset /// 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; } @@ -178,6 +211,8 @@ public class PieChartDataset : ChartDataset /// 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; } @@ -188,6 +223,8 @@ public class PieChartDataset : ChartDataset /// 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; } @@ -198,6 +235,8 @@ public class PieChartDataset : ChartDataset /// 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; } /// @@ -209,9 +248,15 @@ public class PieChartDataset : ChartDataset /// 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 pie chart dataset. +/// +[AddedVersion("1.10.2")] public class PieChartDatasetDataLabels : ChartDatasetDataLabels { } diff --git a/blazorbootstrap/Models/Charts/ChartDataset/PieChart/PieChartDatasetData.cs b/blazorbootstrap/Models/Charts/ChartDataset/PieChart/PieChartDatasetData.cs index 024a8564c..de991d296 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/PieChart/PieChartDatasetData.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/PieChart/PieChartDatasetData.cs @@ -1,5 +1,9 @@ namespace BlazorBootstrap; +/// +/// Represents a pie chart data item for dynamic updates. +/// +[AddedVersion("1.10.0")] public record PieChartDatasetData : ChartDatasetData { #region Constructors @@ -13,6 +17,10 @@ public PieChartDatasetData(string? datasetLabel, double data, string? background #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/PolarAreaChart/PolarAreaChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/PolarAreaChart/PolarAreaChartDataset.cs index 03a13ac3b..6a0adcde2 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/PolarAreaChart/PolarAreaChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/PolarAreaChart/PolarAreaChartDataset.cs @@ -11,6 +11,8 @@ public class PolarAreaChartDataset : ChartDataset /// /// Default value is 'rgba(0, 0, 0, 0.1)'. /// + [DefaultValue("rgba(0, 0, 0, 0.1)")] + [Description("Gets or sets the arc background color.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? BackgroundColor { get; set; } @@ -22,6 +24,8 @@ public class PolarAreaChartDataset : ChartDataset /// /// Default value is 'center'. /// + [DefaultValue("center")] + [Description("Gets or sets the arc border alignment.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? BorderAlign { get; set; } // TODO: change this to enum @@ -31,6 +35,8 @@ public class PolarAreaChartDataset : ChartDataset /// /// Default value is '#fff'. /// + [DefaultValue("#fff")] + [Description("Gets or sets the arc border color.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? BorderColor { get; set; } @@ -40,6 +46,8 @@ public class PolarAreaChartDataset : ChartDataset /// /// Default value is . /// + [DefaultValue(null)] + [Description("Gets or sets the arc border dash pattern.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? BorderDash { get; set; } @@ -49,6 +57,8 @@ public class PolarAreaChartDataset : ChartDataset /// /// Default value is 0.0. /// + [DefaultValue(0d)] + [Description("Gets or sets the arc border dash offset.")] public double BorderDashOffset { get; set; } /// @@ -58,6 +68,8 @@ public class PolarAreaChartDataset : ChartDataset /// /// Default value is . /// + [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 @@ -67,6 +79,8 @@ public class PolarAreaChartDataset : ChartDataset /// /// Default value is 2. /// + [DefaultValue(2)] + [Description("Gets or sets the arc border width in pixels.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? BorderWidth { get; set; } @@ -76,8 +90,12 @@ public class PolarAreaChartDataset : ChartDataset /// /// Default value is . /// + [DefaultValue(true)] + [Description("Gets or sets a value indicating whether arcs are drawn as circles.")] public bool Circular { get; set; } = true; + [AddedVersion("3.0.0")] + [Description("Gets or sets the dataset data label configuration.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public PieChartDatasetDataLabels Datalabels { get; set; } = new(); @@ -87,6 +105,8 @@ public class PolarAreaChartDataset : ChartDataset /// /// Default value is . /// + [DefaultValue(null)] + [Description("Gets or sets the arc background color when hovered.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? HoverBackgroundColor { get; set; } @@ -96,6 +116,8 @@ public class PolarAreaChartDataset : ChartDataset /// /// Default value is . /// + [DefaultValue(null)] + [Description("Gets or sets the arc border color when hovered.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? HoverBorderColor { get; set; } @@ -105,6 +127,8 @@ public class PolarAreaChartDataset : ChartDataset /// /// Default value is . /// + [DefaultValue(null)] + [Description("Gets or sets the hovered arc border dash pattern.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? HoverBorderDash { get; set; } @@ -114,6 +138,8 @@ public class PolarAreaChartDataset : ChartDataset /// /// Default value is . /// + [DefaultValue(null)] + [Description("Gets or sets the hovered arc border dash offset.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public double? HoverBorderDashOffset { get; set; } @@ -124,6 +150,8 @@ public class PolarAreaChartDataset : ChartDataset /// /// Default value is . /// + [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 @@ -133,11 +161,16 @@ public class PolarAreaChartDataset : ChartDataset /// /// Default value is . /// + [DefaultValue(null)] + [Description("Gets or sets the hovered arc border width in pixels.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? HoverBorderWidth { get; set; } #endregion } +/// +/// Represents data label options for a polar area chart dataset. +/// [AddedVersion("3.0.0")] public class PolarAreaChartDatasetDataLabels : ChartDatasetDataLabels { } diff --git a/blazorbootstrap/Models/Charts/ChartDataset/PolarAreaChart/PolarAreaChartDatasetData.cs b/blazorbootstrap/Models/Charts/ChartDataset/PolarAreaChart/PolarAreaChartDatasetData.cs index 024baf6ab..8669241c0 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/PolarAreaChart/PolarAreaChartDatasetData.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/PolarAreaChart/PolarAreaChartDatasetData.cs @@ -1,5 +1,9 @@ namespace BlazorBootstrap; +/// +/// Represents a polar area chart data item for dynamic updates. +/// +[AddedVersion("3.0.0")] public record PolarAreaChartDatasetData : ChartDatasetData { #region Constructors @@ -18,7 +22,15 @@ public PolarAreaChartDatasetData( #region Properties, Indexers + /// + /// Gets the background color for the generated segment. + /// + [AddedVersion("3.0.0")] public string? BackgroundColor { get; init; } + /// + /// Gets the border color for the generated segment. + /// + [AddedVersion("3.0.0")] public string? BorderColor { get; init; } #endregion diff --git a/blazorbootstrap/Models/Charts/ChartDataset/RadarChart/RadarChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/RadarChart/RadarChartDataset.cs index bd8543083..54063c4a0 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/RadarChart/RadarChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/RadarChart/RadarChartDataset.cs @@ -269,5 +269,8 @@ public class RadarChartDataset : ChartDataset #endregion } +/// +/// Represents data label options for a radar chart dataset. +/// [AddedVersion("3.0.0")] public class RadarChartDatasetDataLabels : ChartDatasetDataLabels { } diff --git a/blazorbootstrap/Models/Charts/ChartDataset/RadarChart/RadarChartDatasetData.cs b/blazorbootstrap/Models/Charts/ChartDataset/RadarChart/RadarChartDatasetData.cs index b2440574a..9672467dd 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/RadarChart/RadarChartDatasetData.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/RadarChart/RadarChartDatasetData.cs @@ -1,5 +1,9 @@ namespace BlazorBootstrap; +/// +/// Represents a radar chart data item for dynamic updates. +/// +[AddedVersion("3.0.0")] public record RadarChartDatasetData : ChartDatasetData { #region Constructors @@ -18,7 +22,15 @@ public RadarChartDatasetData( #region Properties, Indexers + /// + /// Gets the background color for the generated point. + /// + [AddedVersion("3.0.0")] public string? BackgroundColor { get; init; } + /// + /// Gets the border color for the generated point. + /// + [AddedVersion("3.0.0")] public string? BorderColor { get; init; } #endregion diff --git a/blazorbootstrap/Models/Charts/ChartDataset/ScatterChart/ScatterChartDataPoint.cs b/blazorbootstrap/Models/Charts/ChartDataset/ScatterChart/ScatterChartDataPoint.cs index 295eb4016..4199500a9 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/ScatterChart/ScatterChartDataPoint.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/ScatterChart/ScatterChartDataPoint.cs @@ -1,3 +1,9 @@ namespace BlazorBootstrap; +/// +/// Represents a scatter chart data point. +/// +/// The x-axis value. +/// The y-axis value. +[AddedVersion("3.0.0")] public record ScatterChartDataPoint(double X, double Y); diff --git a/blazorbootstrap/Models/Charts/ChartDataset/ScatterChart/ScatterChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/ScatterChart/ScatterChartDataset.cs index e45727f0c..562a04086 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/ScatterChart/ScatterChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/ScatterChart/ScatterChartDataset.cs @@ -339,5 +339,8 @@ public class ScatterChartDataset : ChartDataset #endregion } +/// +/// Represents data label options for a scatter chart dataset. +/// [AddedVersion("3.0.0")] public class ScatterChartDatasetDataLabels : ChartDatasetDataLabels { } diff --git a/blazorbootstrap/Models/Charts/ChartDataset/ScatterChart/ScatterChartDatasetData.cs b/blazorbootstrap/Models/Charts/ChartDataset/ScatterChart/ScatterChartDatasetData.cs index e5c2bbfec..60eee9cf1 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/ScatterChart/ScatterChartDatasetData.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/ScatterChart/ScatterChartDatasetData.cs @@ -1,5 +1,9 @@ namespace BlazorBootstrap; +/// +/// Represents a scatter chart data item for dynamic updates. +/// +[AddedVersion("3.0.0")] public record ScatterChartDatasetData : ChartDatasetData { #region Constructors diff --git a/blazorbootstrap/Models/Charts/ChartLabel.cs b/blazorbootstrap/Models/Charts/ChartLabel.cs index b08722e26..4edab17ae 100644 --- a/blazorbootstrap/Models/Charts/ChartLabel.cs +++ b/blazorbootstrap/Models/Charts/ChartLabel.cs @@ -1,3 +1,7 @@ namespace BlazorBootstrap; +/// +/// Represents a chart label model. +/// +[AddedVersion("1.0.0")] public class ChartLabel { } diff --git a/blazorbootstrap/Models/Charts/ChartOptions/BarChartOptions.cs b/blazorbootstrap/Models/Charts/ChartOptions/BarChartOptions.cs index b3545f028..72f0f6387 100644 --- a/blazorbootstrap/Models/Charts/ChartOptions/BarChartOptions.cs +++ b/blazorbootstrap/Models/Charts/ChartOptions/BarChartOptions.cs @@ -17,16 +17,25 @@ public class BarChartOptions : ChartOptions /// Default value is . /// [AddedVersion("1.0.0")] + [DefaultValue(null)] + [Description("Gets or sets the base axis of the chart.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? IndexAxis { get; set; } + [AddedVersion("1.0.0")] + [Description("Gets or sets the interaction configuration.")] public Interaction Interaction { get; set; } = new(); + [AddedVersion("1.0.0")] + [Description("Gets or sets the layout configuration.")] public ChartLayout Layout { get; set; } = new(); [AddedVersion("1.10.2")] + [Description("Gets or sets the plugin configuration.")] public BarChartPlugins Plugins { get; set; } = new(); + [AddedVersion("1.0.0")] + [Description("Gets or sets the scale configuration.")] public Scales Scales { get; set; } = new(); #endregion diff --git a/blazorbootstrap/Models/Charts/ChartOptions/BubbleChartOptions.cs b/blazorbootstrap/Models/Charts/ChartOptions/BubbleChartOptions.cs index cf79066f6..83f18f33c 100644 --- a/blazorbootstrap/Models/Charts/ChartOptions/BubbleChartOptions.cs +++ b/blazorbootstrap/Models/Charts/ChartOptions/BubbleChartOptions.cs @@ -6,19 +6,25 @@ public class BubbleChartOptions : ChartOptions #region Properties, Indexers [AddedVersion("4.0.0")] + [DefaultValue(null)] + [Description("Gets or sets the base axis of the dataset.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? IndexAxis { get; set; } [AddedVersion("4.0.0")] + [Description("Gets or sets the interaction configuration.")] public Interaction Interaction { get; set; } = new(); [AddedVersion("4.0.0")] + [Description("Gets or sets the layout configuration.")] public ChartLayout Layout { get; set; } = new(); [AddedVersion("4.0.0")] + [Description("Gets or sets the plugin configuration.")] public BubbleChartPlugins Plugins { get; set; } = new(); [AddedVersion("4.0.0")] + [Description("Gets or sets the scale configuration.")] public Scales Scales { get; set; } = new(); #endregion diff --git a/blazorbootstrap/Models/Charts/ChartOptions/ChartOptions.cs b/blazorbootstrap/Models/Charts/ChartOptions/ChartOptions.cs index 2db539e1b..593d12300 100644 --- a/blazorbootstrap/Models/Charts/ChartOptions/ChartOptions.cs +++ b/blazorbootstrap/Models/Charts/ChartOptions/ChartOptions.cs @@ -5,6 +5,7 @@ public interface IChartOptions { } /// /// /// +[AddedVersion("1.0.0")] public class ChartOptions : IChartOptions { #region Properties, Indexers @@ -15,6 +16,8 @@ public class ChartOptions : IChartOptions /// . /// [AddedVersion("4.0.0")] + [DefaultValue(null)] + [Description("Gets or sets the chart animation configuration.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public ChartAnimation? Animation { get; set; } @@ -23,6 +26,8 @@ public class ChartOptions : IChartOptions /// . /// [AddedVersion("4.0.0")] + [DefaultValue(null)] + [Description("Gets or sets the canvas aspect ratio.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public double? AspectRatio { get; set; } @@ -31,6 +36,8 @@ public class ChartOptions : IChartOptions /// By default, the chart is using the default locale of the platform which is running on. /// [AddedVersion("1.10.0")] + [DefaultValue(null)] + [Description("Gets or sets the locale.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? Locale { get; set; } @@ -42,6 +49,8 @@ public class ChartOptions : IChartOptions /// Default value is . /// [AddedVersion("3.0.0")] + [DefaultValue(true)] + [Description("Gets or sets a value indicating whether the original canvas aspect ratio is maintained while resizing.")] public bool MaintainAspectRatio { get; set; } = true; //onResize @@ -52,6 +61,8 @@ public class ChartOptions : IChartOptions /// . /// [AddedVersion("4.0.0")] + [DefaultValue(null)] + [Description("Gets or sets the resize delay in milliseconds.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public int? ResizeDelay { get; set; } @@ -63,6 +74,8 @@ public class ChartOptions : IChartOptions /// Default value is . /// [AddedVersion("1.0.0")] + [DefaultValue(false)] + [Description("Gets or sets a value indicating whether the chart resizes with its container.")] public bool Responsive { get; set; } #endregion @@ -72,6 +85,7 @@ public class ChartOptions : IChartOptions /// Namespace: options.layout, the global options for the chart layout is defined in Chart.defaults.layout. /// . /// +[AddedVersion("1.0.0")] public class ChartLayout { #region Properties, Indexers @@ -82,11 +96,15 @@ public class ChartLayout /// /// Default value is . /// + [DefaultValue(true)] + [Description("Gets or sets a value indicating whether automatic padding is applied.")] public bool AutoPadding { get; set; } = true; /// /// The padding to add inside the chart. /// + [DefaultValue(0)] + [Description("Gets or sets the padding inside the chart.")] public int Padding { get; set; } = 0; #endregion @@ -96,6 +114,7 @@ public class ChartLayout /// Namespace: options.interaction, the global interaction configuration is at Chart.defaults.interaction. /// . /// +[AddedVersion("1.0.0")] public class Interaction { #region Fields and Constants @@ -148,6 +167,8 @@ private void SetAxis(InteractionAxis? interactionAxis) => /// . /// [AddedVersion("4.0.0")] + [DefaultValue(null)] + [Description("Gets the serialized interaction axis value.")] [JsonPropertyName("axis")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? ChartInteractionAxis { get; private set; } @@ -156,6 +177,8 @@ private void SetAxis(InteractionAxis? interactionAxis) => /// Sets which elements appear in the interaction. /// [AddedVersion("1.0.0")] + [DefaultValue("nearest")] + [Description("Gets the serialized interaction mode value.")] [JsonPropertyName("mode")] public string ChartInteractionMode { get; private set; } = string.Empty; @@ -166,6 +189,8 @@ private void SetAxis(InteractionAxis? interactionAxis) => /// Default value is . /// [AddedVersion("1.0.0")] + [DefaultValue(true)] + [Description("Gets or sets a value indicating whether interactions require intersection with a chart item.")] public bool Intersect { get; set; } = true; /// @@ -173,6 +198,8 @@ private void SetAxis(InteractionAxis? interactionAxis) => /// . /// [AddedVersion("4.0.0")] + [DefaultValue(null)] + [Description("Gets or sets a value indicating whether invisible points are included in interactions.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public bool? IncludeInvisible { get; set; } @@ -180,6 +207,8 @@ private void SetAxis(InteractionAxis? interactionAxis) => /// Defines which directions are used in calculating distances for interactions. /// [AddedVersion("4.0.0")] + [DefaultValue(null)] + [Description("Gets or sets the interaction axis.")] [JsonIgnore] public InteractionAxis? Axis { @@ -195,6 +224,8 @@ public InteractionAxis? Axis /// Sets which elements appear in the tooltip. See Interaction Modes for details. /// [AddedVersion("1.0.0")] + [DefaultValue(InteractionMode.Nearest)] + [Description("Gets or sets the interaction mode.")] [JsonIgnore] public InteractionMode Mode { @@ -269,17 +300,33 @@ public enum InteractionMode Y } +/// +/// Represents the cartesian axis configuration for a chart. +/// +[AddedVersion("1.0.0")] public class Scales { #region Properties, Indexers + /// + /// Gets or sets the x-axis configuration. + /// + [Description("Gets or sets the x-axis configuration.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public ChartAxes? X { get; set; } = new(); + /// + /// Gets or sets the y-axis configuration. + /// + [Description("Gets or sets the y-axis configuration.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public ChartAxes? Y { get; set; } = new(); #endregion } +/// +/// Provides built-in chart axis type names. +/// +[AddedVersion("1.0.0")] public class ChartAxesType { #region Fields and Constants @@ -293,33 +340,50 @@ public class ChartAxesType #endregion } +/// +/// Represents the configuration for a chart axis. +/// +[AddedVersion("1.0.0")] public class ChartAxes { #region Properties, Indexers + /// + /// If , the scale begins at zero. + /// + [DefaultValue(true)] + [Description("Gets or sets a value indicating whether the scale begins at zero.")] public bool BeginAtZero { get; set; } = true; /// /// Define options for the border that run perpendicular to the axis. /// + [DefaultValue(null)] + [Description("Gets or sets the border configuration.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public ChartAxesBorder? Border { get; set; } /// /// Gets or sets the grid configuration. /// + [DefaultValue(null)] + [Description("Gets or sets the grid configuration.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public ChartAxesGrid? Grid { get; set; } /// /// User defined maximum number for the scale, overrides maximum value from data. /// + [DefaultValue(null)] + [Description("Gets or sets the maximum scale value.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public double? Max { get; set; } /// /// User defined minimum number for the scale, overrides minimum value from data. /// + [DefaultValue(null)] + [Description("Gets or sets the minimum scale value.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public double? Min { get; set; } @@ -329,29 +393,42 @@ public class ChartAxes /// If the stacked option of the value scale (y-axis on horizontal chart) is true, positive and negative values are stacked /// separately. /// + /// + /// If , the axis values are stacked. + /// + [DefaultValue(false)] + [Description("Gets or sets a value indicating whether the axis values are stacked.")] public bool Stacked { get; set; } /// /// Adjustment used when calculating the maximum data value. /// + [DefaultValue(null)] + [Description("Gets or sets the suggested maximum scale value.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public double? SuggestedMax { get; set; } /// /// Adjustment used when calculating the minimum data value. /// + [DefaultValue(null)] + [Description("Gets or sets the suggested minimum scale value.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public double? SuggestedMin { get; set; } /// /// Gets or sets the tick configuration. /// + [DefaultValue(null)] + [Description("Gets or sets the tick configuration.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public ChartAxesTicks? Ticks { get; set; } /// /// Gets or sets the title configuration. /// + [DefaultValue(null)] + [Description("Gets or sets the axis title configuration.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public ChartAxesTitle? Title { get; set; } @@ -361,6 +438,8 @@ public class ChartAxes /// /// Default value is . /// + [DefaultValue(null)] + [Description("Gets or sets the axis type.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? Type { get; set; } @@ -371,6 +450,7 @@ public class ChartAxes /// Define options for the border that run perpendicular to the axis. /// /// +[AddedVersion("1.0.0")] public class ChartAxesBorder { #region Properties, Indexers @@ -378,6 +458,8 @@ public class ChartAxesBorder /// /// The color of the border line. /// + [DefaultValue(null)] + [Description("Gets or sets the border line color.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? Color { get; set; } @@ -387,6 +469,8 @@ public class ChartAxesBorder /// [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? Dash { get; set; } + [DefaultValue(null)] + [Description("Gets or sets the border dash pattern.")] /// /// Offset for line dashes. @@ -394,23 +478,31 @@ public class ChartAxesBorder /// [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public int? DashOffset { get; set; } + [DefaultValue(null)] + [Description("Gets or sets the border dash offset.")] /// /// If , draw a border at the edge between the axis and the chart area. /// public bool Display { get; set; } = true; + [DefaultValue(true)] + [Description("Gets or sets a value indicating whether the axis border is displayed.")] /// /// The width of the border line. /// [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public int? Width { get; set; } + [DefaultValue(null)] + [Description("Gets or sets the border width.")] /// /// z-index of the border layer. Values <= 0 are drawn under datasets, > 0 on top. /// [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public int? Z { get; set; } + [DefaultValue(null)] + [Description("Gets or sets the border z-index.")] #endregion } @@ -419,6 +511,7 @@ public class ChartAxesBorder /// Defines options for the grid lines that run perpendicular to the axis. /// /// +[AddedVersion("1.0.0")] public class ChartAxesGrid { #region Properties, Indexers @@ -426,76 +519,102 @@ public class ChartAxesGrid /// /// If , gridlines are circular (on radar and polar area charts only). /// + [DefaultValue(null)] + [Description("Gets or sets a value indicating whether grid lines are circular.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public bool? Circular { get; set; } /// /// Color of the grid axis lines. Here one can write a CSS method or even a JavaScript method for a dynamic color. /// + [DefaultValue(null)] + [Description("Gets or sets the grid line color.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? Color { get; set; } /// /// If false, do not display grid lines for this axis. /// + [DefaultValue(true)] + [Description("Gets or sets a value indicating whether grid lines are displayed.")] public bool Display { get; set; } = true; /// /// If , draw lines on the chart area inside the axis lines. This is useful when there are multiple /// axes and you need to control which grid lines are drawn. /// + [DefaultValue(true)] + [Description("Gets or sets a value indicating whether grid lines are drawn on the chart area.")] public bool DrawOnChartArea { get; set; } = true; /// /// If , draw lines beside the ticks in the axis area beside the chart. /// + [DefaultValue(true)] + [Description("Gets or sets a value indicating whether tick lines are drawn.")] public bool DrawTicks { get; set; } = true; /// /// Stroke width of grid lines. /// + [DefaultValue(1)] + [Description("Gets or sets the grid line width.")] public int LineWidth { get; set; } = 1; /// /// If , grid lines will be shifted to be between labels. This is set to true for a bar chart by /// default. /// + [DefaultValue(false)] + [Description("Gets or sets a value indicating whether grid lines are offset between labels.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public bool? Offset { get; set; } = false; /// /// Length and spacing of the tick mark line. /// + [DefaultValue(null)] + [Description("Gets or sets the tick border dash pattern.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? TickBorderDash { get; set; } /// /// Offset for the line dash of the tick mark. /// + [DefaultValue(null)] + [Description("Gets or sets the tick border dash offset.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public int? TickBorderDashOffset { get; set; } /// /// Color of the tick line. If unset, defaults to the grid line color. /// + [DefaultValue(null)] + [Description("Gets or sets the tick line color.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? TickColor { get; set; } /// /// Length in pixels that the grid lines will draw into the axis area. /// + [DefaultValue(null)] + [Description("Gets or sets the tick length in pixels.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public int? TickLength { get; set; } /// /// Width of the tick mark in pixels. /// + [DefaultValue(null)] + [Description("Gets or sets the tick width in pixels.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public int? TickWidth { get; set; } /// /// z-index of the gridline layer. Values <= 0 are drawn under datasets, > 0 on top. /// + [DefaultValue(null)] + [Description("Gets or sets the grid line layer z-index.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public int? Z { get; set; } @@ -520,6 +639,7 @@ public enum TitleAlignment /// Chart axes tick styling /// /// +[AddedVersion("1.0.0")] public class ChartAxesTicks { #region Fields and Constants @@ -543,6 +663,8 @@ private void SetTicksAlignment(TicksAlignment interactionMode) => #region Properties, Indexers + [DefaultValue(null)] + [Description("Gets the serialized tick alignment value.")] [JsonPropertyName("align")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? Alignment { get; private set; } @@ -550,56 +672,76 @@ private void SetTicksAlignment(TicksAlignment interactionMode) => /// /// Color of label backdrops /// + [DefaultValue(null)] + [Description("Gets or sets the tick backdrop color.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? BackdropColor { get; set; } /// /// Padding of label backdrop /// + [DefaultValue(null)] + [Description("Gets or sets the tick backdrop padding.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public int? BackdropPadding { get; set; } /// /// Color of ticks /// + [DefaultValue(null)] + [Description("Gets or sets the tick color.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? Color { get; set; } /// /// If , show tick labels. /// + [DefaultValue(true)] + [Description("Gets or sets a value indicating whether tick labels are displayed.")] public bool Display { get; set; } = true; /// /// defines options for the major tick marks that are generated by the axis. /// + [DefaultValue(null)] + [Description("Gets or sets the major tick configuration.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public ChartAxesTicksMajor? Major { get; set; } /// /// Sets the offset of the tick labels from the axis /// + [DefaultValue(null)] + [Description("Gets or sets the tick label padding.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public int? Padding { get; set; } /// /// If , draw a background behind the tick labels. /// + [DefaultValue(null)] + [Description("Gets or sets a value indicating whether a backdrop is drawn behind tick labels.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public bool? ShowLabelBackdrop { get; set; } /// /// The color of the stroke around the text. /// + [DefaultValue(null)] + [Description("Gets or sets the tick text stroke color.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? TextStrokeColor { get; set; } /// /// Stroke width around the text. /// + [DefaultValue(null)] + [Description("Gets or sets the tick text stroke width.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public int? TextStrokeWidth { get; set; } + [DefaultValue(TicksAlignment.Center)] + [Description("Gets or sets the tick alignment.")] [JsonIgnore] public TicksAlignment TicksAlignment { @@ -617,6 +759,7 @@ public TicksAlignment TicksAlignment /// /// Defines options for the major tick marks that are generated by the axis. /// +[AddedVersion("1.0.0")] public class ChartAxesTicksMajor { #region Properties, Indexers @@ -625,6 +768,8 @@ public class ChartAxesTicksMajor /// If , major ticks are generated. A major tick will affect auto skipping and major will be defined /// on ticks in the scriptable options context. /// + [DefaultValue(false)] + [Description("Gets or sets a value indicating whether major ticks are generated.")] public bool Enabled { get; set; } = false; #endregion @@ -634,6 +779,7 @@ public class ChartAxesTicksMajor /// The chart title defines text to draw at the top of the chart. /// /// +[AddedVersion("1.0.0")] public class ChartAxesTitle { #region Fields and Constants @@ -661,6 +807,8 @@ private void SetTitleAlignment(TitleAlignment interactionMode) => /// Alignment of the title. /// Options are: 'start', 'center', and 'end' /// + [DefaultValue(null)] + [Description("Gets the serialized title alignment value.")] [JsonPropertyName("align")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? Alignment { get; private set; } @@ -668,22 +816,37 @@ private void SetTitleAlignment(TitleAlignment interactionMode) => /// /// Color of text. /// + [DefaultValue("black")] + [Description("Gets or sets the title text color.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? Color { get; set; } = "black"; /// /// Is the title shown? /// + [DefaultValue(false)] + [Description("Gets or sets a value indicating whether the title is displayed.")] public bool Display { get; set; } + /// + /// Gets or sets the font used to render the title. + /// + [Description("Gets or sets the font used to render the title.")] public ChartFont? Font { get; set; } = new(); //fullSize //padding //position + /// + /// Gets or sets the title text. + /// + [DefaultValue(null)] + [Description("Gets or sets the title text.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? Text { get; set; } + [DefaultValue(TitleAlignment.Center)] + [Description("Gets or sets the title alignment.")] [JsonIgnore] public TitleAlignment TitleAlignment { @@ -701,6 +864,7 @@ public TitleAlignment TitleAlignment /// /// /// +[AddedVersion("1.0.0")] public class ChartFont { #region Properties, Indexers @@ -709,6 +873,8 @@ public class ChartFont /// Default font family for all text, follows CSS font-family options. /// 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif /// + [DefaultValue(null)] + [Description("Gets or sets the font family.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? Family { get; set; } @@ -716,17 +882,23 @@ public class ChartFont /// Height of an individual line of text /// /// + [DefaultValue(1.2d)] + [Description("Gets or sets the font line height.")] public double LineHeight { get; set; } = 1.2; /// /// Default font size (in px) for text. Does not apply to radialLinear scale point labels. /// + [DefaultValue(12)] + [Description("Gets or sets the font size in pixels.")] public int Size { get; set; } = 12; /// /// Default font style. Does not apply to tooltip title or footer. Does not apply to chart title. /// Follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit). /// + [DefaultValue(null)] + [Description("Gets or sets the font style.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? Style { get; set; } @@ -734,6 +906,8 @@ public class ChartFont /// Default font weight (boldness). /// /// + [DefaultValue("bold")] + [Description("Gets or sets the font weight.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? Weight { get; set; } = "bold"; @@ -745,27 +919,36 @@ public class ChartFont /// A number of options are provided to configure how the animation looks and how long it takes. /// . /// +[AddedVersion("4.0.0")] public class ChartAnimation { /// /// Delay before starting the animations. /// + [DefaultValue(null)] + [Description("Gets or sets the animation delay.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public double? Delay { get; set; } /// /// The number of milliseconds an animation takes. /// + [DefaultValue(1000d)] + [Description("Gets or sets the animation duration in milliseconds.")] public double Duration { get; set; } = 1000; /// /// Easing function to use. /// + [DefaultValue("easeOutQuart")] + [Description("Gets or sets the animation easing function.")] public string Easing { get; set; } = "easeOutQuart"; /// /// If , the animations loop endlessly. /// + [DefaultValue(null)] + [Description("Gets or sets a value indicating whether the animation loops.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public bool? Loop { get; set; } } diff --git a/blazorbootstrap/Models/Charts/ChartOptions/DoughnutChartOptions.cs b/blazorbootstrap/Models/Charts/ChartOptions/DoughnutChartOptions.cs index 60e17058f..6a1736b1c 100644 --- a/blazorbootstrap/Models/Charts/ChartOptions/DoughnutChartOptions.cs +++ b/blazorbootstrap/Models/Charts/ChartOptions/DoughnutChartOptions.cs @@ -6,6 +6,7 @@ public class DoughnutChartOptions : ChartOptions #region Properties, Indexers [AddedVersion("1.10.2")] + [Description("Gets or sets the plugin configuration.")] public DoughnutChartPlugins Plugins { get; set; } = new(); #endregion diff --git a/blazorbootstrap/Models/Charts/ChartOptions/LineChartOptions.cs b/blazorbootstrap/Models/Charts/ChartOptions/LineChartOptions.cs index 1c40f4c45..3024a552b 100644 --- a/blazorbootstrap/Models/Charts/ChartOptions/LineChartOptions.cs +++ b/blazorbootstrap/Models/Charts/ChartOptions/LineChartOptions.cs @@ -16,16 +16,25 @@ public class LineChartOptions : ChartOptions /// 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; } + [AddedVersion("1.0.0")] + [Description("Gets or sets the interaction configuration.")] public Interaction Interaction { get; set; } = new(); + [AddedVersion("1.0.0")] + [Description("Gets or sets the layout configuration.")] public ChartLayout Layout { get; set; } = new(); [AddedVersion("1.10.2")] + [Description("Gets or sets the plugin configuration.")] public LineChartPlugins Plugins { get; set; } = new(); + [AddedVersion("1.0.0")] + [Description("Gets or sets the scale configuration.")] public Scales Scales { get; set; } = new(); #endregion diff --git a/blazorbootstrap/Models/Charts/ChartOptions/PieChartOptions.cs b/blazorbootstrap/Models/Charts/ChartOptions/PieChartOptions.cs index c68dc04dd..d851a42c0 100644 --- a/blazorbootstrap/Models/Charts/ChartOptions/PieChartOptions.cs +++ b/blazorbootstrap/Models/Charts/ChartOptions/PieChartOptions.cs @@ -6,6 +6,7 @@ public class PieChartOptions : ChartOptions #region Properties, Indexers [AddedVersion("1.10.2")] + [Description("Gets or sets the plugin configuration.")] public PieChartPlugins Plugins { get; set; } = new(); #endregion diff --git a/blazorbootstrap/Models/Charts/ChartOptions/PolarAreaChartOptions.cs b/blazorbootstrap/Models/Charts/ChartOptions/PolarAreaChartOptions.cs index 53bbf6e9c..8718cf72b 100644 --- a/blazorbootstrap/Models/Charts/ChartOptions/PolarAreaChartOptions.cs +++ b/blazorbootstrap/Models/Charts/ChartOptions/PolarAreaChartOptions.cs @@ -6,6 +6,7 @@ public class PolarAreaChartOptions : ChartOptions #region Properties, Indexers [AddedVersion("3.0.0")] + [Description("Gets or sets the plugin configuration.")] public PolarAreaChartPlugins Plugins { get; set; } = new(); #endregion diff --git a/blazorbootstrap/Models/Charts/ChartOptions/ScatterChartOptions.cs b/blazorbootstrap/Models/Charts/ChartOptions/ScatterChartOptions.cs index c7109283a..9ed5e2af6 100644 --- a/blazorbootstrap/Models/Charts/ChartOptions/ScatterChartOptions.cs +++ b/blazorbootstrap/Models/Charts/ChartOptions/ScatterChartOptions.cs @@ -15,15 +15,26 @@ public class ScatterChartOptions : ChartOptions /// /// Default value is 'x'. /// + [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; } + [AddedVersion("3.0.0")] + [Description("Gets or sets the interaction configuration.")] public Interaction Interaction { get; set; } = new(); + [AddedVersion("3.0.0")] + [Description("Gets or sets the layout configuration.")] public ChartLayout Layout { get; set; } = new(); + [AddedVersion("3.0.0")] + [Description("Gets or sets the plugin configuration.")] public ScatterChartPlugins Plugins { get; set; } = new(); + [AddedVersion("3.0.0")] + [Description("Gets or sets the scale configuration.")] public Scales Scales { get; set; } = new(); #endregion diff --git a/blazorbootstrap/Models/Charts/ChartPlugins/BarChartPlugins.cs b/blazorbootstrap/Models/Charts/ChartPlugins/BarChartPlugins.cs index 6f41733d3..edb91b584 100644 --- a/blazorbootstrap/Models/Charts/ChartPlugins/BarChartPlugins.cs +++ b/blazorbootstrap/Models/Charts/ChartPlugins/BarChartPlugins.cs @@ -1,28 +1,63 @@ namespace BlazorBootstrap; +/// +/// Represents plugin configuration for a bar chart. +/// +[AddedVersion("1.10.2")] public class BarChartPlugins : ChartPlugins { #region Properties, Indexers + /// + /// Gets or sets the data label plugin configuration. + /// + [AddedVersion("1.10.2")] + [Description("Gets or sets the data label plugin configuration.")] public BarChartDataLabels Datalabels { get; set; } = new(); #endregion } +/// +/// Represents the data label plugin configuration for a bar chart. +/// +[AddedVersion("1.10.2")] public class BarChartDataLabels { #region Properties, Indexers + /// + /// Gets or sets the label text color. + /// + [AddedVersion("1.10.2")] + [DefaultValue("white")] + [Description("Gets or sets the label text color.")] public string? Color { get; set; } = "white"; + + /// + /// Gets or sets the font configuration used for labels. + /// + [AddedVersion("1.10.2")] + [Description("Gets or sets the font configuration used for labels.")] public BarChartDataLabelsFont Font { get; set; } = new(); #endregion } +/// +/// Represents the font configuration for bar chart data labels. +/// +[AddedVersion("1.10.2")] public class BarChartDataLabelsFont { #region Properties, Indexers + /// + /// Gets or sets the label font weight. + /// + [AddedVersion("1.10.2")] + [DefaultValue("bold")] + [Description("Gets or sets the label font weight.")] public string? Weight { get; set; } = "bold"; #endregion diff --git a/blazorbootstrap/Models/Charts/ChartPlugins/BubbleChartPlugins.cs b/blazorbootstrap/Models/Charts/ChartPlugins/BubbleChartPlugins.cs index 58c42b08c..011a025bb 100644 --- a/blazorbootstrap/Models/Charts/ChartPlugins/BubbleChartPlugins.cs +++ b/blazorbootstrap/Models/Charts/ChartPlugins/BubbleChartPlugins.cs @@ -1,33 +1,79 @@ namespace BlazorBootstrap; +/// +/// Represents plugin configuration for a bubble chart. +/// +[AddedVersion("4.0.0")] public class BubbleChartPlugins : ChartPlugins { #region Properties, Indexers + /// + /// Gets or sets the data label plugin configuration. + /// + [AddedVersion("4.0.0")] + [Description("Gets or sets the data label plugin configuration.")] public BubbleChartDataLabels Datalabels { get; set; } = new(); #endregion } +/// +/// Represents the data label plugin configuration for a bubble chart. +/// +[AddedVersion("4.0.0")] public class BubbleChartDataLabels { #region Properties, Indexers + /// + /// Gets or sets the label border radius. + /// + [AddedVersion("4.0.0")] + [DefaultValue(4d)] + [Description("Gets or sets the label border radius.")] public double BorderRadius { get; set; } = 4; + /// + /// Gets or sets the label text color. + /// + [AddedVersion("4.0.0")] + [DefaultValue("white")] + [Description("Gets or sets the label text color.")] public string? Color { get; set; } = "white"; + /// + /// Gets or sets the font configuration used for labels. + /// + [AddedVersion("4.0.0")] + [Description("Gets or sets the font configuration used for labels.")] public BubbleChartDataLabelsFont Font { get; set; } = new(); + /// + /// Gets or sets the label padding. + /// + [AddedVersion("4.0.0")] + [DefaultValue(6d)] + [Description("Gets or sets the label padding.")] public double Padding { get; set; } = 6; #endregion } +/// +/// Represents the font configuration for bubble chart data labels. +/// +[AddedVersion("4.0.0")] public class BubbleChartDataLabelsFont { #region Properties, Indexers + /// + /// Gets or sets the label font weight. + /// + [AddedVersion("4.0.0")] + [DefaultValue("bold")] + [Description("Gets or sets the label font weight.")] public string? Weight { get; set; } = "bold"; #endregion diff --git a/blazorbootstrap/Models/Charts/ChartPlugins/ChartPlugins.cs b/blazorbootstrap/Models/Charts/ChartPlugins/ChartPlugins.cs index a1fc93897..2d8654227 100644 --- a/blazorbootstrap/Models/Charts/ChartPlugins/ChartPlugins.cs +++ b/blazorbootstrap/Models/Charts/ChartPlugins/ChartPlugins.cs @@ -1,5 +1,9 @@ namespace BlazorBootstrap; +/// +/// Represents the shared plugin configuration for a chart. +/// +[AddedVersion("1.10.2")] public class ChartPlugins { #region Properties, Indexers @@ -7,12 +11,14 @@ public class ChartPlugins /// /// The chart legend displays data about the datasets that are appearing on the chart. /// + [Description("Gets or sets the legend configuration.")] public ChartPluginsLegend Legend { get; set; } = new(); /// /// The chart title defines text to draw at the top of the chart. /// /// + [Description("Gets or sets the title configuration.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public ChartPluginsTitle? Title { get; set; } = new(); @@ -20,6 +26,8 @@ public class ChartPlugins /// Tooltip for the element. /// /// + [DefaultValue(null)] + [Description("Gets or sets the tooltip configuration.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public ChartPluginsTooltip? Tooltip { get; set; } @@ -28,6 +36,10 @@ public class ChartPlugins #endregion } +/// +/// Represents the legend configuration for a chart. +/// +[AddedVersion("1.10.2")] public class ChartPluginsLegend { #region Properties, Indexers @@ -35,88 +47,122 @@ public class ChartPluginsLegend /// /// Alignment of the legend. Default values is 'center'. Other possible values 'start' and 'end'. /// + [DefaultValue("center")] + [Description("Gets or sets the legend alignment.")] public string? Align { get; set; } = "center"; /// /// Is the legend shown? Default value is 'true'. /// + [DefaultValue(true)] + [Description("Gets or sets a value indicating whether the legend is displayed.")] public bool Display { get; set; } = true; /// /// If , Marks that this box should take the full width/height of the canvas (moving other boxes). This is unlikely to need to be changed in day-to-day use. /// + [DefaultValue(true)] + [Description("Gets or sets a value indicating whether the legend takes the full chart area in its dimension.")] public bool FullSize { get; set; } = true; /// /// Label settings for the legend. /// + [DefaultValue(null)] + [Description("Gets or sets the legend label configuration.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public ChartPluginsLegendLabels? Labels { get; set; } /// /// Maximum height of the legend, in pixels. /// + [DefaultValue(null)] + [Description("Gets or sets the maximum legend height in pixels.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public int? MaxHeight { get; set; } /// /// Maximum width of the legend, in pixels. /// + [DefaultValue(null)] + [Description("Gets or sets the maximum legend width in pixels.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public int? MaxWidth { get; set; } /// /// Position of the legend. Default value is 'top'. Other possible value is 'bottom'. /// + [DefaultValue("top")] + [Description("Gets or sets the legend position.")] public string Position { get; set; } = "top"; /// /// If , the Legend will show datasets in reverse order. /// + [DefaultValue(false)] + [Description("Gets or sets a value indicating whether legend items are rendered in reverse order.")] public bool Reverse { get; set; } = false; /// /// If , for rendering of the legends will go from right to left. /// + [DefaultValue(false)] + [Description("Gets or sets a value indicating whether the legend is rendered right-to-left.")] public bool Rtl { get; set; } = false; /// /// This will force the text direction 'rtl' or 'ltr' on the canvas for rendering the legend, regardless of the css specified on the canvas /// + [DefaultValue(null)] + [Description("Gets or sets the legend text direction.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? TextDirection { get; set; } /// /// Title object /// + [DefaultValue(null)] + [Description("Gets or sets the legend title configuration.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public ChartPluginsLegendTitle? Title { get; set; } #endregion } +/// +/// Represents the legend title configuration for a chart. +/// +[AddedVersion("1.10.2")] public class ChartPluginsLegendTitle { /// /// Color of the legend. Default value is 'black'. /// + [DefaultValue(null)] + [Description("Gets or sets the legend title color.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? Color { get; set; } /// /// Is the legend title displayed. /// + [DefaultValue(true)] + [Description("Gets or sets a value indicating whether the legend title is displayed.")] public bool Display { get; set; } = true; /// /// Padding around the title. /// + [DefaultValue(null)] + [Description("Gets or sets the padding around the legend title.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public int? Padding { get; set; } /// /// The string title /// + [DefaultValue(null)] + [Description("Gets or sets the legend title text.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? Text { get; set; } } @@ -125,61 +171,84 @@ public class ChartPluginsLegendTitle /// The chart label settings /// /// +[AddedVersion("1.10.2")] public class ChartPluginsLegendLabels { /// /// Width of coloured box. /// + [DefaultValue(null)] + [Description("Gets or sets the legend label box width.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public int? BoxWidth { get; set; } /// /// Height of the coloured box /// + [DefaultValue(null)] + [Description("Gets or sets the legend label box height.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public int? BoxHeight { get; set; } /// /// Override the borderRadius to use. /// + [DefaultValue(null)] + [Description("Gets or sets the legend label border radius.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public int? BorderRadius { get; set; } /// /// Color of label and the strikethrough. /// + [DefaultValue(null)] + [Description("Gets or sets the legend label color.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? Color { get; set; } + /// + /// Gets or sets the font used for legend labels. + /// + [DefaultValue(null)] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public ChartFont? Font { get; set; } /// /// Padding between rows of colored boxes. /// + [DefaultValue(null)] + [Description("Gets or sets the padding between legend rows.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public int? Padding { get; set; } /// /// If specified, this style of point is used for the legend. Only used if > is true. /// + [DefaultValue(null)] + [Description("Gets or sets the legend point style.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? PointStyle { get; set; } /// /// If is , the width of the point style used for the legend. /// + [DefaultValue(null)] + [Description("Gets or sets the legend point style width.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public int? PointStyleWidth { get; set; } /// /// Label borderRadius will match corresponding . /// + [DefaultValue(false)] + [Description("Gets or sets a value indicating whether legend border radii match dataset border radii.")] public bool UseBorderRadius { get; set; } = false; /// /// If , Label style will match corresponding point style (size is based on pointStyleWidth or the minimum value between and -> Size). /// + [DefaultValue(false)] + [Description("Gets or sets a value indicating whether legend labels use the dataset point style.")] public bool UsePointStyle { get; set; } = false; } @@ -188,6 +257,7 @@ public class ChartPluginsLegendLabels /// The chart title defines text to draw at the top of the chart. /// /// +[AddedVersion("1.10.2")] public class ChartPluginsTitle { #region Properties, Indexers @@ -196,19 +266,30 @@ public class ChartPluginsTitle /// Alignment of the title. /// Options are: 'start', 'center', and 'end' /// + [DefaultValue("center")] + [Description("Gets or sets the title alignment.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? Align { get; set; } = "center"; /// /// Color of text. /// + [DefaultValue("black")] + [Description("Gets or sets the title text color.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? Color { get; set; } = "black"; /// /// Is the title shown? /// + [DefaultValue(false)] + [Description("Gets or sets a value indicating whether the title is displayed.")] public bool Display { get; set; } + /// + /// Gets or sets the font used to render the title. + /// + [DefaultValue(null)] + [Description("Gets or sets the font used to render the title.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public ChartFont? Font { get; set; } @@ -216,6 +297,11 @@ public class ChartPluginsTitle //padding //position + /// + /// Gets or sets the title text. + /// + [DefaultValue(null)] + [Description("Gets or sets the title text.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? Text { get; set; } @@ -226,6 +312,7 @@ public class ChartPluginsTitle /// Tooltip for bubble, doughnut, pie, polar area, and scatter charts /// /// +[AddedVersion("1.10.2")] public class ChartPluginsTooltip { #region Properties, Indexers @@ -233,98 +320,147 @@ public class ChartPluginsTooltip /// /// Background color of the tooltip. /// + [DefaultValue("rgba(0, 0, 0, 0.8)")] + [Description("Gets or sets the tooltip background color.")] public string BackgroundColor { get; set; } = "rgba(0, 0, 0, 0.8)"; /// /// Horizontal alignment of the body text lines. left/right/center. /// + [DefaultValue("left")] + [Description("Gets or sets the tooltip body text alignment.")] public string BodyAlign { get; set; } = "left"; /// /// Color of body text. /// + [DefaultValue("#fff")] + [Description("Gets or sets the tooltip body text color.")] public string BodyColor { get; set; } = "#fff"; + /// + /// Gets or sets the font used for tooltip body text. + /// + [DefaultValue(null)] + [Description("Gets or sets the font used for tooltip body text.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public ChartPluginsTooltipFont? BodyFont { get; set; } /// /// Spacing to add to top and bottom of each tooltip item. /// + [DefaultValue(2)] + [Description("Gets or sets the spacing around tooltip body items.")] public int BodySpacing { get; set; } = 2; /// /// Extra distance to move the end of the tooltip arrow away from the tooltip point. /// + [DefaultValue(2)] + [Description("Gets or sets the tooltip caret padding.")] public int CaretPadding { get; set; } = 2; /// /// Size, in px, of the tooltip arrow. /// + [DefaultValue(5)] + [Description("Gets or sets the tooltip caret size in pixels.")] public int CaretSize { get; set; } = 5; /// /// If , color boxes are shown in the tooltip. /// + [DefaultValue(true)] + [Description("Gets or sets a value indicating whether color boxes are shown in the tooltip.")] public bool DisplayColors { get; set; } = true; /// /// Are on-canvas tooltips enabled? /// + [DefaultValue(true)] + [Description("Gets or sets a value indicating whether on-canvas tooltips are enabled.")] public bool Enabled { get; set; } = true; /// /// Horizontal alignment of the footer text lines. left/right/center. /// + [DefaultValue("left")] + [Description("Gets or sets the tooltip footer text alignment.")] public string FooterAlign { get; set; } = "left"; /// /// Color of footer text. /// + [DefaultValue("#fff")] + [Description("Gets or sets the tooltip footer text color.")] public string FooterColor { get; set; } = "#fff"; + /// + /// Gets or sets the font used for tooltip footer text. + /// + [Description("Gets or sets the font used for tooltip footer text.")] public ChartPluginsTooltipFont FooterFont { get; set; } = new(); /// /// Margin to add before drawing the footer. /// + [DefaultValue(6)] + [Description("Gets or sets the tooltip footer top margin.")] public int FooterMarginTop { get; set; } = 6; /// /// Spacing to add to top and bottom of each footer line. /// + [DefaultValue(2)] + [Description("Gets or sets the spacing around tooltip footer lines.")] public int FooterSpacing { get; set; } = 2; /// /// Horizontal alignment of the title text lines. left/right/center. /// + [DefaultValue("left")] + [Description("Gets or sets the tooltip title text alignment.")] public string TitleAlign { get; set; } = "left"; /// /// Color of title text. /// + [DefaultValue("#fff")] + [Description("Gets or sets the tooltip title text color.")] public string TitleColor { get; set; } = "#fff"; + /// + /// Gets or sets the font used for tooltip title text. + /// + [Description("Gets or sets the font used for tooltip title text.")] public ChartPluginsTooltipFont TitleFont { get; set; } = new(); /// /// Margin to add on bottom of title section. /// + [DefaultValue(6)] + [Description("Gets or sets the tooltip title bottom margin.")] public int TitleMarginBottom { get; set; } = 6; /// /// Spacing to add to top and bottom of each title line. /// + [DefaultValue(2)] + [Description("Gets or sets the spacing around tooltip title lines.")] public int TitleSpacing { get; set; } = 2; /// /// Position of the tooltip caret in the X direction. left/center/right. /// + [DefaultValue(null)] + [Description("Gets or sets the tooltip caret x-axis alignment.")] public string? XAlign { get; set; } /// /// Position of the tooltip caret in the Y direction. top/center/bottom. /// + [DefaultValue(null)] + [Description("Gets or sets the tooltip caret y-axis alignment.")] public string? YAlign { get; set; } #endregion @@ -333,6 +469,7 @@ public class ChartPluginsTooltip /// /// /// +[AddedVersion("1.10.2")] public class ChartPluginsTooltipFont { #region Properties, Indexers @@ -341,6 +478,8 @@ public class ChartPluginsTooltipFont /// Default font family for all text, follows CSS font-family options. /// 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif /// + [DefaultValue(null)] + [Description("Gets or sets the tooltip font family.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? Family { get; set; } @@ -348,17 +487,23 @@ public class ChartPluginsTooltipFont /// Height of an individual line of text /// /// + [DefaultValue(1.2d)] + [Description("Gets or sets the tooltip font line height.")] public double LineHeight { get; set; } = 1.2; /// /// Default font size (in px) for text. Does not apply to radialLinear scale point labels. /// + [DefaultValue(12)] + [Description("Gets or sets the tooltip font size in pixels.")] public int Size { get; set; } = 12; /// /// Default font style. Does not apply to tooltip title or footer. Does not apply to chart title. /// Follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit). /// + [DefaultValue(null)] + [Description("Gets or sets the tooltip font style.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? Style { get; set; } @@ -366,6 +511,8 @@ public class ChartPluginsTooltipFont /// Default font weight (boldness). /// /// + [DefaultValue("bold")] + [Description("Gets or sets the tooltip font weight.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? Weight { get; set; } = "bold"; diff --git a/blazorbootstrap/Models/Charts/ChartPlugins/DoughnutChartPlugins.cs b/blazorbootstrap/Models/Charts/ChartPlugins/DoughnutChartPlugins.cs index a51dfff44..d9d5ab88b 100644 --- a/blazorbootstrap/Models/Charts/ChartPlugins/DoughnutChartPlugins.cs +++ b/blazorbootstrap/Models/Charts/ChartPlugins/DoughnutChartPlugins.cs @@ -1,32 +1,95 @@ namespace BlazorBootstrap; +/// +/// Represents plugin configuration for a doughnut chart. +/// +[AddedVersion("1.10.2")] public class DoughnutChartPlugins : ChartPlugins { #region Properties, Indexers + /// + /// Gets or sets the data label plugin configuration. + /// + [AddedVersion("1.10.2")] + [Description("Gets or sets the data label plugin configuration.")] public DoughnutChartDataLabels Datalabels { get; set; } = new(); #endregion } +/// +/// Represents the data label plugin configuration for a doughnut chart. +/// +[AddedVersion("1.10.2")] public class DoughnutChartDataLabels { #region Properties, Indexers + /// + /// Gets or sets the label border color. + /// + [AddedVersion("1.10.2")] + [DefaultValue("white")] + [Description("Gets or sets the label border color.")] public string? BorderColor { get; set; } = "white"; + + /// + /// Gets or sets the label border radius. + /// + [AddedVersion("1.10.2")] + [DefaultValue(25d)] + [Description("Gets or sets the label border radius.")] public double BorderRadius { get; set; } = 25; + + /// + /// Gets or sets the label border width. + /// + [AddedVersion("1.10.2")] + [DefaultValue(2d)] + [Description("Gets or sets the label border width.")] public double BorderWidth { get; set; } = 2; + + /// + /// Gets or sets the label text color. + /// + [AddedVersion("1.10.2")] + [DefaultValue("white")] + [Description("Gets or sets the label text color.")] public string? Color { get; set; } = "white"; + + /// + /// Gets or sets the font configuration used for labels. + /// + [AddedVersion("1.10.2")] + [Description("Gets or sets the font configuration used for labels.")] public DoughnutChartDataLabelsFont Font { get; set; } = new(); + + /// + /// Gets or sets the label padding. + /// + [AddedVersion("1.10.2")] + [DefaultValue(6d)] + [Description("Gets or sets the label padding.")] public double Padding { get; set; } = 6; #endregion } +/// +/// Represents the font configuration for doughnut chart data labels. +/// +[AddedVersion("1.10.2")] public class DoughnutChartDataLabelsFont { #region Properties, Indexers + /// + /// Gets or sets the label font weight. + /// + [AddedVersion("1.10.2")] + [DefaultValue("bold")] + [Description("Gets or sets the label font weight.")] public string? Weight { get; set; } = "bold"; #endregion diff --git a/blazorbootstrap/Models/Charts/ChartPlugins/LineChartPlugins.cs b/blazorbootstrap/Models/Charts/ChartPlugins/LineChartPlugins.cs index 1e3eafc7e..8db6e036c 100644 --- a/blazorbootstrap/Models/Charts/ChartPlugins/LineChartPlugins.cs +++ b/blazorbootstrap/Models/Charts/ChartPlugins/LineChartPlugins.cs @@ -1,30 +1,79 @@ namespace BlazorBootstrap; +/// +/// Represents plugin configuration for a line chart. +/// +[AddedVersion("1.10.2")] public class LineChartPlugins : ChartPlugins { #region Properties, Indexers + /// + /// Gets or sets the data label plugin configuration. + /// + [AddedVersion("1.10.2")] + [Description("Gets or sets the data label plugin configuration.")] public LineChartDataLabels Datalabels { get; set; } = new(); #endregion } +/// +/// Represents the data label plugin configuration for a line chart. +/// +[AddedVersion("1.10.2")] public class LineChartDataLabels { #region Properties, Indexers + /// + /// Gets or sets the label border radius. + /// + [AddedVersion("1.10.2")] + [DefaultValue(4d)] + [Description("Gets or sets the label border radius.")] public double BorderRadius { get; set; } = 4; + + /// + /// Gets or sets the label text color. + /// + [AddedVersion("1.10.2")] + [DefaultValue("white")] + [Description("Gets or sets the label text color.")] public string? Color { get; set; } = "white"; + + /// + /// Gets or sets the font configuration used for labels. + /// + [AddedVersion("1.10.2")] + [Description("Gets or sets the font configuration used for labels.")] public LineChartDataLabelsFont Font { get; set; } = new(); + + /// + /// Gets or sets the label padding. + /// + [AddedVersion("1.10.2")] + [DefaultValue(6d)] + [Description("Gets or sets the label padding.")] public double Padding { get; set; } = 6; #endregion } +/// +/// Represents the font configuration for line chart data labels. +/// +[AddedVersion("1.10.2")] public class LineChartDataLabelsFont { #region Properties, Indexers + /// + /// Gets or sets the label font weight. + /// + [AddedVersion("1.10.2")] + [DefaultValue("bold")] + [Description("Gets or sets the label font weight.")] public string? Weight { get; set; } = "bold"; #endregion diff --git a/blazorbootstrap/Models/Charts/ChartPlugins/PieChartPlugins.cs b/blazorbootstrap/Models/Charts/ChartPlugins/PieChartPlugins.cs index 63a4ea1f4..d973200bb 100644 --- a/blazorbootstrap/Models/Charts/ChartPlugins/PieChartPlugins.cs +++ b/blazorbootstrap/Models/Charts/ChartPlugins/PieChartPlugins.cs @@ -1,32 +1,95 @@ namespace BlazorBootstrap; +/// +/// Represents plugin configuration for a pie chart. +/// +[AddedVersion("1.10.2")] public class PieChartPlugins : ChartPlugins { #region Properties, Indexers + /// + /// Gets or sets the data label plugin configuration. + /// + [AddedVersion("1.10.2")] + [Description("Gets or sets the data label plugin configuration.")] public PieChartDataLabels Datalabels { get; set; } = new(); #endregion } +/// +/// Represents the data label plugin configuration for a pie chart. +/// +[AddedVersion("1.10.2")] public class PieChartDataLabels { #region Properties, Indexers + /// + /// Gets or sets the label border color. + /// + [AddedVersion("1.10.2")] + [DefaultValue("white")] + [Description("Gets or sets the label border color.")] public string? BorderColor { get; set; } = "white"; + + /// + /// Gets or sets the label border radius. + /// + [AddedVersion("1.10.2")] + [DefaultValue(25d)] + [Description("Gets or sets the label border radius.")] public double BorderRadius { get; set; } = 25; + + /// + /// Gets or sets the label border width. + /// + [AddedVersion("1.10.2")] + [DefaultValue(2d)] + [Description("Gets or sets the label border width.")] public double BorderWidth { get; set; } = 2; + + /// + /// Gets or sets the label text color. + /// + [AddedVersion("1.10.2")] + [DefaultValue("white")] + [Description("Gets or sets the label text color.")] public string? Color { get; set; } = "white"; + + /// + /// Gets or sets the font configuration used for labels. + /// + [AddedVersion("1.10.2")] + [Description("Gets or sets the font configuration used for labels.")] public PieChartDataLabelsFont Font { get; set; } = new(); + + /// + /// Gets or sets the label padding. + /// + [AddedVersion("1.10.2")] + [DefaultValue(6d)] + [Description("Gets or sets the label padding.")] public double Padding { get; set; } = 6; #endregion } +/// +/// Represents the font configuration for pie chart data labels. +/// +[AddedVersion("1.10.2")] public class PieChartDataLabelsFont { #region Properties, Indexers + /// + /// Gets or sets the label font weight. + /// + [AddedVersion("1.10.2")] + [DefaultValue("bold")] + [Description("Gets or sets the label font weight.")] public string? Weight { get; set; } = "bold"; #endregion diff --git a/blazorbootstrap/Models/Charts/ChartPlugins/PolarAreaChartPlugins.cs b/blazorbootstrap/Models/Charts/ChartPlugins/PolarAreaChartPlugins.cs index d93ece4f4..c8c1851c5 100644 --- a/blazorbootstrap/Models/Charts/ChartPlugins/PolarAreaChartPlugins.cs +++ b/blazorbootstrap/Models/Charts/ChartPlugins/PolarAreaChartPlugins.cs @@ -1,32 +1,95 @@ namespace BlazorBootstrap; +/// +/// Represents plugin configuration for a polar area chart. +/// +[AddedVersion("3.0.0")] public class PolarAreaChartPlugins : ChartPlugins { #region Properties, Indexers + /// + /// Gets or sets the data label plugin configuration. + /// + [AddedVersion("3.0.0")] + [Description("Gets or sets the data label plugin configuration.")] public PolarAreaChartDataLabels Datalabels { get; set; } = new(); #endregion } +/// +/// Represents the data label plugin configuration for a polar area chart. +/// +[AddedVersion("3.0.0")] public class PolarAreaChartDataLabels { #region Properties, Indexers + /// + /// Gets or sets the label border color. + /// + [AddedVersion("3.0.0")] + [DefaultValue("white")] + [Description("Gets or sets the label border color.")] public string? BorderColor { get; set; } = "white"; + + /// + /// Gets or sets the label border radius. + /// + [AddedVersion("3.0.0")] + [DefaultValue(25d)] + [Description("Gets or sets the label border radius.")] public double BorderRadius { get; set; } = 25; + + /// + /// Gets or sets the label border width. + /// + [AddedVersion("3.0.0")] + [DefaultValue(2d)] + [Description("Gets or sets the label border width.")] public double BorderWidth { get; set; } = 2; + + /// + /// Gets or sets the label text color. + /// + [AddedVersion("3.0.0")] + [DefaultValue("white")] + [Description("Gets or sets the label text color.")] public string? Color { get; set; } = "white"; + + /// + /// Gets or sets the font configuration used for labels. + /// + [AddedVersion("3.0.0")] + [Description("Gets or sets the font configuration used for labels.")] public PolarAreaChartDataLabelsFont Font { get; set; } = new(); + + /// + /// Gets or sets the label padding. + /// + [AddedVersion("3.0.0")] + [DefaultValue(6d)] + [Description("Gets or sets the label padding.")] public double Padding { get; set; } = 6; #endregion } +/// +/// Represents the font configuration for polar area chart data labels. +/// +[AddedVersion("3.0.0")] public class PolarAreaChartDataLabelsFont { #region Properties, Indexers + /// + /// Gets or sets the label font weight. + /// + [AddedVersion("3.0.0")] + [DefaultValue("bold")] + [Description("Gets or sets the label font weight.")] public string? Weight { get; set; } = "bold"; #endregion diff --git a/blazorbootstrap/Models/Charts/ChartPlugins/ScatterChartPlugins.cs b/blazorbootstrap/Models/Charts/ChartPlugins/ScatterChartPlugins.cs index f53d1301b..1015db15a 100644 --- a/blazorbootstrap/Models/Charts/ChartPlugins/ScatterChartPlugins.cs +++ b/blazorbootstrap/Models/Charts/ChartPlugins/ScatterChartPlugins.cs @@ -1,30 +1,79 @@ namespace BlazorBootstrap; +/// +/// Represents plugin configuration for a scatter chart. +/// +[AddedVersion("3.0.0")] public class ScatterChartPlugins : ChartPlugins { #region Properties, Indexers + /// + /// Gets or sets the data label plugin configuration. + /// + [AddedVersion("3.0.0")] + [Description("Gets or sets the data label plugin configuration.")] public ScatterChartDataLabels Datalabels { get; set; } = new(); #endregion } +/// +/// Represents the data label plugin configuration for a scatter chart. +/// +[AddedVersion("3.0.0")] public class ScatterChartDataLabels { #region Properties, Indexers + /// + /// Gets or sets the label border radius. + /// + [AddedVersion("3.0.0")] + [DefaultValue(4d)] + [Description("Gets or sets the label border radius.")] public double BorderRadius { get; set; } = 4; + + /// + /// Gets or sets the label text color. + /// + [AddedVersion("3.0.0")] + [DefaultValue("white")] + [Description("Gets or sets the label text color.")] public string? Color { get; set; } = "white"; + + /// + /// Gets or sets the font configuration used for labels. + /// + [AddedVersion("3.0.0")] + [Description("Gets or sets the font configuration used for labels.")] public ScatterChartDataLabelsFont Font { get; set; } = new(); + + /// + /// Gets or sets the label padding. + /// + [AddedVersion("3.0.0")] + [DefaultValue(6d)] + [Description("Gets or sets the label padding.")] public double Padding { get; set; } = 6; #endregion } +/// +/// Represents the font configuration for scatter chart data labels. +/// +[AddedVersion("3.0.0")] public class ScatterChartDataLabelsFont { #region Properties, Indexers + /// + /// Gets or sets the label font weight. + /// + [AddedVersion("3.0.0")] + [DefaultValue("bold")] + [Description("Gets or sets the label font weight.")] public string? Weight { get; set; } = "bold"; #endregion diff --git a/blazorbootstrap/Models/Charts/ChartRGB.cs b/blazorbootstrap/Models/Charts/ChartRGB.cs index 9303585fa..28121e18b 100644 --- a/blazorbootstrap/Models/Charts/ChartRGB.cs +++ b/blazorbootstrap/Models/Charts/ChartRGB.cs @@ -1,3 +1,10 @@ namespace BlazorBootstrap; +/// +/// Represents an RGB color value. +/// +/// The red channel value. +/// The green channel value. +/// The blue channel value. +[AddedVersion("1.0.0")] public record ChartRGB(int R, int G, int B); diff --git a/blazorbootstrap/Models/Charts/ChartRGBA.cs b/blazorbootstrap/Models/Charts/ChartRGBA.cs index 27f1cfb59..274dc4da2 100644 --- a/blazorbootstrap/Models/Charts/ChartRGBA.cs +++ b/blazorbootstrap/Models/Charts/ChartRGBA.cs @@ -1,3 +1,11 @@ namespace BlazorBootstrap; +/// +/// Represents an RGBA color value. +/// +/// The red channel value. +/// The green channel value. +/// The blue channel value. +/// The alpha channel value. +[AddedVersion("1.0.0")] public record ChartRGBA(int R, int G, int B, double A); From db33834682395b1e98811383b402ea585d317bef Mon Sep 17 00:00:00 2001 From: gvreddy04 Date: Thu, 14 May 2026 02:24:06 +0530 Subject: [PATCH 5/5] Add versioning and documentation to chart datasets and options - Added [AddedVersion] attributes to various properties in PieChartDataset, PolarAreaChartDataset, RadarChartDataset, ScatterChartDataset to indicate versioning. - Enhanced documentation with XML comments for clarity on chart options classes including BarChartOptions, BubbleChartOptions, DoughnutChartOptions, LineChartOptions, PieChartOptions, PolarAreaChartOptions, RadarChartOptions, and ScatterChartOptions. - Ensured consistent use of [JsonIgnore] and [DefaultValue] attributes across chart options and datasets for better serialization and default behavior. --- .../ChartDataset/BarChart/BarChartDataset.cs | 8 ++ .../ChartDataset/ChartDatasetDataLabels.cs | 10 ++ .../DoughnutChart/DoughnutChartDataset.cs | 5 + .../LineChart/LineChartDataset.cs | 103 +++++++++++++++++ .../ChartDataset/PieChart/PieChartDataset.cs | 5 + .../PolarAreaChart/PolarAreaChartDataset.cs | 14 +++ .../RadarChart/RadarChartDataset.cs | 86 ++++++++++++++ .../ScatterChart/ScatterChartDataset.cs | 107 ++++++++++++++++++ .../Charts/ChartOptions/BarChartOptions.cs | 3 + .../Charts/ChartOptions/BubbleChartOptions.cs | 3 + .../Charts/ChartOptions/ChartOptions.cs | 20 ++-- .../ChartOptions/DoughnutChartOptions.cs | 3 + .../Charts/ChartOptions/LineChartOptions.cs | 3 + .../Charts/ChartOptions/PieChartOptions.cs | 3 + .../ChartOptions/PolarAreaChartOptions.cs | 3 + .../Charts/ChartOptions/RadarChartOptions.cs | 3 + .../ChartOptions/ScatterChartOptions.cs | 3 + 17 files changed, 372 insertions(+), 10 deletions(-) diff --git a/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDataset.cs index c571eb249..399527a1f 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDataset.cs @@ -26,6 +26,7 @@ public BarChartDataset() /// /// 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)] @@ -61,6 +62,7 @@ public BarChartDataset() /// /// 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)] @@ -83,6 +85,7 @@ public BarChartDataset() /// /// Default value is 0. /// + [AddedVersion("1.0.0")] [DefaultValue(0)] [Description("Gets or sets the border width in pixels.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] @@ -126,6 +129,7 @@ public BarChartDataset() /// /// Default value is . /// + [AddedVersion("1.0.0")] [DefaultValue(null)] [Description("Gets or sets the bar background color when hovered.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] @@ -137,6 +141,7 @@ public BarChartDataset() /// /// Default value is . /// + [AddedVersion("1.0.0")] [DefaultValue(null)] [Description("Gets or sets the bar border color when hovered.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] @@ -160,6 +165,7 @@ public BarChartDataset() /// /// 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)] @@ -229,6 +235,7 @@ public BarChartDataset() /// /// 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)] @@ -240,6 +247,7 @@ public BarChartDataset() /// /// 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)] diff --git a/blazorbootstrap/Models/Charts/ChartDataset/ChartDatasetDataLabels.cs b/blazorbootstrap/Models/Charts/ChartDataset/ChartDatasetDataLabels.cs index 4cb4218c5..61178a187 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/ChartDatasetDataLabels.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/ChartDatasetDataLabels.cs @@ -24,6 +24,8 @@ public class ChartDatasetDataLabels /// Default value is . /// [AddedVersion("3.0.0")] + [DefaultValue(Alignment.None)] + [Description("Gets or sets the data labels alignment.")] [JsonIgnore] public Alignment Alignment { @@ -42,6 +44,8 @@ public Alignment Alignment /// Default value is . /// [AddedVersion("3.0.0")] + [DefaultValue(Anchor.None)] + [Description("Gets or sets the data labels anchor.")] [JsonIgnore] public Anchor Anchor { @@ -56,6 +60,8 @@ public Anchor Anchor //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; /// @@ -66,6 +72,8 @@ public Anchor Anchor /// 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; } @@ -75,6 +83,8 @@ public Anchor 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; } diff --git a/blazorbootstrap/Models/Charts/ChartDataset/DoughnutChart/DoughnutChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/DoughnutChart/DoughnutChartDataset.cs index dad707d39..62b3f7ad9 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/DoughnutChart/DoughnutChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/DoughnutChart/DoughnutChartDataset.cs @@ -16,6 +16,7 @@ public class DoughnutChartDataset : ChartDataset /// /// 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)] @@ -41,6 +42,7 @@ public class DoughnutChartDataset : ChartDataset /// /// Default value is '#fff'. /// + [AddedVersion("1.0.0")] [DefaultValue("#fff")] [Description("Gets or sets the arc border color.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] @@ -100,6 +102,7 @@ public class DoughnutChartDataset : ChartDataset /// /// Default value is 2. /// + [AddedVersion("1.0.0")] [DefaultValue(2)] [Description("Gets or sets the arc border width in pixels.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] @@ -128,6 +131,7 @@ public class DoughnutChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("1.0.0")] [DefaultValue(null)] [Description("Gets or sets the arc background color when hovered.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] @@ -139,6 +143,7 @@ public class DoughnutChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("1.0.0")] [DefaultValue(null)] [Description("Gets or sets the arc border color when hovered.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] diff --git a/blazorbootstrap/Models/Charts/ChartDataset/LineChart/LineChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/LineChart/LineChartDataset.cs index 8422fd2ad..d500414d5 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/LineChart/LineChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/LineChart/LineChartDataset.cs @@ -26,6 +26,8 @@ public LineChartDataset() /// Whether the specified index is relative or absolute (zero based) /// The dataset, for method chaining /// If the relative index is zero. + [AddedVersion("1.0.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) @@ -44,6 +46,8 @@ public LineChartDataset FillToDataset(int index, bool relativeIndex = false) /// 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("1.0.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; @@ -75,6 +79,8 @@ public LineChartDataset FillToDataset(ChartData chartData, IChartDataset dataset /// Fills between the current dataset and the top of the chart (fill: 'end'). /// /// The dataset, for method chaining + [AddedVersion("1.0.0")] + [Description("Fills between the current dataset and the end of the chart.")] public LineChartDataset FillToEnd() { Fill = "end"; @@ -86,6 +92,8 @@ public LineChartDataset FillToEnd() /// Fills between the current dataset and the origin. For legacy reasons, this is the same as fill: true. /// /// The dataset, for method chaining + [AddedVersion("1.0.0")] + [Description("Fills between the current dataset and the origin.")] public LineChartDataset FillToOrigin() { Fill = "origin"; @@ -97,6 +105,8 @@ public LineChartDataset FillToOrigin() /// Fill to the line below the current dataset (fill: 'stack'). /// /// The dataset, for method chaining + [AddedVersion("1.0.0")] + [Description("Fills to the stacked value below the current dataset.")] public LineChartDataset FillToStackedValueBelow() { Fill = "stack"; @@ -108,6 +118,8 @@ public LineChartDataset FillToStackedValueBelow() /// Fills between the current dataset and the start (fill: 'start'). /// /// The dataset, for method chaining + [AddedVersion("1.0.0")] + [Description("Fills between the current dataset and the start of the chart.")] public LineChartDataset FillToStart() { Fill = "start"; @@ -120,6 +132,8 @@ public LineChartDataset FillToStart() /// /// The value to fill to /// The dataset, for method chaining + [AddedVersion("1.0.0")] + [Description("Fills to a constant value.")] public LineChartDataset FillToValue(double value) { Fill = new { value }; @@ -138,6 +152,8 @@ public LineChartDataset FillToValue(double value) /// 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)"; /// @@ -148,6 +164,8 @@ public LineChartDataset FillToValue(double value) /// 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"; /// @@ -157,6 +175,8 @@ public LineChartDataset FillToValue(double value) /// 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)"; /// @@ -166,6 +186,8 @@ public LineChartDataset FillToValue(double value) /// 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; } @@ -175,6 +197,9 @@ public LineChartDataset FillToValue(double value) /// /// 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; } /// @@ -185,6 +210,8 @@ public LineChartDataset FillToValue(double value) /// 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"; /// @@ -194,6 +221,8 @@ public LineChartDataset FillToValue(double value) /// 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; /// @@ -204,9 +233,12 @@ public LineChartDataset FillToValue(double value) /// 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 @@ -217,6 +249,8 @@ public LineChartDataset FillToValue(double value) /// 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; } @@ -227,6 +261,8 @@ public LineChartDataset FillToValue(double value) /// /// Default value is . /// + [DefaultValue(false)] + [Description("Gets or sets how the area under the line is filled.")] public object Fill { get; set; } = false; /// @@ -236,6 +272,8 @@ public LineChartDataset FillToValue(double value) /// 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; } @@ -246,6 +284,8 @@ public LineChartDataset FillToValue(double value) /// 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; } @@ -256,6 +296,8 @@ public LineChartDataset FillToValue(double value) /// 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; } @@ -266,6 +308,8 @@ public LineChartDataset FillToValue(double value) /// 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; } @@ -276,6 +320,8 @@ public LineChartDataset FillToValue(double value) /// 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; } @@ -287,6 +333,8 @@ public LineChartDataset FillToValue(double value) /// 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"; /// @@ -296,6 +344,8 @@ public LineChartDataset FillToValue(double value) /// 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; } @@ -306,6 +356,8 @@ public LineChartDataset FillToValue(double value) /// 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; } @@ -315,6 +367,9 @@ public LineChartDataset FillToValue(double value) /// /// 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; } @@ -324,6 +379,9 @@ public LineChartDataset FillToValue(double value) /// /// 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; } @@ -333,6 +391,9 @@ public LineChartDataset FillToValue(double value) /// /// 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; } @@ -342,6 +403,9 @@ public LineChartDataset FillToValue(double value) /// /// 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; } @@ -351,6 +415,9 @@ public LineChartDataset FillToValue(double value) /// /// 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; } @@ -360,6 +427,9 @@ public LineChartDataset FillToValue(double value) /// /// Default value is . /// + [AddedVersion("1.0.0")] + [DefaultValue(null)] + [Description("Gets or sets the point border color when hovered.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? PointHoverBorderColor { get; set; } @@ -369,6 +439,9 @@ public LineChartDataset FillToValue(double value) /// /// Default value is 1. /// + [AddedVersion("1.0.0")] + [DefaultValue(1d)] + [Description("Gets or sets the point border width when hovered.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? PointHoverBorderWidth { get; set; } @@ -378,6 +451,9 @@ public LineChartDataset FillToValue(double value) /// /// Default value is 4. /// + [AddedVersion("1.0.0")] + [DefaultValue(4d)] + [Description("Gets or sets the point radius when hovered.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? PointHoverRadius { get; set; } @@ -387,6 +463,9 @@ public LineChartDataset FillToValue(double value) /// /// Default value is 3. /// + [AddedVersion("1.0.0")] + [DefaultValue(3d)] + [Description("Gets or sets the point radius.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? PointRadius { get; set; } @@ -396,6 +475,9 @@ public LineChartDataset FillToValue(double value) /// /// Default value is 0. /// + [AddedVersion("1.0.0")] + [DefaultValue(0d)] + [Description("Gets or sets the point rotation in degrees.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? PointRotation { get; set; } @@ -408,6 +490,9 @@ public LineChartDataset FillToValue(double value) /// /// Default value is 'circle'. /// + [AddedVersion("1.0.0")] + [DefaultValue("circle")] + [Description("Gets or sets the point style.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? PointStyle { get; set; } @@ -420,6 +505,9 @@ public LineChartDataset FillToValue(double value) /// /// Default value is . /// + [AddedVersion("1.0.0")] + [DefaultValue(true)] + [Description("Gets or sets a value indicating whether the line is displayed.")] public bool ShowLine { get; set; } = true; /// @@ -431,6 +519,9 @@ public LineChartDataset FillToValue(double value) /// /// Default value is . /// + [AddedVersion("1.0.0")] + [DefaultValue(null)] + [Description("Gets or sets whether gaps between points are spanned.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public bool? SpanGaps { get; set; } @@ -443,6 +534,9 @@ public LineChartDataset FillToValue(double value) /// /// Default value is . /// + [AddedVersion("1.0.0")] + [DefaultValue(false)] + [Description("Gets or sets a value indicating whether the line is rendered as stepped.")] public bool Stepped { get; set; } /// @@ -452,6 +546,9 @@ public LineChartDataset FillToValue(double value) /// /// Default value is 0. /// + [AddedVersion("1.0.0")] + [DefaultValue(0d)] + [Description("Gets or sets the bezier curve tension.")] public double Tension { get; set; } /// @@ -460,6 +557,9 @@ public LineChartDataset FillToValue(double value) /// /// 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; } @@ -469,6 +569,9 @@ public LineChartDataset FillToValue(double value) /// /// 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; } diff --git a/blazorbootstrap/Models/Charts/ChartDataset/PieChart/PieChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/PieChart/PieChartDataset.cs index a5e803a2f..15df434bc 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/PieChart/PieChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/PieChart/PieChartDataset.cs @@ -16,6 +16,7 @@ public class PieChartDataset : ChartDataset /// /// 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)] @@ -41,6 +42,7 @@ public class PieChartDataset : ChartDataset /// /// Default value is '#fff'. /// + [AddedVersion("1.0.0")] [DefaultValue("#fff")] [Description("Gets or sets the arc border color.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] @@ -100,6 +102,7 @@ public class PieChartDataset : ChartDataset /// /// Default value is 2. /// + [AddedVersion("1.0.0")] [DefaultValue(2)] [Description("Gets or sets the arc border width in pixels.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] @@ -128,6 +131,7 @@ public class PieChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("1.0.0")] [DefaultValue(null)] [Description("Gets or sets the arc background color when hovered.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] @@ -139,6 +143,7 @@ public class PieChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("1.0.0")] [DefaultValue(null)] [Description("Gets or sets the arc border color when hovered.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] diff --git a/blazorbootstrap/Models/Charts/ChartDataset/PolarAreaChart/PolarAreaChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/PolarAreaChart/PolarAreaChartDataset.cs index 6a0adcde2..9885865d9 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/PolarAreaChart/PolarAreaChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/PolarAreaChart/PolarAreaChartDataset.cs @@ -11,6 +11,7 @@ public class PolarAreaChartDataset : ChartDataset /// /// 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 arc background color.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] @@ -24,6 +25,7 @@ public class PolarAreaChartDataset : ChartDataset /// /// Default value is 'center'. /// + [AddedVersion("3.0.0")] [DefaultValue("center")] [Description("Gets or sets the arc border alignment.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] @@ -35,6 +37,7 @@ public class PolarAreaChartDataset : ChartDataset /// /// Default value is '#fff'. /// + [AddedVersion("3.0.0")] [DefaultValue("#fff")] [Description("Gets or sets the arc border color.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] @@ -46,6 +49,7 @@ public class PolarAreaChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("3.0.0")] [DefaultValue(null)] [Description("Gets or sets the arc border dash pattern.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] @@ -57,6 +61,7 @@ public class PolarAreaChartDataset : ChartDataset /// /// 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; } @@ -68,6 +73,7 @@ public class PolarAreaChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("3.0.0")] [DefaultValue(null)] [Description("Gets or sets the arc border join style.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] @@ -79,6 +85,7 @@ public class PolarAreaChartDataset : ChartDataset /// /// Default value is 2. /// + [AddedVersion("3.0.0")] [DefaultValue(2)] [Description("Gets or sets the arc border width in pixels.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] @@ -90,6 +97,7 @@ public class PolarAreaChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("3.0.0")] [DefaultValue(true)] [Description("Gets or sets a value indicating whether arcs are drawn as circles.")] public bool Circular { get; set; } = true; @@ -105,6 +113,7 @@ public class PolarAreaChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("3.0.0")] [DefaultValue(null)] [Description("Gets or sets the arc background color when hovered.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] @@ -116,6 +125,7 @@ public class PolarAreaChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("3.0.0")] [DefaultValue(null)] [Description("Gets or sets the arc border color when hovered.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] @@ -127,6 +137,7 @@ public class PolarAreaChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("3.0.0")] [DefaultValue(null)] [Description("Gets or sets the hovered arc border dash pattern.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] @@ -138,6 +149,7 @@ public class PolarAreaChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("3.0.0")] [DefaultValue(null)] [Description("Gets or sets the hovered arc border dash offset.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] @@ -150,6 +162,7 @@ public class PolarAreaChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("3.0.0")] [DefaultValue(null)] [Description("Gets or sets the hovered arc border join style.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] @@ -161,6 +174,7 @@ public class PolarAreaChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("3.0.0")] [DefaultValue(null)] [Description("Gets or sets the hovered arc border width in pixels.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] diff --git a/blazorbootstrap/Models/Charts/ChartDataset/RadarChart/RadarChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/RadarChart/RadarChartDataset.cs index 54063c4a0..2ff9defe6 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/RadarChart/RadarChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/RadarChart/RadarChartDataset.cs @@ -16,6 +16,9 @@ public class RadarChartDataset : ChartDataset /// /// 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)"; /// @@ -25,6 +28,9 @@ public class RadarChartDataset : ChartDataset /// /// 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"; /// @@ -33,6 +39,9 @@ public class RadarChartDataset : ChartDataset /// /// 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)"; /// @@ -41,6 +50,9 @@ public class RadarChartDataset : ChartDataset /// /// 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; } @@ -50,6 +62,9 @@ public class RadarChartDataset : ChartDataset /// /// 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; } /// @@ -59,6 +74,9 @@ public class RadarChartDataset : ChartDataset /// /// 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"; /// @@ -67,8 +85,13 @@ public class RadarChartDataset : ChartDataset /// /// 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; + [AddedVersion("3.0.0")] + [Description("Gets or sets the dataset data label configuration.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public RadarChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: Add reference link @@ -78,6 +101,9 @@ public class RadarChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("3.0.0")] + [DefaultValue(false)] + [Description("Gets or sets how the area under the line is filled.")] public bool Fill { get; set; } /// @@ -86,6 +112,9 @@ public class RadarChartDataset : ChartDataset /// /// 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; } @@ -95,6 +124,9 @@ public class RadarChartDataset : ChartDataset /// /// 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; } @@ -104,6 +136,9 @@ public class RadarChartDataset : ChartDataset /// /// 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; } @@ -113,6 +148,9 @@ public class RadarChartDataset : ChartDataset /// /// 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; } @@ -122,6 +160,9 @@ public class RadarChartDataset : ChartDataset /// /// 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; } @@ -132,6 +173,9 @@ public class RadarChartDataset : ChartDataset /// /// 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"; /// @@ -140,6 +184,9 @@ public class RadarChartDataset : ChartDataset /// /// 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; } @@ -149,6 +196,9 @@ public class RadarChartDataset : ChartDataset /// /// 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 point fill color.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? PointBackgroundColor { get; set; } @@ -158,6 +208,9 @@ public class RadarChartDataset : ChartDataset /// /// 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 point border color.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? PointBorderColor { get; set; } @@ -167,6 +220,9 @@ public class RadarChartDataset : ChartDataset /// /// Default value is 1. /// + [AddedVersion("3.0.0")] + [DefaultValue(1d)] + [Description("Gets or sets the point border width in pixels.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? PointBorderWidth { get; set; } @@ -176,6 +232,9 @@ public class RadarChartDataset : ChartDataset /// /// Default value is 1. /// + [AddedVersion("3.0.0")] + [DefaultValue(1d)] + [Description("Gets or sets the point hit radius.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? PointHitRadius { get; set; } @@ -185,6 +244,9 @@ public class RadarChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("3.0.0")] + [DefaultValue(null)] + [Description("Gets or sets the point background color when hovered.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? PointHoverBackgroundColor { get; set; } @@ -194,6 +256,9 @@ public class RadarChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("3.0.0")] + [DefaultValue(null)] + [Description("Gets or sets the point border color when hovered.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? PointHoverBorderColor { get; set; } @@ -203,6 +268,9 @@ public class RadarChartDataset : ChartDataset /// /// Default value is 1. /// + [AddedVersion("3.0.0")] + [DefaultValue(1d)] + [Description("Gets or sets the point border width when hovered.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? PointHoverBorderWidth { get; set; } @@ -212,6 +280,9 @@ public class RadarChartDataset : ChartDataset /// /// Default value is 4. /// + [AddedVersion("3.0.0")] + [DefaultValue(4d)] + [Description("Gets or sets the point radius when hovered.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? PointHoverRadius { get; set; } @@ -221,6 +292,9 @@ public class RadarChartDataset : ChartDataset /// /// Default value is 3. /// + [AddedVersion("3.0.0")] + [DefaultValue(3d)] + [Description("Gets or sets the point radius.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? PointRadius { get; set; } @@ -230,6 +304,9 @@ public class RadarChartDataset : ChartDataset /// /// Default value is 0. /// + [AddedVersion("3.0.0")] + [DefaultValue(0d)] + [Description("Gets or sets the point rotation in degrees.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? PointRotation { get; set; } @@ -242,6 +319,9 @@ public class RadarChartDataset : ChartDataset /// /// Default value is 'circle'. /// + [AddedVersion("3.0.0")] + [DefaultValue("circle")] + [Description("Gets or sets the point style.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? PointStyle { get; set; } @@ -254,6 +334,9 @@ public class RadarChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("3.0.0")] + [DefaultValue(null)] + [Description("Gets or sets whether gaps between points are spanned.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public bool? SpanGaps { get; set; } @@ -264,6 +347,9 @@ public class RadarChartDataset : ChartDataset /// /// Default value is 0. /// + [AddedVersion("3.0.0")] + [DefaultValue(0d)] + [Description("Gets or sets the bezier curve tension.")] public double Tension { get; set; } #endregion diff --git a/blazorbootstrap/Models/Charts/ChartDataset/ScatterChart/ScatterChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/ScatterChart/ScatterChartDataset.cs index 562a04086..98c254213 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/ScatterChart/ScatterChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/ScatterChart/ScatterChartDataset.cs @@ -18,6 +18,9 @@ public class ScatterChartDataset : ChartDataset /// /// 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)"; /// @@ -27,6 +30,9 @@ public class ScatterChartDataset : ChartDataset /// /// 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"; /// @@ -35,6 +41,9 @@ public class ScatterChartDataset : ChartDataset /// /// 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)"; /// @@ -43,6 +52,9 @@ public class ScatterChartDataset : ChartDataset /// /// 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; } @@ -52,6 +64,9 @@ public class ScatterChartDataset : ChartDataset /// /// 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; } /// @@ -61,6 +76,9 @@ public class ScatterChartDataset : ChartDataset /// /// 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"; /// @@ -69,6 +87,9 @@ public class ScatterChartDataset : ChartDataset /// /// 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; /// @@ -78,8 +99,13 @@ public class ScatterChartDataset : ChartDataset /// /// 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("3.0.0")] + [Description("Gets or sets the dataset data label configuration.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public LineChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link @@ -89,6 +115,9 @@ public class ScatterChartDataset : ChartDataset /// /// 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; } @@ -98,6 +127,9 @@ public class ScatterChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("3.0.0")] + [DefaultValue(false)] + [Description("Gets or sets how the area under the line is filled.")] public bool Fill { get; set; } /// @@ -106,6 +138,9 @@ public class ScatterChartDataset : ChartDataset /// /// 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; } @@ -115,6 +150,9 @@ public class ScatterChartDataset : ChartDataset /// /// 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; } @@ -124,6 +162,9 @@ public class ScatterChartDataset : ChartDataset /// /// 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; } @@ -133,6 +174,9 @@ public class ScatterChartDataset : ChartDataset /// /// 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; } @@ -142,6 +186,9 @@ public class ScatterChartDataset : ChartDataset /// /// 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; } @@ -152,6 +199,9 @@ public class ScatterChartDataset : ChartDataset /// /// 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"; /// @@ -160,6 +210,9 @@ public class ScatterChartDataset : ChartDataset /// /// 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; } @@ -169,6 +222,9 @@ public class ScatterChartDataset : ChartDataset /// /// 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; } @@ -178,6 +234,9 @@ public class ScatterChartDataset : ChartDataset /// /// 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 point fill color.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? PointBackgroundColor { get; set; } @@ -187,6 +246,9 @@ public class ScatterChartDataset : ChartDataset /// /// 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 point border color.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? PointBorderColor { get; set; } @@ -196,6 +258,9 @@ public class ScatterChartDataset : ChartDataset /// /// Default value is 1. /// + [AddedVersion("3.0.0")] + [DefaultValue(1d)] + [Description("Gets or sets the point border width in pixels.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? PointBorderWidth { get; set; } @@ -205,6 +270,9 @@ public class ScatterChartDataset : ChartDataset /// /// Default value is 1. /// + [AddedVersion("3.0.0")] + [DefaultValue(1d)] + [Description("Gets or sets the point hit radius.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? PointHitRadius { get; set; } @@ -214,6 +282,9 @@ public class ScatterChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("3.0.0")] + [DefaultValue(null)] + [Description("Gets or sets the point background color when hovered.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? PointHoverBackgroundColor { get; set; } @@ -223,6 +294,9 @@ public class ScatterChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("3.0.0")] + [DefaultValue(null)] + [Description("Gets or sets the point border color when hovered.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? PointHoverBorderColor { get; set; } @@ -232,6 +306,9 @@ public class ScatterChartDataset : ChartDataset /// /// Default value is 1. /// + [AddedVersion("3.0.0")] + [DefaultValue(1d)] + [Description("Gets or sets the point border width when hovered.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? PointHoverBorderWidth { get; set; } @@ -241,6 +318,9 @@ public class ScatterChartDataset : ChartDataset /// /// Default value is 4. /// + [AddedVersion("3.0.0")] + [DefaultValue(4d)] + [Description("Gets or sets the point radius when hovered.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? PointHoverRadius { get; set; } @@ -250,6 +330,9 @@ public class ScatterChartDataset : ChartDataset /// /// Default value is 3. /// + [AddedVersion("3.0.0")] + [DefaultValue(3d)] + [Description("Gets or sets the point radius.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? PointRadius { get; set; } @@ -259,6 +342,9 @@ public class ScatterChartDataset : ChartDataset /// /// Default value is 0. /// + [AddedVersion("3.0.0")] + [DefaultValue(0d)] + [Description("Gets or sets the point rotation in degrees.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? PointRotation { get; set; } @@ -271,6 +357,9 @@ public class ScatterChartDataset : ChartDataset /// /// Default value is 'circle'. /// + [AddedVersion("3.0.0")] + [DefaultValue("circle")] + [Description("Gets or sets the point style.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? PointStyle { get; set; } @@ -284,6 +373,9 @@ public class ScatterChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("3.0.0")] + [DefaultValue(false)] + [Description("Gets a value indicating whether the line is displayed.")] public bool ShowLine { get; } = false; /// @@ -295,6 +387,9 @@ public class ScatterChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("3.0.0")] + [DefaultValue(null)] + [Description("Gets or sets whether gaps between points are spanned.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public bool? SpanGaps { get; set; } @@ -307,6 +402,9 @@ public class ScatterChartDataset : ChartDataset /// /// Default value is . /// + [AddedVersion("3.0.0")] + [DefaultValue(false)] + [Description("Gets or sets a value indicating whether the line is rendered as stepped.")] public bool Stepped { get; set; } /// @@ -316,6 +414,9 @@ public class ScatterChartDataset : ChartDataset /// /// Default value is 0. /// + [AddedVersion("3.0.0")] + [DefaultValue(0d)] + [Description("Gets or sets the bezier curve tension.")] public double Tension { get; set; } /// @@ -324,6 +425,9 @@ public class ScatterChartDataset : ChartDataset /// /// Default value is 'first x axis'. /// + [AddedVersion("3.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; } @@ -333,6 +437,9 @@ public class ScatterChartDataset : ChartDataset /// /// Default value is 'first y axis'. /// + [AddedVersion("3.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; } diff --git a/blazorbootstrap/Models/Charts/ChartOptions/BarChartOptions.cs b/blazorbootstrap/Models/Charts/ChartOptions/BarChartOptions.cs index 72f0f6387..92d9ab4f1 100644 --- a/blazorbootstrap/Models/Charts/ChartOptions/BarChartOptions.cs +++ b/blazorbootstrap/Models/Charts/ChartOptions/BarChartOptions.cs @@ -1,5 +1,8 @@ namespace BlazorBootstrap; +/// +/// Represents configuration options for a bar chart. +/// [AddedVersion("1.0.0")] public class BarChartOptions : ChartOptions { diff --git a/blazorbootstrap/Models/Charts/ChartOptions/BubbleChartOptions.cs b/blazorbootstrap/Models/Charts/ChartOptions/BubbleChartOptions.cs index 83f18f33c..b1ae9685f 100644 --- a/blazorbootstrap/Models/Charts/ChartOptions/BubbleChartOptions.cs +++ b/blazorbootstrap/Models/Charts/ChartOptions/BubbleChartOptions.cs @@ -1,5 +1,8 @@ namespace BlazorBootstrap; +/// +/// Represents configuration options for a bubble chart. +/// [AddedVersion("4.0.0")] public class BubbleChartOptions : ChartOptions { diff --git a/blazorbootstrap/Models/Charts/ChartOptions/ChartOptions.cs b/blazorbootstrap/Models/Charts/ChartOptions/ChartOptions.cs index 593d12300..e750c0d58 100644 --- a/blazorbootstrap/Models/Charts/ChartOptions/ChartOptions.cs +++ b/blazorbootstrap/Models/Charts/ChartOptions/ChartOptions.cs @@ -467,42 +467,42 @@ public class ChartAxesBorder /// Length and spacing of dashes on grid lines /// /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? Dash { get; set; } [DefaultValue(null)] [Description("Gets or sets the border dash pattern.")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? Dash { get; set; } /// /// Offset for line dashes. /// /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? DashOffset { get; set; } [DefaultValue(null)] [Description("Gets or sets the border dash offset.")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public int? DashOffset { get; set; } /// /// If , draw a border at the edge between the axis and the chart area. /// - public bool Display { get; set; } = true; - [DefaultValue(true)] [Description("Gets or sets a value indicating whether the axis border is displayed.")] + public bool Display { get; set; } = true; + /// /// The width of the border line. /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Width { get; set; } [DefaultValue(null)] [Description("Gets or sets the border width.")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public int? Width { get; set; } /// /// z-index of the border layer. Values <= 0 are drawn under datasets, > 0 on top. /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Z { get; set; } [DefaultValue(null)] [Description("Gets or sets the border z-index.")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public int? Z { get; set; } #endregion } diff --git a/blazorbootstrap/Models/Charts/ChartOptions/DoughnutChartOptions.cs b/blazorbootstrap/Models/Charts/ChartOptions/DoughnutChartOptions.cs index 6a1736b1c..163b82e7f 100644 --- a/blazorbootstrap/Models/Charts/ChartOptions/DoughnutChartOptions.cs +++ b/blazorbootstrap/Models/Charts/ChartOptions/DoughnutChartOptions.cs @@ -1,5 +1,8 @@ namespace BlazorBootstrap; +/// +/// Represents configuration options for a doughnut chart. +/// [AddedVersion("1.0.0")] public class DoughnutChartOptions : ChartOptions { diff --git a/blazorbootstrap/Models/Charts/ChartOptions/LineChartOptions.cs b/blazorbootstrap/Models/Charts/ChartOptions/LineChartOptions.cs index 3024a552b..674f3661d 100644 --- a/blazorbootstrap/Models/Charts/ChartOptions/LineChartOptions.cs +++ b/blazorbootstrap/Models/Charts/ChartOptions/LineChartOptions.cs @@ -1,5 +1,8 @@ namespace BlazorBootstrap; +/// +/// Represents configuration options for a line chart. +/// [AddedVersion("1.0.0")] public class LineChartOptions : ChartOptions { diff --git a/blazorbootstrap/Models/Charts/ChartOptions/PieChartOptions.cs b/blazorbootstrap/Models/Charts/ChartOptions/PieChartOptions.cs index d851a42c0..a9a699065 100644 --- a/blazorbootstrap/Models/Charts/ChartOptions/PieChartOptions.cs +++ b/blazorbootstrap/Models/Charts/ChartOptions/PieChartOptions.cs @@ -1,5 +1,8 @@ namespace BlazorBootstrap; +/// +/// Represents configuration options for a pie chart. +/// [AddedVersion("1.0.0")] public class PieChartOptions : ChartOptions { diff --git a/blazorbootstrap/Models/Charts/ChartOptions/PolarAreaChartOptions.cs b/blazorbootstrap/Models/Charts/ChartOptions/PolarAreaChartOptions.cs index 8718cf72b..80c165f3d 100644 --- a/blazorbootstrap/Models/Charts/ChartOptions/PolarAreaChartOptions.cs +++ b/blazorbootstrap/Models/Charts/ChartOptions/PolarAreaChartOptions.cs @@ -1,5 +1,8 @@ namespace BlazorBootstrap; +/// +/// Represents configuration options for a polar area chart. +/// [AddedVersion("3.0.0")] public class PolarAreaChartOptions : ChartOptions { diff --git a/blazorbootstrap/Models/Charts/ChartOptions/RadarChartOptions.cs b/blazorbootstrap/Models/Charts/ChartOptions/RadarChartOptions.cs index cb2174f7b..ab32071c9 100644 --- a/blazorbootstrap/Models/Charts/ChartOptions/RadarChartOptions.cs +++ b/blazorbootstrap/Models/Charts/ChartOptions/RadarChartOptions.cs @@ -1,5 +1,8 @@ namespace BlazorBootstrap; +/// +/// Represents configuration options for a radar chart. +/// [AddedVersion("3.0.0")] public class RadarChartOptions : ChartOptions { diff --git a/blazorbootstrap/Models/Charts/ChartOptions/ScatterChartOptions.cs b/blazorbootstrap/Models/Charts/ChartOptions/ScatterChartOptions.cs index 9ed5e2af6..a23db0b18 100644 --- a/blazorbootstrap/Models/Charts/ChartOptions/ScatterChartOptions.cs +++ b/blazorbootstrap/Models/Charts/ChartOptions/ScatterChartOptions.cs @@ -1,5 +1,8 @@ namespace BlazorBootstrap; +/// +/// Represents configuration options for a scatter chart. +/// [AddedVersion("3.0.0")] public class ScatterChartOptions : ChartOptions {