From 84612ac5731055890abb66d4c19efe4703f069f7 Mon Sep 17 00:00:00 2001 From: Mischa Spelt Date: Wed, 31 Jul 2024 16:11:37 +0200 Subject: [PATCH 1/4] Charts: Made ChartDataset.Data generic so derived classes don't have to shadow it (cherry picked from commit 35383ee07b0606861868c320cf0a24fc8e499449) --- .../ChartDataset/BarChart/BarChartDataset.cs | 371 +++++----- .../Charts/ChartDataset/ChartDataset.cs | 126 ++-- .../DoughnutChart/DoughnutChartDataset.cs | 389 +++++----- .../LineChart/LineChartDataset.cs | 661 +++++++++-------- .../ChartDataset/PieChart/PieChartDataset.cs | 389 +++++----- .../PolarAreaChart/PolarAreaChartDataset.cs | 279 ++++---- .../RadarChart/RadarChartDataset.cs | 527 +++++++------- .../ScatterChart/ScatterChartDataset.cs | 663 +++++++++--------- 8 files changed, 1671 insertions(+), 1734 deletions(-) diff --git a/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDataset.cs index ab5176b25..43447b9f7 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDataset.cs @@ -6,197 +6,188 @@ /// /// /// -public class BarChartDataset : ChartDataset +public class BarChartDataset : ChartDataset { - #region Properties, Indexers - - /// - /// The bar background color. - /// - /// - /// Default value is 'rgba(0, 0, 0, 0.1)'. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? BackgroundColor { get; set; } - - /// - /// Percent (0-1) of the available width each bar should be within the category width. - /// 1.0 will take the whole category width and put the bars right next to each other. - /// - /// - /// Default value is 0.9. - /// - public double BarPercentage { get; set; } = 0.9; - - /// - /// It is applied to the width of each bar, in pixels. - /// When this is enforced, barPercentage and categoryPercentage are ignored. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? BarThickness { get; set; } - - /// - /// The bar border color. - /// - /// - /// Default value is 'rgba(0, 0, 0, 0.1)'. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? BorderColor { get; set; } - - /// - /// Border radius - /// - /// - /// Default value is 0. - /// - public List? BorderRadius { get; set; } - - /// - /// Gets or sets the border width (in pixels). - /// - /// - /// Default value is 0. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? BorderWidth { get; set; } - - //BorderSkipped - //https://www.chartjs.org/docs/latest/api/interfaces/BarControllerDatasetOptions.html#borderskipped - - /// - /// Percent (0-1) of the available width each category should be within the sample width. - /// - /// - /// Default value is 0.8. - /// - public double CategoryPercentage { get; set; } = 0.8; - - /// - /// Get or sets the Data. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public new List? Data { get; set; } - - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public BarChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link - - /// - /// Should the bars be grouped on index axis. - /// When , all the datasets at same index value will be placed next to each other centering on that index value. - /// When , each bar is placed on its actual index-axis value. - /// - /// - /// Default value is . - /// - public bool Grouped { get; set; } = true; - - /// - /// The bar background color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? HoverBackgroundColor { get; set; } - - /// - /// The bar border color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? HoverBorderColor { get; set; } - - /// - /// The bar border radius when hovered (in pixels). - /// - /// - /// Default value is 0. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? HoverBorderRadius { get; set; } - - /// - /// The bar border width when hovered (in pixels). - /// - /// - /// Default value is 1. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? HoverBorderWidth { get; set; } - - /// - /// The base axis of the chart. 'x' for vertical charts and 'y' for horizontal charts. - /// Supported values are 'x' and 'y'. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string? IndexAxis { get; set; } - - //InflateAmount - //https://www.chartjs.org/docs/latest/charts/bar.html#inflateamount - - /// - /// Set this to ensure that bars are not sized thicker than this. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? MaxBarThickness { get; set; } - - /// - /// Set this to ensure that bars have a minimum length in pixels. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? MinBarLength { get; set; } - - //PointStyle - //https://www.chartjs.org/docs/latest/configuration/elements.html#point-styles - - /// - /// If , null or undefined values will not be used for spacing calculations when determining bar size. - /// - /// - /// Default value is . - /// - public bool SkipNull { get; set; } - - //Stack - //https://www.chartjs.org/docs/latest/charts/bar.html#general - - /// - /// The ID of the x axis to plot this dataset on. - /// - /// - /// Default value is first x axis. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string? XAxisID { get; set; } - - /// - /// The ID of the y axis to plot this dataset on. - /// - /// - /// Default value is first y axis. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string? YAxisID { get; set; } - - #endregion + #region Properties, Indexers + + /// + /// The bar background color. + /// + /// + /// Default value is 'rgba(0, 0, 0, 0.1)'. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? BackgroundColor { get; set; } + + /// + /// Percent (0-1) of the available width each bar should be within the category width. + /// 1.0 will take the whole category width and put the bars right next to each other. + /// + /// + /// Default value is 0.9. + /// + public double BarPercentage { get; set; } = 0.9; + + /// + /// It is applied to the width of each bar, in pixels. + /// When this is enforced, barPercentage and categoryPercentage are ignored. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public double? BarThickness { get; set; } + + /// + /// The bar border color. + /// + /// + /// Default value is 'rgba(0, 0, 0, 0.1)'. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? BorderColor { get; set; } + + /// + /// Border radius + /// + /// + /// Default value is 0. + /// + public List? BorderRadius { get; set; } + + /// + /// Gets or sets the border width (in pixels). + /// + /// + /// Default value is 0. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? BorderWidth { get; set; } + + //BorderSkipped + //https://www.chartjs.org/docs/latest/api/interfaces/BarControllerDatasetOptions.html#borderskipped + + /// + /// Percent (0-1) of the available width each category should be within the sample width. + /// + /// + /// Default value is 0.8. + /// + public double CategoryPercentage { get; set; } = 0.8; + + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public BarChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link + + /// + /// Should the bars be grouped on index axis. + /// When , all the datasets at same index value will be placed next to each other centering on that index value. + /// When , each bar is placed on its actual index-axis value. + /// + /// + /// Default value is . + /// + public bool Grouped { get; set; } = true; + + /// + /// The bar background color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? HoverBackgroundColor { get; set; } + + /// + /// The bar border color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? HoverBorderColor { get; set; } + + /// + /// The bar border radius when hovered (in pixels). + /// + /// + /// Default value is 0. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? HoverBorderRadius { get; set; } + + /// + /// The bar border width when hovered (in pixels). + /// + /// + /// Default value is 1. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? HoverBorderWidth { get; set; } + + /// + /// The base axis of the chart. 'x' for vertical charts and 'y' for horizontal charts. + /// Supported values are 'x' and 'y'. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public string? IndexAxis { get; set; } + + //InflateAmount + //https://www.chartjs.org/docs/latest/charts/bar.html#inflateamount + + /// + /// Set this to ensure that bars are not sized thicker than this. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public double? MaxBarThickness { get; set; } + + /// + /// Set this to ensure that bars have a minimum length in pixels. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public double? MinBarLength { get; set; } + + //PointStyle + //https://www.chartjs.org/docs/latest/configuration/elements.html#point-styles + + /// + /// If , null or undefined values will not be used for spacing calculations when determining bar size. + /// + /// + /// Default value is . + /// + public bool SkipNull { get; set; } + + //Stack + //https://www.chartjs.org/docs/latest/charts/bar.html#general + + /// + /// The ID of the x axis to plot this dataset on. + /// + /// + /// Default value is first x axis. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public string? XAxisID { get; set; } + + /// + /// The ID of the y axis to plot this dataset on. + /// + /// + /// Default value is first y axis. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public string? YAxisID { get; set; } + + #endregion } public class BarChartDatasetDataLabels : ChartDatasetDataLabels diff --git a/blazorbootstrap/Models/Charts/ChartDataset/ChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/ChartDataset.cs index b149117bf..f2e3e35af 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/ChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/ChartDataset.cs @@ -5,80 +5,80 @@ public interface IChartDataset { } /// /// /// -public class ChartDataset : IChartDataset +public class ChartDataset : IChartDataset { - #region Constructors + #region Constructors - public ChartDataset() - { - Oid = Guid.NewGuid(); - } + public ChartDataset() + { + Oid = Guid.NewGuid(); + } - #endregion + #endregion - #region Properties, Indexers + #region Properties, Indexers - /// - /// How to clip relative to chartArea. Positive value allows overflow, negative value clips that many pixels inside - /// chartArea. 0 = clip at chartArea. - /// Clipping can also be configured per side: clip: {left: 5, top: false, right: -2, bottom: 0} - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string? Clip { get; set; } + /// + /// How to clip relative to chartArea. Positive value allows overflow, negative value clips that many pixels inside + /// chartArea. 0 = clip at chartArea. + /// Clipping can also be configured per side: clip: {left: 5, top: false, right: -2, bottom: 0} + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public string? Clip { get; set; } - /// - /// Get or sets the Data. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public object Data { get; set; } + /// + /// Get or sets the Data. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? Data { get; set; } - /// - /// Configures the visibility state of the dataset. Set it to , to hide the dataset from the chart. - /// - /// - /// Default value is . - /// - public bool Hidden { get; set; } + /// + /// Configures the visibility state of the dataset. Set it to , to hide the dataset from the chart. + /// + /// + /// Default value is . + /// + public bool Hidden { get; set; } - /// - /// The label for the dataset which appears in the legend and tooltips. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string? Label { get; set; } + /// + /// The label for the dataset which appears in the legend and tooltips. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public string? Label { get; set; } - /// - /// Get unique object id. - /// - public Guid Oid { get; private set; } + /// + /// Get unique object id. + /// + public Guid Oid { get; private set; } - /// - /// The drawing order of dataset. Also affects order for stacking, tooltip and legend. - /// - /// - /// Default value is 0. - /// - public int Order { get; set; } + /// + /// The drawing order of dataset. Also affects order for stacking, tooltip and legend. + /// + /// + /// Default value is 0. + /// + public int Order { get; set; } - //Stack - //https://www.chartjs.org/docs/latest/general/data-structures.html#dataset-configuration + //Stack + //https://www.chartjs.org/docs/latest/general/data-structures.html#dataset-configuration - /// - /// Gets or sets the chart type. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string? Type { get; protected set; } + /// + /// Gets or sets the chart type. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public string? Type { get; protected set; } - #endregion + #endregion } diff --git a/blazorbootstrap/Models/Charts/ChartDataset/DoughnutChart/DoughnutChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/DoughnutChart/DoughnutChartDataset.cs index 4dc7f7d91..91cb6e69a 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/DoughnutChart/DoughnutChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/DoughnutChart/DoughnutChartDataset.cs @@ -5,206 +5,197 @@ /// These are used to set display properties for a specific dataset. /// . /// -public class DoughnutChartDataset : ChartDataset +public class DoughnutChartDataset : ChartDataset { - #region Properties, Indexers - - /// - /// Arc background color. - /// - /// - /// Default value is 'rgba(0, 0, 0, 0.1)'. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? BackgroundColor { get; set; } - - /// - /// Supported values are 'center' and 'inner'. - /// When 'center' is set, the borders of arcs next to each other will overlap. - /// When 'inner' is set, it is guaranteed that all borders will not overlap. - /// - /// - /// Default value is 'center'. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? BorderAlign { get; set; } // TODO: change this to enum - - /// - /// Arc border color. - /// - /// - /// Default value is '#fff'. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? BorderColor { get; set; } - - /// - /// Arc border length and spacing of dashes. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? BorderDash { get; set; } - - /// - /// Arc border offset for line dashes. - /// - /// - /// Default value is 0.0. - /// - public double BorderDashOffset { get; set; } - - /// - /// Arc border join style. - /// Supported values are 'round', 'bevel', 'miter'. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? BorderJoinStyle { get; set; } // TODO: change this to enum - - /// - /// It is applied to all corners of the arc (outerStart, outerEnd, innerStart, innerRight). - /// - /// - /// Default value is 0. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? BorderRadius { get; set; } - - /// - /// Arc border width (in pixels). - /// - /// - /// Default value is 2. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? BorderWidth { get; set; } - - /// - /// Per-dataset override for the sweep that the arcs cover. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? Circumference { get; set; } - - /// - /// Get or sets the Data. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public new List? Data { get; set; } - - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public DoughnutChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link - - /// - /// Arc background color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? HoverBackgroundColor { get; set; } - - /// - /// Arc border color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? HoverBorderColor { get; set; } - - /// - /// Arc border length and spacing of dashes when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? HoverBorderDash { get; set; } - - /// - /// Arc border offset for line dashes when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? HoverBorderDashOffset { get; set; } - - /// - /// Arc border join style when hovered. - /// Supported values are 'round', 'bevel', 'miter'. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? HoverBorderJoinStyle { get; set; } // TODO: change this to enum - - /// - /// Arc border width when hovered (in pixels). - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? HoverBorderWidth { get; set; } - - /// - /// Arc offset when hovered (in pixels). - /// - /// - /// Default value is 0. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? HoverOffset { get; set; } - - /// - /// Arc offset (in pixels). - /// - /// - /// Default value is 0. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? Offset { get; set; } - - /// - /// Per-dataset override for the starting angle to draw arcs from. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? Rotation { get; set; } - - /// - /// Fixed arc offset (in pixels). Similar to but applies to all arcs. - /// - /// - /// Default value is 0. - /// - public double Spacing { get; set; } - - /// - /// The relative thickness of the dataset. - /// Providing a value for weight will cause the pie or doughnut dataset to be drawn - /// with a thickness relative to the sum of all the dataset weight values. - /// - /// - /// Default value is 1. - /// - public double Weight { get; set; } = 1; - - #endregion + #region Properties, Indexers + + /// + /// Arc background color. + /// + /// + /// Default value is 'rgba(0, 0, 0, 0.1)'. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? BackgroundColor { get; set; } + + /// + /// Supported values are 'center' and 'inner'. + /// When 'center' is set, the borders of arcs next to each other will overlap. + /// When 'inner' is set, it is guaranteed that all borders will not overlap. + /// + /// + /// Default value is 'center'. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? BorderAlign { get; set; } // TODO: change this to enum + + /// + /// Arc border color. + /// + /// + /// Default value is '#fff'. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? BorderColor { get; set; } + + /// + /// Arc border length and spacing of dashes. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? BorderDash { get; set; } + + /// + /// Arc border offset for line dashes. + /// + /// + /// Default value is 0.0. + /// + public double BorderDashOffset { get; set; } + + /// + /// Arc border join style. + /// Supported values are 'round', 'bevel', 'miter'. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? BorderJoinStyle { get; set; } // TODO: change this to enum + + /// + /// It is applied to all corners of the arc (outerStart, outerEnd, innerStart, innerRight). + /// + /// + /// Default value is 0. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? BorderRadius { get; set; } + + /// + /// Arc border width (in pixels). + /// + /// + /// Default value is 2. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? BorderWidth { get; set; } + + /// + /// Per-dataset override for the sweep that the arcs cover. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public double? Circumference { get; set; } + + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public DoughnutChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link + + /// + /// Arc background color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? HoverBackgroundColor { get; set; } + + /// + /// Arc border color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? HoverBorderColor { get; set; } + + /// + /// Arc border length and spacing of dashes when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? HoverBorderDash { get; set; } + + /// + /// Arc border offset for line dashes when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public double? HoverBorderDashOffset { get; set; } + + /// + /// Arc border join style when hovered. + /// Supported values are 'round', 'bevel', 'miter'. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? HoverBorderJoinStyle { get; set; } // TODO: change this to enum + + /// + /// Arc border width when hovered (in pixels). + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? HoverBorderWidth { get; set; } + + /// + /// Arc offset when hovered (in pixels). + /// + /// + /// Default value is 0. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? HoverOffset { get; set; } + + /// + /// Arc offset (in pixels). + /// + /// + /// Default value is 0. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? Offset { get; set; } + + /// + /// Per-dataset override for the starting angle to draw arcs from. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public double? Rotation { get; set; } + + /// + /// Fixed arc offset (in pixels). Similar to but applies to all arcs. + /// + /// + /// Default value is 0. + /// + public double Spacing { get; set; } + + /// + /// The relative thickness of the dataset. + /// Providing a value for weight will cause the pie or doughnut dataset to be drawn + /// with a thickness relative to the sum of all the dataset weight values. + /// + /// + /// Default value is 1. + /// + public double Weight { get; set; } = 1; + + #endregion } public class DoughnutChartDatasetDataLabels : ChartDatasetDataLabels diff --git a/blazorbootstrap/Models/Charts/ChartDataset/LineChart/LineChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/LineChart/LineChartDataset.cs index 8342eebf5..9ee118ab1 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/LineChart/LineChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/LineChart/LineChartDataset.cs @@ -5,342 +5,333 @@ /// These are used to set display properties for a specific dataset. /// . /// -public class LineChartDataset : ChartDataset +public class LineChartDataset : ChartDataset { - #region Properties, Indexers - - /// - /// Get or sets the line fill color. - /// - /// - /// Default value is 'rgba(0, 0, 0, 0.1)'. - /// - public string BackgroundColor { get; set; } = "rgba(0, 0, 0, 0.1)"; - - /// - /// Cap style of the line. - /// Supported values are 'butt', 'round', and 'square'. - /// - /// - /// Default value is 'butt'. - /// - public string BorderCapStyle { get; set; } = "butt"; - - /// - /// Get or sets the line color. - /// - /// - /// Default value is 'rgba(0, 0, 0, 0.1)'. - /// - public string BorderColor { get; set; } = "rgba(0, 0, 0, 0.1)"; - - /// - /// Gets or sets the length and spacing of dashes. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? BorderDash { get; set; } - - /// - /// Offset for line dashes. - /// - /// - /// Default value is 0.0. - /// - public double BorderDashOffset { get; set; } - - /// - /// Line joint style. - /// There are three possible values for this property: 'round', 'bevel', and 'miter'. - /// - /// - /// Default value is 'miter'. - /// - public string BorderJoinStyle { get; set; } = "miter"; - - /// - /// Gets or sets the line width (in pixels). - /// - /// - /// Default value is 3. - /// - public double BorderWidth { get; set; } = 3; - - /// - /// . - /// Supported values are 'default', and 'monotone'. - /// - /// - /// Default value is 'default'. - /// - public string CubicInterpolationMode { get; set; } = "default"; - - /// - /// Get or sets the Data. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public new List? Data { get; set; } - - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public LineChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link - - /// - /// Draw the active points of a dataset over the other points of the dataset. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? DrawActiveElementsOnTop { get; set; } - - /// - /// How to fill the area under the line. - /// - /// - /// Default value is . - /// - public bool Fill { get; set; } - - /// - /// The line fill color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string? HoverBackgroundColor { get; set; } - - /// - /// Cap style of the line when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string? HoverBorderCapStyle { get; set; } - - /// - /// The line color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string? HoverBorderColor { get; set; } - - /// - /// Gets or sets the length and spacing of dashes when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? HoverBorderDash { get; set; } - - /// - /// Offset for line dashes when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? HoverBorderDashOffset { get; set; } - - /// - /// Line joint style. - /// There are three possible values for this property: 'round', 'bevel', and 'miter'. - /// - /// - /// Default value is 'miter'. - /// - public string HoverBorderJoinStyle { get; set; } = "miter"; - - /// - /// The bar border width when hovered (in pixels) when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? HoverBorderWidth { get; set; } - - /// - /// The base axis of the dataset. 'x' for horizontal lines and 'y' for vertical lines. - /// - /// - /// Default value is 'x'. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string? IndexAxis { get; set; } - - /// - /// The fill color for points. - /// - /// - /// Default value is 'rgba(0, 0, 0, 0.1)'. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? PointBackgroundColor { get; set; } - - /// - /// The border color for points. - /// - /// - /// Default value is 'rgba(0, 0, 0, 0.1)'. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? PointBorderColor { get; set; } - - /// - /// The width of the point border in pixels. - /// - /// - /// Default value is 1. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? PointBorderWidth { get; set; } - - /// - /// The pixel size of the non-displayed point that reacts to mouse events. - /// - /// - /// Default value is 1. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? PointHitRadius { get; set; } - - /// - /// Point background color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? PointHoverBackgroundColor { get; set; } - - /// - /// Point border color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? PointHoverBorderColor { get; set; } - - /// - /// Border width of point when hovered. - /// - /// - /// Default value is 1. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? PointHoverBorderWidth { get; set; } - - /// - /// The radius of the point when hovered. - /// - /// - /// Default value is 4. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? PointHoverRadius { get; set; } - - /// - /// The radius of the point shape. If set to 0, the point is not rendered. - /// - /// - /// Default value is 3. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? PointRadius { get; set; } - - /// - /// The rotation of the point in degrees. - /// - /// - /// Default value is 0. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? PointRotation { get; set; } - - /// - /// Style of the point. - /// Supported values are 'circle', 'cross', 'crossRot', 'dash', 'line', 'rect', 'rectRounded', 'rectRot', 'star', and 'triangle' to style. - /// the point. - /// - /// - /// Default value is 'circle'. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? PointStyle { get; set; } - - //segment - //https://www.chartjs.org/docs/latest/charts/line.html#segment - - /// - /// If , the lines between points are not drawn. - /// - /// - /// Default value is . - /// - public bool ShowLine { get; set; } = true; - - /// - /// If , lines will be drawn between points with no or null data. - /// If , points with null data will create a break in the line. - /// Can also be a number specifying the maximum gap length to span. - /// The unit of the value depends on the scale used. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? SpanGaps { get; set; } - - //stack - //https://www.chartjs.org/docs/latest/charts/line.html#general - - /// - /// true to show the line as a stepped line (tension will be ignored). - /// - /// - /// Default value is . - /// - public bool Stepped { get; set; } - - /// - /// Bezier curve tension of the line. Set to 0 to draw straight lines. - /// This option is ignored if monotone cubic interpolation is used. - /// - /// - /// Default value is 0. - /// - public double Tension { get; set; } - - /// - /// The ID of the x axis to plot this dataset on. - /// - /// - /// Default value is 'first x axis'. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string? XAxisID { get; set; } - - /// - /// The ID of the y axis to plot this dataset on. - /// - /// - /// Default value is 'first y axis'. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string? YAxisID { get; set; } - - #endregion + #region Properties, Indexers + + /// + /// Get or sets the line fill color. + /// + /// + /// Default value is 'rgba(0, 0, 0, 0.1)'. + /// + public string BackgroundColor { get; set; } = "rgba(0, 0, 0, 0.1)"; + + /// + /// Cap style of the line. + /// Supported values are 'butt', 'round', and 'square'. + /// + /// + /// Default value is 'butt'. + /// + public string BorderCapStyle { get; set; } = "butt"; + + /// + /// Get or sets the line color. + /// + /// + /// Default value is 'rgba(0, 0, 0, 0.1)'. + /// + public string BorderColor { get; set; } = "rgba(0, 0, 0, 0.1)"; + + /// + /// Gets or sets the length and spacing of dashes. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? BorderDash { get; set; } + + /// + /// Offset for line dashes. + /// + /// + /// Default value is 0.0. + /// + public double BorderDashOffset { get; set; } + + /// + /// Line joint style. + /// There are three possible values for this property: 'round', 'bevel', and 'miter'. + /// + /// + /// Default value is 'miter'. + /// + public string BorderJoinStyle { get; set; } = "miter"; + + /// + /// Gets or sets the line width (in pixels). + /// + /// + /// Default value is 3. + /// + public double BorderWidth { get; set; } = 3; + + /// + /// . + /// Supported values are 'default', and 'monotone'. + /// + /// + /// Default value is 'default'. + /// + public string CubicInterpolationMode { get; set; } = "default"; + + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public LineChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link + + /// + /// Draw the active points of a dataset over the other points of the dataset. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? DrawActiveElementsOnTop { get; set; } + + /// + /// How to fill the area under the line. + /// + /// + /// Default value is . + /// + public bool Fill { get; set; } + + /// + /// The line fill color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public string? HoverBackgroundColor { get; set; } + + /// + /// Cap style of the line when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public string? HoverBorderCapStyle { get; set; } + + /// + /// The line color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public string? HoverBorderColor { get; set; } + + /// + /// Gets or sets the length and spacing of dashes when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? HoverBorderDash { get; set; } + + /// + /// Offset for line dashes when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public double? HoverBorderDashOffset { get; set; } + + /// + /// Line joint style. + /// There are three possible values for this property: 'round', 'bevel', and 'miter'. + /// + /// + /// Default value is 'miter'. + /// + public string HoverBorderJoinStyle { get; set; } = "miter"; + + /// + /// The bar border width when hovered (in pixels) when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public double? HoverBorderWidth { get; set; } + + /// + /// The base axis of the dataset. 'x' for horizontal lines and 'y' for vertical lines. + /// + /// + /// Default value is 'x'. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public string? IndexAxis { get; set; } + + /// + /// The fill color for points. + /// + /// + /// Default value is 'rgba(0, 0, 0, 0.1)'. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? PointBackgroundColor { get; set; } + + /// + /// The border color for points. + /// + /// + /// Default value is 'rgba(0, 0, 0, 0.1)'. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? PointBorderColor { get; set; } + + /// + /// The width of the point border in pixels. + /// + /// + /// Default value is 1. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? PointBorderWidth { get; set; } + + /// + /// The pixel size of the non-displayed point that reacts to mouse events. + /// + /// + /// Default value is 1. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? PointHitRadius { get; set; } + + /// + /// Point background color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? PointHoverBackgroundColor { get; set; } + + /// + /// Point border color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? PointHoverBorderColor { get; set; } + + /// + /// Border width of point when hovered. + /// + /// + /// Default value is 1. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? PointHoverBorderWidth { get; set; } + + /// + /// The radius of the point when hovered. + /// + /// + /// Default value is 4. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? PointHoverRadius { get; set; } + + /// + /// The radius of the point shape. If set to 0, the point is not rendered. + /// + /// + /// Default value is 3. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? PointRadius { get; set; } + + /// + /// The rotation of the point in degrees. + /// + /// + /// Default value is 0. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? PointRotation { get; set; } + + /// + /// Style of the point. + /// Supported values are 'circle', 'cross', 'crossRot', 'dash', 'line', 'rect', 'rectRounded', 'rectRot', 'star', and 'triangle' to style. + /// the point. + /// + /// + /// Default value is 'circle'. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? PointStyle { get; set; } + + //segment + //https://www.chartjs.org/docs/latest/charts/line.html#segment + + /// + /// If , the lines between points are not drawn. + /// + /// + /// Default value is . + /// + public bool ShowLine { get; set; } = true; + + /// + /// If , lines will be drawn between points with no or null data. + /// If , points with null data will create a break in the line. + /// Can also be a number specifying the maximum gap length to span. + /// The unit of the value depends on the scale used. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public bool? SpanGaps { get; set; } + + //stack + //https://www.chartjs.org/docs/latest/charts/line.html#general + + /// + /// true to show the line as a stepped line (tension will be ignored). + /// + /// + /// Default value is . + /// + public bool Stepped { get; set; } + + /// + /// Bezier curve tension of the line. Set to 0 to draw straight lines. + /// This option is ignored if monotone cubic interpolation is used. + /// + /// + /// Default value is 0. + /// + public double Tension { get; set; } + + /// + /// The ID of the x axis to plot this dataset on. + /// + /// + /// Default value is 'first x axis'. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public string? XAxisID { get; set; } + + /// + /// The ID of the y axis to plot this dataset on. + /// + /// + /// Default value is 'first y axis'. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public string? YAxisID { get; set; } + + #endregion } public class LineChartDatasetDataLabels : ChartDatasetDataLabels diff --git a/blazorbootstrap/Models/Charts/ChartDataset/PieChart/PieChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/PieChart/PieChartDataset.cs index 2d39b83a4..030a5a664 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/PieChart/PieChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/PieChart/PieChartDataset.cs @@ -5,206 +5,197 @@ /// These are used to set display properties for a specific dataset. /// . /// -public class PieChartDataset : ChartDataset +public class PieChartDataset : ChartDataset { - #region Properties, Indexers - - /// - /// Arc background color. - /// - /// - /// Default value is 'rgba(0, 0, 0, 0.1)'. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? BackgroundColor { get; set; } - - /// - /// Supported values are 'center' and 'inner'. - /// When 'center' is set, the borders of arcs next to each other will overlap. - /// When 'inner' is set, it is guaranteed that all borders will not overlap. - /// - /// - /// Default value is 'center'. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? BorderAlign { get; set; } // TODO: change this to enum - - /// - /// Arc border color. - /// - /// - /// Default value is '#fff'. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? BorderColor { get; set; } - - /// - /// Arc border length and spacing of dashes. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? BorderDash { get; set; } - - /// - /// Arc border offset for line dashes. - /// - /// - /// Default value is 0.0. - /// - public double BorderDashOffset { get; set; } - - /// - /// Arc border join style. - /// Supported values are 'round', 'bevel', 'miter'. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? BorderJoinStyle { get; set; } // TODO: change this to enum - - /// - /// It is applied to all corners of the arc (outerStart, outerEnd, innerStart, innerRight). - /// - /// - /// Default value is 0. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? BorderRadius { get; set; } - - /// - /// Arc border width (in pixels). - /// - /// - /// Default value is 2. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? BorderWidth { get; set; } - - /// - /// Per-dataset override for the sweep that the arcs cover. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? Circumference { get; set; } - - /// - /// Get or sets the Data. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public new List? Data { get; set; } - - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public PieChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link - - /// - /// Arc background color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? HoverBackgroundColor { get; set; } - - /// - /// Arc border color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? HoverBorderColor { get; set; } - - /// - /// Arc border length and spacing of dashes when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? HoverBorderDash { get; set; } - - /// - /// Arc border offset for line dashes when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? HoverBorderDashOffset { get; set; } - - /// - /// Arc border join style when hovered. - /// Supported values are 'round', 'bevel', 'miter'. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? HoverBorderJoinStyle { get; set; } // TODO: change this to enum - - /// - /// Arc border width when hovered (in pixels). - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? HoverBorderWidth { get; set; } - - /// - /// Arc offset when hovered (in pixels). - /// - /// - /// Default value is 0. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? HoverOffset { get; set; } - - /// - /// Arc offset (in pixels). - /// - /// - /// Default value is 0. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? Offset { get; set; } - - /// - /// Per-dataset override for the starting angle to draw arcs from. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? Rotation { get; set; } - - /// - /// Fixed arc offset (in pixels). Similar to but applies to all arcs. - /// - /// - /// Default value is 0. - /// - public double Spacing { get; set; } - - /// - /// The relative thickness of the dataset. - /// Providing a value for weight will cause the pie or doughnut dataset to be drawn - /// with a thickness relative to the sum of all the dataset weight values. - /// - /// - /// Default value is 1. - /// - public double Weight { get; set; } = 1; - - #endregion + #region Properties, Indexers + + /// + /// Arc background color. + /// + /// + /// Default value is 'rgba(0, 0, 0, 0.1)'. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? BackgroundColor { get; set; } + + /// + /// Supported values are 'center' and 'inner'. + /// When 'center' is set, the borders of arcs next to each other will overlap. + /// When 'inner' is set, it is guaranteed that all borders will not overlap. + /// + /// + /// Default value is 'center'. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? BorderAlign { get; set; } // TODO: change this to enum + + /// + /// Arc border color. + /// + /// + /// Default value is '#fff'. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? BorderColor { get; set; } + + /// + /// Arc border length and spacing of dashes. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? BorderDash { get; set; } + + /// + /// Arc border offset for line dashes. + /// + /// + /// Default value is 0.0. + /// + public double BorderDashOffset { get; set; } + + /// + /// Arc border join style. + /// Supported values are 'round', 'bevel', 'miter'. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? BorderJoinStyle { get; set; } // TODO: change this to enum + + /// + /// It is applied to all corners of the arc (outerStart, outerEnd, innerStart, innerRight). + /// + /// + /// Default value is 0. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? BorderRadius { get; set; } + + /// + /// Arc border width (in pixels). + /// + /// + /// Default value is 2. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? BorderWidth { get; set; } + + /// + /// Per-dataset override for the sweep that the arcs cover. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public double? Circumference { get; set; } + + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public PieChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link + + /// + /// Arc background color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? HoverBackgroundColor { get; set; } + + /// + /// Arc border color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? HoverBorderColor { get; set; } + + /// + /// Arc border length and spacing of dashes when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? HoverBorderDash { get; set; } + + /// + /// Arc border offset for line dashes when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public double? HoverBorderDashOffset { get; set; } + + /// + /// Arc border join style when hovered. + /// Supported values are 'round', 'bevel', 'miter'. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? HoverBorderJoinStyle { get; set; } // TODO: change this to enum + + /// + /// Arc border width when hovered (in pixels). + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? HoverBorderWidth { get; set; } + + /// + /// Arc offset when hovered (in pixels). + /// + /// + /// Default value is 0. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? HoverOffset { get; set; } + + /// + /// Arc offset (in pixels). + /// + /// + /// Default value is 0. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? Offset { get; set; } + + /// + /// Per-dataset override for the starting angle to draw arcs from. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public double? Rotation { get; set; } + + /// + /// Fixed arc offset (in pixels). Similar to but applies to all arcs. + /// + /// + /// Default value is 0. + /// + public double Spacing { get; set; } + + /// + /// The relative thickness of the dataset. + /// Providing a value for weight will cause the pie or doughnut dataset to be drawn + /// with a thickness relative to the sum of all the dataset weight values. + /// + /// + /// Default value is 1. + /// + public double Weight { get; set; } = 1; + + #endregion } public class PieChartDatasetDataLabels : ChartDatasetDataLabels diff --git a/blazorbootstrap/Models/Charts/ChartDataset/PolarAreaChart/PolarAreaChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/PolarAreaChart/PolarAreaChartDataset.cs index feb137587..c2f8b7cd9 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/PolarAreaChart/PolarAreaChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/PolarAreaChart/PolarAreaChartDataset.cs @@ -1,150 +1,141 @@ namespace BlazorBootstrap; -public class PolarAreaChartDataset : ChartDataset +public class PolarAreaChartDataset : ChartDataset { - #region Properties, Indexers - - /// - /// Arc background color. - /// - /// - /// Default value is 'rgba(0, 0, 0, 0.1)'. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? BackgroundColor { get; set; } - - /// - /// Supported values are 'center' and 'inner'. - /// When 'center' is set, the borders of arcs next to each other will overlap. - /// When 'inner' is set, it is guaranteed that all borders will not overlap. - /// - /// - /// Default value is 'center'. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? BorderAlign { get; set; } // TODO: change this to enum - - /// - /// Arc border color. - /// - /// - /// Default value is '#fff'. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? BorderColor { get; set; } - - /// - /// Arc border length and spacing of dashes. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? BorderDash { get; set; } - - /// - /// Arc border offset for line dashes. - /// - /// - /// Default value is 0.0. - /// - public double BorderDashOffset { get; set; } - - /// - /// Arc border join style. - /// Supported values are 'round', 'bevel', 'miter'. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? BorderJoinStyle { get; set; } // TODO: change this to enum - - /// - /// Arc border width (in pixels). - /// - /// - /// Default value is 2. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? BorderWidth { get; set; } - - /// - /// By default the Arc is curved. If , the Arc will be flat. - /// - /// - /// Default value is . - /// - public bool Circular { get; set; } = true; - - /// - /// Get or sets the Data. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public new List? Data { get; set; } - - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public PieChartDatasetDataLabels Datalabels { get; set; } = new(); - - /// - /// Arc background color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? HoverBackgroundColor { get; set; } - - /// - /// Arc border color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? HoverBorderColor { get; set; } - - /// - /// Arc border length and spacing of dashes when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? HoverBorderDash { get; set; } - - /// - /// Arc border offset for line dashes when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? HoverBorderDashOffset { get; set; } - - /// - /// Arc border join style when hovered. - /// Supported values are 'round', 'bevel', 'miter'. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? HoverBorderJoinStyle { get; set; } // TODO: change this to enum - - /// - /// Arc border width when hovered (in pixels). - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? HoverBorderWidth { get; set; } - - #endregion + #region Properties, Indexers + + /// + /// Arc background color. + /// + /// + /// Default value is 'rgba(0, 0, 0, 0.1)'. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? BackgroundColor { get; set; } + + /// + /// Supported values are 'center' and 'inner'. + /// When 'center' is set, the borders of arcs next to each other will overlap. + /// When 'inner' is set, it is guaranteed that all borders will not overlap. + /// + /// + /// Default value is 'center'. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? BorderAlign { get; set; } // TODO: change this to enum + + /// + /// Arc border color. + /// + /// + /// Default value is '#fff'. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? BorderColor { get; set; } + + /// + /// Arc border length and spacing of dashes. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? BorderDash { get; set; } + + /// + /// Arc border offset for line dashes. + /// + /// + /// Default value is 0.0. + /// + public double BorderDashOffset { get; set; } + + /// + /// Arc border join style. + /// Supported values are 'round', 'bevel', 'miter'. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? BorderJoinStyle { get; set; } // TODO: change this to enum + + /// + /// Arc border width (in pixels). + /// + /// + /// Default value is 2. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? BorderWidth { get; set; } + + /// + /// By default the Arc is curved. If , the Arc will be flat. + /// + /// + /// Default value is . + /// + public bool Circular { get; set; } = true; + + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public PieChartDatasetDataLabels Datalabels { get; set; } = new(); + + /// + /// Arc background color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? HoverBackgroundColor { get; set; } + + /// + /// Arc border color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? HoverBorderColor { get; set; } + + /// + /// Arc border length and spacing of dashes when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? HoverBorderDash { get; set; } + + /// + /// Arc border offset for line dashes when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public double? HoverBorderDashOffset { get; set; } + + /// + /// Arc border join style when hovered. + /// Supported values are 'round', 'bevel', 'miter'. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? HoverBorderJoinStyle { get; set; } // TODO: change this to enum + + /// + /// Arc border width when hovered (in pixels). + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? HoverBorderWidth { get; set; } + + #endregion } public class PolarAreaChartDatasetDataLabels : ChartDatasetDataLabels diff --git a/blazorbootstrap/Models/Charts/ChartDataset/RadarChart/RadarChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/RadarChart/RadarChartDataset.cs index bdae10aca..6f2bf590b 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/RadarChart/RadarChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/RadarChart/RadarChartDataset.cs @@ -5,275 +5,266 @@ /// They are often useful for comparing the points of two or more different data sets. /// . /// -public class RadarChartDataset : ChartDataset +public class RadarChartDataset : ChartDataset { - #region Properties, Indexers - - /// - /// Get or sets the line fill color. - /// - /// - /// Default value is 'rgba(0, 0, 0, 0.1)'. - /// - public string BackgroundColor { get; set; } = "rgba(0, 0, 0, 0.1)"; - - /// - /// Cap style of the line. - /// Supported values are 'butt', 'round', and 'square'. - /// - /// - /// Default value is 'butt'. - /// - public string BorderCapStyle { get; set; } = "butt"; - - /// - /// Get or sets the line color. - /// - /// - /// Default value is 'rgba(0, 0, 0, 0.1)'. - /// - public string BorderColor { get; set; } = "rgba(0, 0, 0, 0.1)"; - - /// - /// Gets or sets the length and spacing of dashes. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? BorderDash { get; set; } - - /// - /// Offset for line dashes. - /// - /// - /// Default value is 0.0. - /// - public double BorderDashOffset { get; set; } - - /// - /// Line joint style. - /// There are three possible values for this property: 'round', 'bevel', and 'miter'. - /// - /// - /// Default value is 'miter'. - /// - public string BorderJoinStyle { get; set; } = "miter"; - - /// - /// Gets or sets the line width (in pixels). - /// - /// - /// Default value is 3. - /// - public double BorderWidth { get; set; } = 3; - - /// - /// Get or sets the Data. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public new List? Data { get; set; } - - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public RadarChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: Add reference link - - /// - /// How to fill the area under the line. - /// - /// - /// Default value is . - /// - public bool Fill { get; set; } - - /// - /// The line fill color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string? HoverBackgroundColor { get; set; } - - /// - /// Cap style of the line when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string? HoverBorderCapStyle { get; set; } - - /// - /// The line color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string? HoverBorderColor { get; set; } - - /// - /// Gets or sets the length and spacing of dashes when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? HoverBorderDash { get; set; } - - /// - /// Offset for line dashes when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? HoverBorderDashOffset { get; set; } - - /// - /// Line joint style. - /// There are three possible values for this property: 'round', 'bevel', and 'miter'. - /// - /// - /// Default value is 'miter'. - /// - public string HoverBorderJoinStyle { get; set; } = "miter"; - - /// - /// The bar border width when hovered (in pixels) when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? HoverBorderWidth { get; set; } - - /// - /// The fill color for points. - /// - /// - /// Default value is 'rgba(0, 0, 0, 0.1)'. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? PointBackgroundColor { get; set; } - - /// - /// The border color for points. - /// - /// - /// Default value is 'rgba(0, 0, 0, 0.1)'. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? PointBorderColor { get; set; } - - /// - /// The width of the point border in pixels. - /// - /// - /// Default value is 1. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? PointBorderWidth { get; set; } - - /// - /// The pixel size of the non-displayed point that reacts to mouse events. - /// - /// - /// Default value is 1. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? PointHitRadius { get; set; } - - /// - /// Point background color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? PointHoverBackgroundColor { get; set; } - - /// - /// Point border color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? PointHoverBorderColor { get; set; } - - /// - /// Border width of point when hovered. - /// - /// - /// Default value is 1. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? PointHoverBorderWidth { get; set; } - - /// - /// The radius of the point when hovered. - /// - /// - /// Default value is 4. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? PointHoverRadius { get; set; } - - /// - /// The radius of the point shape. If set to 0, the point is not rendered. - /// - /// - /// Default value is 3. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? PointRadius { get; set; } - - /// - /// The rotation of the point in degrees. - /// - /// - /// Default value is 0. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? PointRotation { get; set; } - - /// - /// Style of the point. - /// Supported values are 'circle', 'cross', 'crossRot', 'dash', 'line', 'rect', 'rectRounded', 'rectRot', 'star', and 'triangle' to style. - /// the point. - /// - /// - /// Default value is 'circle'. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? PointStyle { get; set; } - - /// - /// If , lines will be drawn between points with no or null data. - /// If , points with null data will create a break in the line. - /// Can also be a number specifying the maximum gap length to span. - /// The unit of the value depends on the scale used. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? SpanGaps { get; set; } - - /// - /// Bezier curve tension of the line. Set to 0 to draw straight lines. - /// This option is ignored if monotone cubic interpolation is used. - /// - /// - /// Default value is 0. - /// - public double Tension { get; set; } - - #endregion + #region Properties, Indexers + + /// + /// Get or sets the line fill color. + /// + /// + /// Default value is 'rgba(0, 0, 0, 0.1)'. + /// + public string BackgroundColor { get; set; } = "rgba(0, 0, 0, 0.1)"; + + /// + /// Cap style of the line. + /// Supported values are 'butt', 'round', and 'square'. + /// + /// + /// Default value is 'butt'. + /// + public string BorderCapStyle { get; set; } = "butt"; + + /// + /// Get or sets the line color. + /// + /// + /// Default value is 'rgba(0, 0, 0, 0.1)'. + /// + public string BorderColor { get; set; } = "rgba(0, 0, 0, 0.1)"; + + /// + /// Gets or sets the length and spacing of dashes. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? BorderDash { get; set; } + + /// + /// Offset for line dashes. + /// + /// + /// Default value is 0.0. + /// + public double BorderDashOffset { get; set; } + + /// + /// Line joint style. + /// There are three possible values for this property: 'round', 'bevel', and 'miter'. + /// + /// + /// Default value is 'miter'. + /// + public string BorderJoinStyle { get; set; } = "miter"; + + /// + /// Gets or sets the line width (in pixels). + /// + /// + /// Default value is 3. + /// + public double BorderWidth { get; set; } = 3; + + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public RadarChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: Add reference link + + /// + /// How to fill the area under the line. + /// + /// + /// Default value is . + /// + public bool Fill { get; set; } + + /// + /// The line fill color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public string? HoverBackgroundColor { get; set; } + + /// + /// Cap style of the line when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public string? HoverBorderCapStyle { get; set; } + + /// + /// The line color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public string? HoverBorderColor { get; set; } + + /// + /// Gets or sets the length and spacing of dashes when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? HoverBorderDash { get; set; } + + /// + /// Offset for line dashes when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public double? HoverBorderDashOffset { get; set; } + + /// + /// Line joint style. + /// There are three possible values for this property: 'round', 'bevel', and 'miter'. + /// + /// + /// Default value is 'miter'. + /// + public string HoverBorderJoinStyle { get; set; } = "miter"; + + /// + /// The bar border width when hovered (in pixels) when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public double? HoverBorderWidth { get; set; } + + /// + /// The fill color for points. + /// + /// + /// Default value is 'rgba(0, 0, 0, 0.1)'. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? PointBackgroundColor { get; set; } + + /// + /// The border color for points. + /// + /// + /// Default value is 'rgba(0, 0, 0, 0.1)'. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? PointBorderColor { get; set; } + + /// + /// The width of the point border in pixels. + /// + /// + /// Default value is 1. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? PointBorderWidth { get; set; } + + /// + /// The pixel size of the non-displayed point that reacts to mouse events. + /// + /// + /// Default value is 1. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? PointHitRadius { get; set; } + + /// + /// Point background color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? PointHoverBackgroundColor { get; set; } + + /// + /// Point border color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? PointHoverBorderColor { get; set; } + + /// + /// Border width of point when hovered. + /// + /// + /// Default value is 1. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? PointHoverBorderWidth { get; set; } + + /// + /// The radius of the point when hovered. + /// + /// + /// Default value is 4. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? PointHoverRadius { get; set; } + + /// + /// The radius of the point shape. If set to 0, the point is not rendered. + /// + /// + /// Default value is 3. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? PointRadius { get; set; } + + /// + /// The rotation of the point in degrees. + /// + /// + /// Default value is 0. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? PointRotation { get; set; } + + /// + /// Style of the point. + /// Supported values are 'circle', 'cross', 'crossRot', 'dash', 'line', 'rect', 'rectRounded', 'rectRot', 'star', and 'triangle' to style. + /// the point. + /// + /// + /// Default value is 'circle'. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? PointStyle { get; set; } + + /// + /// If , lines will be drawn between points with no or null data. + /// If , points with null data will create a break in the line. + /// Can also be a number specifying the maximum gap length to span. + /// The unit of the value depends on the scale used. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public bool? SpanGaps { get; set; } + + /// + /// Bezier curve tension of the line. Set to 0 to draw straight lines. + /// This option is ignored if monotone cubic interpolation is used. + /// + /// + /// Default value is 0. + /// + public double Tension { get; set; } + + #endregion } public class RadarChartDatasetDataLabels : ChartDatasetDataLabels diff --git a/blazorbootstrap/Models/Charts/ChartDataset/ScatterChart/ScatterChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/ScatterChart/ScatterChartDataset.cs index 0e396e385..c1b609167 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/ScatterChart/ScatterChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/ScatterChart/ScatterChartDataset.cs @@ -7,343 +7,334 @@ /// 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 . /// -public class ScatterChartDataset : ChartDataset +public class ScatterChartDataset : ChartDataset { - #region Properties, Indexers - - /// - /// Get or sets the line fill color. - /// - /// - /// Default value is 'rgba(0, 0, 0, 0.1)'. - /// - public string BackgroundColor { get; set; } = "rgba(0, 0, 0, 0.1)"; - - /// - /// Cap style of the line. - /// Supported values are 'butt', 'round', and 'square'. - /// - /// - /// Default value is 'butt'. - /// - public string BorderCapStyle { get; set; } = "butt"; - - /// - /// Get or sets the line color. - /// - /// - /// Default value is 'rgba(0, 0, 0, 0.1)'. - /// - public string BorderColor { get; set; } = "rgba(0, 0, 0, 0.1)"; - - /// - /// Gets or sets the length and spacing of dashes. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? BorderDash { get; set; } - - /// - /// Offset for line dashes. - /// - /// - /// Default value is 0.0. - /// - public double BorderDashOffset { get; set; } - - /// - /// Line joint style. - /// There are three possible values for this property: 'round', 'bevel', and 'miter'. - /// - /// - /// Default value is 'miter'. - /// - public string BorderJoinStyle { get; set; } = "miter"; - - /// - /// Gets or sets the line width (in pixels). - /// - /// - /// Default value is 3. - /// - public double BorderWidth { get; set; } = 3; - - /// - /// . - /// Supported values are 'default', and 'monotone'. - /// - /// - /// Default value is 'default'. - /// - public string CubicInterpolationMode { get; set; } = "default"; - - /// - /// Get or sets the Data. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public new List? Data { get; set; } - - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public LineChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link - - /// - /// Draw the active points of a dataset over the other points of the dataset. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? DrawActiveElementsOnTop { get; set; } - - /// - /// How to fill the area under the line. - /// - /// - /// Default value is . - /// - public bool Fill { get; set; } - - /// - /// The line fill color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string? HoverBackgroundColor { get; set; } - - /// - /// Cap style of the line when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string? HoverBorderCapStyle { get; set; } - - /// - /// The line color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string? HoverBorderColor { get; set; } - - /// - /// Gets or sets the length and spacing of dashes when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? HoverBorderDash { get; set; } - - /// - /// Offset for line dashes when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? HoverBorderDashOffset { get; set; } - - /// - /// Line joint style. - /// There are three possible values for this property: 'round', 'bevel', and 'miter'. - /// - /// - /// Default value is 'miter'. - /// - public string HoverBorderJoinStyle { get; set; } = "miter"; - - /// - /// The bar border width when hovered (in pixels) when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? HoverBorderWidth { get; set; } - - /// - /// The base axis of the dataset. 'x' for horizontal lines and 'y' for vertical lines. - /// - /// - /// Default value is 'x'. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string? IndexAxis { get; set; } - - /// - /// The fill color for points. - /// - /// - /// Default value is 'rgba(0, 0, 0, 0.1)'. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? PointBackgroundColor { get; set; } - - /// - /// The border color for points. - /// - /// - /// Default value is 'rgba(0, 0, 0, 0.1)'. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? PointBorderColor { get; set; } - - /// - /// The width of the point border in pixels. - /// - /// - /// Default value is 1. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? PointBorderWidth { get; set; } - - /// - /// The pixel size of the non-displayed point that reacts to mouse events. - /// - /// - /// Default value is 1. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? PointHitRadius { get; set; } - - /// - /// Point background color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? PointHoverBackgroundColor { get; set; } - - /// - /// Point border color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? PointHoverBorderColor { get; set; } - - /// - /// Border width of point when hovered. - /// - /// - /// Default value is 1. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? PointHoverBorderWidth { get; set; } - - /// - /// The radius of the point when hovered. - /// - /// - /// Default value is 4. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? PointHoverRadius { get; set; } - - /// - /// The radius of the point shape. If set to 0, the point is not rendered. - /// - /// - /// Default value is 3. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? PointRadius { get; set; } - - /// - /// The rotation of the point in degrees. - /// - /// - /// Default value is 0. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? PointRotation { get; set; } - - /// - /// Style of the point. - /// Supported values are 'circle', 'cross', 'crossRot', 'dash', 'line', 'rect', 'rectRounded', 'rectRot', 'star', and 'triangle' to style. - /// the point. - /// - /// - /// Default value is 'circle'. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public List? PointStyle { get; set; } - - //segment - //https://www.chartjs.org/docs/latest/charts/line.html#segment - - /// - /// If , the lines between points are not drawn. - /// By default, the scatter chart will override the showLine property of the line chart to false. - /// - /// - /// Default value is . - /// - public bool ShowLine { get; } = false; - - /// - /// If , lines will be drawn between points with no or null data. - /// If , points with null data will create a break in the line. - /// Can also be a number specifying the maximum gap length to span. - /// The unit of the value depends on the scale used. - /// - /// - /// Default value is . - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? SpanGaps { get; set; } - - //stack - //https://www.chartjs.org/docs/latest/charts/line.html#general - - /// - /// true to show the line as a stepped line (tension will be ignored). - /// - /// - /// Default value is . - /// - public bool Stepped { get; set; } - - /// - /// Bezier curve tension of the line. Set to 0 to draw straight lines. - /// This option is ignored if monotone cubic interpolation is used. - /// - /// - /// Default value is 0. - /// - public double Tension { get; set; } - - /// - /// The ID of the x axis to plot this dataset on. - /// - /// - /// Default value is 'first x axis'. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string? XAxisID { get; set; } - - /// - /// The ID of the y axis to plot this dataset on. - /// - /// - /// Default value is 'first y axis'. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string? YAxisID { get; set; } - - #endregion + #region Properties, Indexers + + /// + /// Get or sets the line fill color. + /// + /// + /// Default value is 'rgba(0, 0, 0, 0.1)'. + /// + public string BackgroundColor { get; set; } = "rgba(0, 0, 0, 0.1)"; + + /// + /// Cap style of the line. + /// Supported values are 'butt', 'round', and 'square'. + /// + /// + /// Default value is 'butt'. + /// + public string BorderCapStyle { get; set; } = "butt"; + + /// + /// Get or sets the line color. + /// + /// + /// Default value is 'rgba(0, 0, 0, 0.1)'. + /// + public string BorderColor { get; set; } = "rgba(0, 0, 0, 0.1)"; + + /// + /// Gets or sets the length and spacing of dashes. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? BorderDash { get; set; } + + /// + /// Offset for line dashes. + /// + /// + /// Default value is 0.0. + /// + public double BorderDashOffset { get; set; } + + /// + /// Line joint style. + /// There are three possible values for this property: 'round', 'bevel', and 'miter'. + /// + /// + /// Default value is 'miter'. + /// + public string BorderJoinStyle { get; set; } = "miter"; + + /// + /// Gets or sets the line width (in pixels). + /// + /// + /// Default value is 3. + /// + public double BorderWidth { get; set; } = 3; + + /// + /// . + /// Supported values are 'default', and 'monotone'. + /// + /// + /// Default value is 'default'. + /// + public string CubicInterpolationMode { get; set; } = "default"; + + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public LineChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link + + /// + /// Draw the active points of a dataset over the other points of the dataset. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? DrawActiveElementsOnTop { get; set; } + + /// + /// How to fill the area under the line. + /// + /// + /// Default value is . + /// + public bool Fill { get; set; } + + /// + /// The line fill color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public string? HoverBackgroundColor { get; set; } + + /// + /// Cap style of the line when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public string? HoverBorderCapStyle { get; set; } + + /// + /// The line color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public string? HoverBorderColor { get; set; } + + /// + /// Gets or sets the length and spacing of dashes when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? HoverBorderDash { get; set; } + + /// + /// Offset for line dashes when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public double? HoverBorderDashOffset { get; set; } + + /// + /// Line joint style. + /// There are three possible values for this property: 'round', 'bevel', and 'miter'. + /// + /// + /// Default value is 'miter'. + /// + public string HoverBorderJoinStyle { get; set; } = "miter"; + + /// + /// The bar border width when hovered (in pixels) when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public double? HoverBorderWidth { get; set; } + + /// + /// The base axis of the dataset. 'x' for horizontal lines and 'y' for vertical lines. + /// + /// + /// Default value is 'x'. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public string? IndexAxis { get; set; } + + /// + /// The fill color for points. + /// + /// + /// Default value is 'rgba(0, 0, 0, 0.1)'. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? PointBackgroundColor { get; set; } + + /// + /// The border color for points. + /// + /// + /// Default value is 'rgba(0, 0, 0, 0.1)'. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? PointBorderColor { get; set; } + + /// + /// The width of the point border in pixels. + /// + /// + /// Default value is 1. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? PointBorderWidth { get; set; } + + /// + /// The pixel size of the non-displayed point that reacts to mouse events. + /// + /// + /// Default value is 1. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? PointHitRadius { get; set; } + + /// + /// Point background color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? PointHoverBackgroundColor { get; set; } + + /// + /// Point border color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? PointHoverBorderColor { get; set; } + + /// + /// Border width of point when hovered. + /// + /// + /// Default value is 1. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? PointHoverBorderWidth { get; set; } + + /// + /// The radius of the point when hovered. + /// + /// + /// Default value is 4. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? PointHoverRadius { get; set; } + + /// + /// The radius of the point shape. If set to 0, the point is not rendered. + /// + /// + /// Default value is 3. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? PointRadius { get; set; } + + /// + /// The rotation of the point in degrees. + /// + /// + /// Default value is 0. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? PointRotation { get; set; } + + /// + /// Style of the point. + /// Supported values are 'circle', 'cross', 'crossRot', 'dash', 'line', 'rect', 'rectRounded', 'rectRot', 'star', and 'triangle' to style. + /// the point. + /// + /// + /// Default value is 'circle'. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public List? PointStyle { get; set; } + + //segment + //https://www.chartjs.org/docs/latest/charts/line.html#segment + + /// + /// If , the lines between points are not drawn. + /// By default, the scatter chart will override the showLine property of the line chart to false. + /// + /// + /// Default value is . + /// + public bool ShowLine { get; } = false; + + /// + /// If , lines will be drawn between points with no or null data. + /// If , points with null data will create a break in the line. + /// Can also be a number specifying the maximum gap length to span. + /// The unit of the value depends on the scale used. + /// + /// + /// Default value is . + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public bool? SpanGaps { get; set; } + + //stack + //https://www.chartjs.org/docs/latest/charts/line.html#general + + /// + /// true to show the line as a stepped line (tension will be ignored). + /// + /// + /// Default value is . + /// + public bool Stepped { get; set; } + + /// + /// Bezier curve tension of the line. Set to 0 to draw straight lines. + /// This option is ignored if monotone cubic interpolation is used. + /// + /// + /// Default value is 0. + /// + public double Tension { get; set; } + + /// + /// The ID of the x axis to plot this dataset on. + /// + /// + /// Default value is 'first x axis'. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public string? XAxisID { get; set; } + + /// + /// The ID of the y axis to plot this dataset on. + /// + /// + /// Default value is 'first y axis'. + /// + [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] + public string? YAxisID { get; set; } + + #endregion } public class ScatterChartDatasetDataLabels : ChartDatasetDataLabels From 2276dc6f3e1b63d3df1362ecb6224284661326f8 Mon Sep 17 00:00:00 2001 From: Vikram Reddy Date: Sat, 7 Sep 2024 12:05:00 +0530 Subject: [PATCH 2/4] ChartDataset - code cleanup --- .../Charts/ChartDataset/ChartDataset.cs | 126 +++++++++--------- 1 file changed, 63 insertions(+), 63 deletions(-) diff --git a/blazorbootstrap/Models/Charts/ChartDataset/ChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/ChartDataset.cs index f2e3e35af..04ea9114c 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/ChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/ChartDataset.cs @@ -3,82 +3,82 @@ public interface IChartDataset { } /// -/// +/// /// public class ChartDataset : IChartDataset { - #region Constructors + #region Constructors - public ChartDataset() - { - Oid = Guid.NewGuid(); - } + public ChartDataset() + { + Oid = Guid.NewGuid(); + } - #endregion + #endregion - #region Properties, Indexers + #region Properties, Indexers - /// - /// How to clip relative to chartArea. Positive value allows overflow, negative value clips that many pixels inside - /// chartArea. 0 = clip at chartArea. - /// Clipping can also be configured per side: clip: {left: 5, top: false, right: -2, bottom: 0} - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public string? Clip { get; set; } + /// + /// How to clip relative to chartArea. Positive value allows overflow, negative value clips that many pixels inside + /// chartArea. 0 = clip at chartArea. + /// Clipping can also be configured per side: clip: {left: 5, top: false, right: -2, bottom: 0} + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? Clip { get; set; } - /// - /// Get or sets the Data. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? Data { get; set; } + /// + /// Get or sets the Data. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? Data { get; set; } - /// - /// Configures the visibility state of the dataset. Set it to , to hide the dataset from the chart. - /// - /// - /// Default value is . - /// - public bool Hidden { get; set; } + /// + /// Configures the visibility state of the dataset. Set it to , to hide the dataset from the chart. + /// + /// + /// Default value is . + /// + public bool Hidden { get; set; } - /// - /// The label for the dataset which appears in the legend and tooltips. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public string? Label { get; set; } + /// + /// The label for the dataset which appears in the legend and tooltips. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? Label { get; set; } - /// - /// Get unique object id. - /// - public Guid Oid { get; private set; } + /// + /// Get unique object id. + /// + public Guid Oid { get; private set; } - /// - /// The drawing order of dataset. Also affects order for stacking, tooltip and legend. - /// - /// - /// Default value is 0. - /// - public int Order { get; set; } + /// + /// The drawing order of dataset. Also affects order for stacking, tooltip and legend. + /// + /// + /// Default value is 0. + /// + public int Order { get; set; } - //Stack - //https://www.chartjs.org/docs/latest/general/data-structures.html#dataset-configuration + //Stack + //https://www.chartjs.org/docs/latest/general/data-structures.html#dataset-configuration - /// - /// Gets or sets the chart type. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public string? Type { get; protected set; } + /// + /// Gets or sets the chart type. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? Type { get; protected set; } - #endregion + #endregion } From 80a45a987446b64efd44cd9df8ab79321df588d9 Mon Sep 17 00:00:00 2001 From: Vikram Reddy Date: Sat, 7 Sep 2024 12:09:23 +0530 Subject: [PATCH 3/4] ReSharper - Code Cleanup --- .../ChartDataset/BarChart/BarChartDataset.cs | 367 +++++----- .../Charts/ChartDataset/ChartDataset.cs | 2 +- .../DoughnutChart/DoughnutChartDataset.cs | 383 +++++----- .../LineChart/LineChartDataset.cs | 658 +++++++++-------- .../ChartDataset/PieChart/PieChartDataset.cs | 383 +++++----- .../PolarAreaChart/PolarAreaChartDataset.cs | 271 ++++--- .../RadarChart/RadarChartDataset.cs | 520 +++++++------- .../ScatterChart/ScatterChartDataset.cs | 662 +++++++++--------- 8 files changed, 1615 insertions(+), 1631 deletions(-) diff --git a/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDataset.cs index 43447b9f7..ce8b7c22c 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDataset.cs @@ -1,195 +1,194 @@ namespace BlazorBootstrap; /// -/// The bar chart allows a number of properties to be specified for each dataset. +/// The bar chart allows a number of properties to be specified for each dataset. /// These are used to set display properties for a specific dataset. /// /// /// public class BarChartDataset : ChartDataset { - #region Properties, Indexers - - /// - /// The bar background color. - /// - /// - /// Default value is 'rgba(0, 0, 0, 0.1)'. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? BackgroundColor { get; set; } - - /// - /// Percent (0-1) of the available width each bar should be within the category width. - /// 1.0 will take the whole category width and put the bars right next to each other. - /// - /// - /// Default value is 0.9. - /// - public double BarPercentage { get; set; } = 0.9; - - /// - /// It is applied to the width of each bar, in pixels. - /// When this is enforced, barPercentage and categoryPercentage are ignored. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public double? BarThickness { get; set; } - - /// - /// The bar border color. - /// - /// - /// Default value is 'rgba(0, 0, 0, 0.1)'. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? BorderColor { get; set; } - - /// - /// Border radius - /// - /// - /// Default value is 0. - /// - public List? BorderRadius { get; set; } - - /// - /// Gets or sets the border width (in pixels). - /// - /// - /// Default value is 0. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? BorderWidth { get; set; } - - //BorderSkipped - //https://www.chartjs.org/docs/latest/api/interfaces/BarControllerDatasetOptions.html#borderskipped - - /// - /// Percent (0-1) of the available width each category should be within the sample width. - /// - /// - /// Default value is 0.8. - /// - public double CategoryPercentage { get; set; } = 0.8; - - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public BarChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link - - /// - /// Should the bars be grouped on index axis. - /// When , all the datasets at same index value will be placed next to each other centering on that index value. - /// When , each bar is placed on its actual index-axis value. - /// - /// - /// Default value is . - /// - public bool Grouped { get; set; } = true; - - /// - /// The bar background color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? HoverBackgroundColor { get; set; } - - /// - /// The bar border color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? HoverBorderColor { get; set; } - - /// - /// The bar border radius when hovered (in pixels). - /// - /// - /// Default value is 0. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? HoverBorderRadius { get; set; } - - /// - /// The bar border width when hovered (in pixels). - /// - /// - /// Default value is 1. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? HoverBorderWidth { get; set; } - - /// - /// The base axis of the chart. 'x' for vertical charts and 'y' for horizontal charts. - /// Supported values are 'x' and 'y'. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public string? IndexAxis { get; set; } - - //InflateAmount - //https://www.chartjs.org/docs/latest/charts/bar.html#inflateamount - - /// - /// Set this to ensure that bars are not sized thicker than this. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public double? MaxBarThickness { get; set; } - - /// - /// Set this to ensure that bars have a minimum length in pixels. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public double? MinBarLength { get; set; } - - //PointStyle - //https://www.chartjs.org/docs/latest/configuration/elements.html#point-styles - - /// - /// If , null or undefined values will not be used for spacing calculations when determining bar size. - /// - /// - /// Default value is . - /// - public bool SkipNull { get; set; } - - //Stack - //https://www.chartjs.org/docs/latest/charts/bar.html#general - - /// - /// The ID of the x axis to plot this dataset on. - /// - /// - /// Default value is first x axis. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public string? XAxisID { get; set; } - - /// - /// The ID of the y axis to plot this dataset on. - /// - /// - /// Default value is first y axis. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public string? YAxisID { get; set; } - - #endregion + #region Properties, Indexers + + /// + /// The bar background color. + /// + /// + /// Default value is 'rgba(0, 0, 0, 0.1)'. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? BackgroundColor { get; set; } + + /// + /// Percent (0-1) of the available width each bar should be within the category width. + /// 1.0 will take the whole category width and put the bars right next to each other. + /// + /// + /// Default value is 0.9. + /// + public double BarPercentage { get; set; } = 0.9; + + /// + /// It is applied to the width of each bar, in pixels. + /// When this is enforced, barPercentage and categoryPercentage are ignored. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public double? BarThickness { get; set; } + + /// + /// The bar border color. + /// + /// + /// Default value is 'rgba(0, 0, 0, 0.1)'. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? BorderColor { get; set; } + + /// + /// Border radius + /// + /// + /// Default value is 0. + /// + public List? BorderRadius { get; set; } + + /// + /// Gets or sets the border width (in pixels). + /// + /// + /// Default value is 0. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? BorderWidth { get; set; } + + //BorderSkipped + //https://www.chartjs.org/docs/latest/api/interfaces/BarControllerDatasetOptions.html#borderskipped + + /// + /// Percent (0-1) of the available width each category should be within the sample width. + /// + /// + /// Default value is 0.8. + /// + public double CategoryPercentage { get; set; } = 0.8; + + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public BarChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link + + /// + /// Should the bars be grouped on index axis. + /// When , all the datasets at same index value will be placed next to each other centering on that + /// index value. + /// When , each bar is placed on its actual index-axis value. + /// + /// + /// Default value is . + /// + public bool Grouped { get; set; } = true; + + /// + /// The bar background color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? HoverBackgroundColor { get; set; } + + /// + /// The bar border color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? HoverBorderColor { get; set; } + + /// + /// The bar border radius when hovered (in pixels). + /// + /// + /// Default value is 0. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? HoverBorderRadius { get; set; } + + /// + /// The bar border width when hovered (in pixels). + /// + /// + /// Default value is 1. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? HoverBorderWidth { get; set; } + + /// + /// The base axis of the chart. 'x' for vertical charts and 'y' for horizontal charts. + /// Supported values are 'x' and 'y'. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? IndexAxis { get; set; } + + //InflateAmount + //https://www.chartjs.org/docs/latest/charts/bar.html#inflateamount + + /// + /// Set this to ensure that bars are not sized thicker than this. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public double? MaxBarThickness { get; set; } + + /// + /// Set this to ensure that bars have a minimum length in pixels. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public double? MinBarLength { get; set; } + + //PointStyle + //https://www.chartjs.org/docs/latest/configuration/elements.html#point-styles + + /// + /// If , null or undefined values will not be used for spacing calculations when determining bar + /// size. + /// + /// + /// Default value is . + /// + public bool SkipNull { get; set; } + + //Stack + //https://www.chartjs.org/docs/latest/charts/bar.html#general + + /// + /// The ID of the x axis to plot this dataset on. + /// + /// + /// Default value is first x axis. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? XAxisID { get; set; } + + /// + /// The ID of the y axis to plot this dataset on. + /// + /// + /// Default value is first y axis. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? YAxisID { get; set; } + + #endregion } -public class BarChartDatasetDataLabels : ChartDatasetDataLabels -{ -} +public class BarChartDatasetDataLabels : ChartDatasetDataLabels { } diff --git a/blazorbootstrap/Models/Charts/ChartDataset/ChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/ChartDataset.cs index 04ea9114c..fb768abeb 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/ChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/ChartDataset.cs @@ -3,7 +3,7 @@ public interface IChartDataset { } /// -/// +/// /// public class ChartDataset : IChartDataset { diff --git a/blazorbootstrap/Models/Charts/ChartDataset/DoughnutChart/DoughnutChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/DoughnutChart/DoughnutChartDataset.cs index 91cb6e69a..b47c7594e 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/DoughnutChart/DoughnutChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/DoughnutChart/DoughnutChartDataset.cs @@ -1,203 +1,200 @@ namespace BlazorBootstrap; /// -/// The doughnut/pie chart allows a number of properties to be specified for each dataset. +/// The doughnut/pie chart allows a number of properties to be specified for each dataset. /// These are used to set display properties for a specific dataset. /// . /// public class DoughnutChartDataset : ChartDataset { - #region Properties, Indexers - - /// - /// Arc background color. - /// - /// - /// Default value is 'rgba(0, 0, 0, 0.1)'. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? BackgroundColor { get; set; } - - /// - /// Supported values are 'center' and 'inner'. - /// When 'center' is set, the borders of arcs next to each other will overlap. - /// When 'inner' is set, it is guaranteed that all borders will not overlap. - /// - /// - /// Default value is 'center'. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? BorderAlign { get; set; } // TODO: change this to enum - - /// - /// Arc border color. - /// - /// - /// Default value is '#fff'. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? BorderColor { get; set; } - - /// - /// Arc border length and spacing of dashes. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? BorderDash { get; set; } - - /// - /// Arc border offset for line dashes. - /// - /// - /// Default value is 0.0. - /// - public double BorderDashOffset { get; set; } - - /// - /// Arc border join style. - /// Supported values are 'round', 'bevel', 'miter'. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? BorderJoinStyle { get; set; } // TODO: change this to enum - - /// - /// It is applied to all corners of the arc (outerStart, outerEnd, innerStart, innerRight). - /// - /// - /// Default value is 0. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? BorderRadius { get; set; } - - /// - /// Arc border width (in pixels). - /// - /// - /// Default value is 2. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? BorderWidth { get; set; } - - /// - /// Per-dataset override for the sweep that the arcs cover. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public double? Circumference { get; set; } - - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public DoughnutChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link - - /// - /// Arc background color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? HoverBackgroundColor { get; set; } - - /// - /// Arc border color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? HoverBorderColor { get; set; } - - /// - /// Arc border length and spacing of dashes when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? HoverBorderDash { get; set; } - - /// - /// Arc border offset for line dashes when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public double? HoverBorderDashOffset { get; set; } - - /// - /// Arc border join style when hovered. - /// Supported values are 'round', 'bevel', 'miter'. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? HoverBorderJoinStyle { get; set; } // TODO: change this to enum - - /// - /// Arc border width when hovered (in pixels). - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? HoverBorderWidth { get; set; } - - /// - /// Arc offset when hovered (in pixels). - /// - /// - /// Default value is 0. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? HoverOffset { get; set; } - - /// - /// Arc offset (in pixels). - /// - /// - /// Default value is 0. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? Offset { get; set; } - - /// - /// Per-dataset override for the starting angle to draw arcs from. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public double? Rotation { get; set; } - - /// - /// Fixed arc offset (in pixels). Similar to but applies to all arcs. - /// - /// - /// Default value is 0. - /// - public double Spacing { get; set; } - - /// - /// The relative thickness of the dataset. - /// Providing a value for weight will cause the pie or doughnut dataset to be drawn - /// with a thickness relative to the sum of all the dataset weight values. - /// - /// - /// Default value is 1. - /// - public double Weight { get; set; } = 1; - - #endregion + #region Properties, Indexers + + /// + /// Arc background color. + /// + /// + /// Default value is 'rgba(0, 0, 0, 0.1)'. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? BackgroundColor { get; set; } + + /// + /// Supported values are 'center' and 'inner'. + /// When 'center' is set, the borders of arcs next to each other will overlap. + /// When 'inner' is set, it is guaranteed that all borders will not overlap. + /// + /// + /// Default value is 'center'. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? BorderAlign { get; set; } // TODO: change this to enum + + /// + /// Arc border color. + /// + /// + /// Default value is '#fff'. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? BorderColor { get; set; } + + /// + /// Arc border length and spacing of dashes. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? BorderDash { get; set; } + + /// + /// Arc border offset for line dashes. + /// + /// + /// Default value is 0.0. + /// + public double BorderDashOffset { get; set; } + + /// + /// Arc border join style. + /// Supported values are 'round', 'bevel', 'miter'. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? BorderJoinStyle { get; set; } // TODO: change this to enum + + /// + /// It is applied to all corners of the arc (outerStart, outerEnd, innerStart, innerRight). + /// + /// + /// Default value is 0. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? BorderRadius { get; set; } + + /// + /// Arc border width (in pixels). + /// + /// + /// Default value is 2. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? BorderWidth { get; set; } + + /// + /// Per-dataset override for the sweep that the arcs cover. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public double? Circumference { get; set; } + + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public DoughnutChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link + + /// + /// Arc background color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? HoverBackgroundColor { get; set; } + + /// + /// Arc border color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? HoverBorderColor { get; set; } + + /// + /// Arc border length and spacing of dashes when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? HoverBorderDash { get; set; } + + /// + /// Arc border offset for line dashes when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public double? HoverBorderDashOffset { get; set; } + + /// + /// Arc border join style when hovered. + /// Supported values are 'round', 'bevel', 'miter'. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? HoverBorderJoinStyle { get; set; } // TODO: change this to enum + + /// + /// Arc border width when hovered (in pixels). + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? HoverBorderWidth { get; set; } + + /// + /// Arc offset when hovered (in pixels). + /// + /// + /// Default value is 0. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? HoverOffset { get; set; } + + /// + /// Arc offset (in pixels). + /// + /// + /// Default value is 0. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? Offset { get; set; } + + /// + /// Per-dataset override for the starting angle to draw arcs from. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public double? Rotation { get; set; } + + /// + /// Fixed arc offset (in pixels). Similar to but applies to all arcs. + /// + /// + /// Default value is 0. + /// + public double Spacing { get; set; } + + /// + /// The relative thickness of the dataset. + /// Providing a value for weight will cause the pie or doughnut dataset to be drawn + /// with a thickness relative to the sum of all the dataset weight values. + /// + /// + /// Default value is 1. + /// + public double Weight { get; set; } = 1; + + #endregion } -public class DoughnutChartDatasetDataLabels : ChartDatasetDataLabels -{ -} +public class DoughnutChartDatasetDataLabels : ChartDatasetDataLabels { } diff --git a/blazorbootstrap/Models/Charts/ChartDataset/LineChart/LineChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/LineChart/LineChartDataset.cs index 9ee118ab1..466174bb6 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/LineChart/LineChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/LineChart/LineChartDataset.cs @@ -1,339 +1,337 @@ namespace BlazorBootstrap; /// -/// The line chart allows a number of properties to be specified for each dataset. -/// These are used to set display properties for a specific dataset. +/// The line chart allows a number of properties to be specified for each dataset. +/// These are used to set display properties for a specific dataset. /// . /// public class LineChartDataset : ChartDataset { - #region Properties, Indexers - - /// - /// Get or sets the line fill color. - /// - /// - /// Default value is 'rgba(0, 0, 0, 0.1)'. - /// - public string BackgroundColor { get; set; } = "rgba(0, 0, 0, 0.1)"; - - /// - /// Cap style of the line. - /// Supported values are 'butt', 'round', and 'square'. - /// - /// - /// Default value is 'butt'. - /// - public string BorderCapStyle { get; set; } = "butt"; - - /// - /// Get or sets the line color. - /// - /// - /// Default value is 'rgba(0, 0, 0, 0.1)'. - /// - public string BorderColor { get; set; } = "rgba(0, 0, 0, 0.1)"; - - /// - /// Gets or sets the length and spacing of dashes. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? BorderDash { get; set; } - - /// - /// Offset for line dashes. - /// - /// - /// Default value is 0.0. - /// - public double BorderDashOffset { get; set; } - - /// - /// Line joint style. - /// There are three possible values for this property: 'round', 'bevel', and 'miter'. - /// - /// - /// Default value is 'miter'. - /// - public string BorderJoinStyle { get; set; } = "miter"; - - /// - /// Gets or sets the line width (in pixels). - /// - /// - /// Default value is 3. - /// - public double BorderWidth { get; set; } = 3; - - /// - /// . - /// Supported values are 'default', and 'monotone'. - /// - /// - /// Default value is 'default'. - /// - public string CubicInterpolationMode { get; set; } = "default"; - - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public LineChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link - - /// - /// Draw the active points of a dataset over the other points of the dataset. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? DrawActiveElementsOnTop { get; set; } - - /// - /// How to fill the area under the line. - /// - /// - /// Default value is . - /// - public bool Fill { get; set; } - - /// - /// The line fill color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public string? HoverBackgroundColor { get; set; } - - /// - /// Cap style of the line when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public string? HoverBorderCapStyle { get; set; } - - /// - /// The line color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public string? HoverBorderColor { get; set; } - - /// - /// Gets or sets the length and spacing of dashes when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? HoverBorderDash { get; set; } - - /// - /// Offset for line dashes when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public double? HoverBorderDashOffset { get; set; } - - /// - /// Line joint style. - /// There are three possible values for this property: 'round', 'bevel', and 'miter'. - /// - /// - /// Default value is 'miter'. - /// - public string HoverBorderJoinStyle { get; set; } = "miter"; - - /// - /// The bar border width when hovered (in pixels) when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public double? HoverBorderWidth { get; set; } - - /// - /// The base axis of the dataset. 'x' for horizontal lines and 'y' for vertical lines. - /// - /// - /// Default value is 'x'. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public string? IndexAxis { get; set; } - - /// - /// The fill color for points. - /// - /// - /// Default value is 'rgba(0, 0, 0, 0.1)'. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? PointBackgroundColor { get; set; } - - /// - /// The border color for points. - /// - /// - /// Default value is 'rgba(0, 0, 0, 0.1)'. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? PointBorderColor { get; set; } - - /// - /// The width of the point border in pixels. - /// - /// - /// Default value is 1. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? PointBorderWidth { get; set; } - - /// - /// The pixel size of the non-displayed point that reacts to mouse events. - /// - /// - /// Default value is 1. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? PointHitRadius { get; set; } - - /// - /// Point background color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? PointHoverBackgroundColor { get; set; } - - /// - /// Point border color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? PointHoverBorderColor { get; set; } - - /// - /// Border width of point when hovered. - /// - /// - /// Default value is 1. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? PointHoverBorderWidth { get; set; } - - /// - /// The radius of the point when hovered. - /// - /// - /// Default value is 4. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? PointHoverRadius { get; set; } - - /// - /// The radius of the point shape. If set to 0, the point is not rendered. - /// - /// - /// Default value is 3. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? PointRadius { get; set; } - - /// - /// The rotation of the point in degrees. - /// - /// - /// Default value is 0. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? PointRotation { get; set; } - - /// - /// Style of the point. - /// Supported values are 'circle', 'cross', 'crossRot', 'dash', 'line', 'rect', 'rectRounded', 'rectRot', 'star', and 'triangle' to style. - /// the point. - /// - /// - /// Default value is 'circle'. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? PointStyle { get; set; } - - //segment - //https://www.chartjs.org/docs/latest/charts/line.html#segment - - /// - /// If , the lines between points are not drawn. - /// - /// - /// Default value is . - /// - public bool ShowLine { get; set; } = true; - - /// - /// If , lines will be drawn between points with no or null data. - /// If , points with null data will create a break in the line. - /// Can also be a number specifying the maximum gap length to span. - /// The unit of the value depends on the scale used. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public bool? SpanGaps { get; set; } - - //stack - //https://www.chartjs.org/docs/latest/charts/line.html#general - - /// - /// true to show the line as a stepped line (tension will be ignored). - /// - /// - /// Default value is . - /// - public bool Stepped { get; set; } - - /// - /// Bezier curve tension of the line. Set to 0 to draw straight lines. - /// This option is ignored if monotone cubic interpolation is used. - /// - /// - /// Default value is 0. - /// - public double Tension { get; set; } - - /// - /// The ID of the x axis to plot this dataset on. - /// - /// - /// Default value is 'first x axis'. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public string? XAxisID { get; set; } - - /// - /// The ID of the y axis to plot this dataset on. - /// - /// - /// Default value is 'first y axis'. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public string? YAxisID { get; set; } - - #endregion + #region Properties, Indexers + + /// + /// Get or sets the line fill color. + /// + /// + /// Default value is 'rgba(0, 0, 0, 0.1)'. + /// + public string BackgroundColor { get; set; } = "rgba(0, 0, 0, 0.1)"; + + /// + /// Cap style of the line. + /// Supported values are 'butt', 'round', and 'square'. + /// + /// + /// Default value is 'butt'. + /// + public string BorderCapStyle { get; set; } = "butt"; + + /// + /// Get or sets the line color. + /// + /// + /// Default value is 'rgba(0, 0, 0, 0.1)'. + /// + public string BorderColor { get; set; } = "rgba(0, 0, 0, 0.1)"; + + /// + /// Gets or sets the length and spacing of dashes. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? BorderDash { get; set; } + + /// + /// Offset for line dashes. + /// + /// + /// Default value is 0.0. + /// + public double BorderDashOffset { get; set; } + + /// + /// Line joint style. + /// There are three possible values for this property: 'round', 'bevel', and 'miter'. + /// + /// + /// Default value is 'miter'. + /// + public string BorderJoinStyle { get; set; } = "miter"; + + /// + /// Gets or sets the line width (in pixels). + /// + /// + /// Default value is 3. + /// + public double BorderWidth { get; set; } = 3; + + /// + /// . + /// Supported values are 'default', and 'monotone'. + /// + /// + /// Default value is 'default'. + /// + public string CubicInterpolationMode { get; set; } = "default"; + + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public LineChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link + + /// + /// Draw the active points of a dataset over the other points of the dataset. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? DrawActiveElementsOnTop { get; set; } + + /// + /// How to fill the area under the line. + /// + /// + /// Default value is . + /// + public bool Fill { get; set; } + + /// + /// The line fill color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? HoverBackgroundColor { get; set; } + + /// + /// Cap style of the line when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? HoverBorderCapStyle { get; set; } + + /// + /// The line color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? HoverBorderColor { get; set; } + + /// + /// Gets or sets the length and spacing of dashes when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? HoverBorderDash { get; set; } + + /// + /// Offset for line dashes when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public double? HoverBorderDashOffset { get; set; } + + /// + /// Line joint style. + /// There are three possible values for this property: 'round', 'bevel', and 'miter'. + /// + /// + /// Default value is 'miter'. + /// + public string HoverBorderJoinStyle { get; set; } = "miter"; + + /// + /// The bar border width when hovered (in pixels) when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public double? HoverBorderWidth { get; set; } + + /// + /// The base axis of the dataset. 'x' for horizontal lines and 'y' for vertical lines. + /// + /// + /// Default value is 'x'. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? IndexAxis { get; set; } + + /// + /// The fill color for points. + /// + /// + /// Default value is 'rgba(0, 0, 0, 0.1)'. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? PointBackgroundColor { get; set; } + + /// + /// The border color for points. + /// + /// + /// Default value is 'rgba(0, 0, 0, 0.1)'. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? PointBorderColor { get; set; } + + /// + /// The width of the point border in pixels. + /// + /// + /// Default value is 1. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? PointBorderWidth { get; set; } + + /// + /// The pixel size of the non-displayed point that reacts to mouse events. + /// + /// + /// Default value is 1. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? PointHitRadius { get; set; } + + /// + /// Point background color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? PointHoverBackgroundColor { get; set; } + + /// + /// Point border color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? PointHoverBorderColor { get; set; } + + /// + /// Border width of point when hovered. + /// + /// + /// Default value is 1. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? PointHoverBorderWidth { get; set; } + + /// + /// The radius of the point when hovered. + /// + /// + /// Default value is 4. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? PointHoverRadius { get; set; } + + /// + /// The radius of the point shape. If set to 0, the point is not rendered. + /// + /// + /// Default value is 3. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? PointRadius { get; set; } + + /// + /// The rotation of the point in degrees. + /// + /// + /// Default value is 0. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? PointRotation { get; set; } + + /// + /// Style of the point. + /// Supported values are 'circle', 'cross', 'crossRot', 'dash', 'line', 'rect', 'rectRounded', 'rectRot', 'star', and + /// 'triangle' to style. + /// the point. + /// + /// + /// Default value is 'circle'. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? PointStyle { get; set; } + + //segment + //https://www.chartjs.org/docs/latest/charts/line.html#segment + + /// + /// If , the lines between points are not drawn. + /// + /// + /// Default value is . + /// + public bool ShowLine { get; set; } = true; + + /// + /// If , lines will be drawn between points with no or null data. + /// If , points with null data will create a break in the line. + /// Can also be a number specifying the maximum gap length to span. + /// The unit of the value depends on the scale used. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public bool? SpanGaps { get; set; } + + //stack + //https://www.chartjs.org/docs/latest/charts/line.html#general + + /// + /// true to show the line as a stepped line (tension will be ignored). + /// + /// + /// Default value is . + /// + public bool Stepped { get; set; } + + /// + /// Bezier curve tension of the line. Set to 0 to draw straight lines. + /// This option is ignored if monotone cubic interpolation is used. + /// + /// + /// Default value is 0. + /// + public double Tension { get; set; } + + /// + /// The ID of the x axis to plot this dataset on. + /// + /// + /// Default value is 'first x axis'. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? XAxisID { get; set; } + + /// + /// The ID of the y axis to plot this dataset on. + /// + /// + /// Default value is 'first y axis'. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? YAxisID { get; set; } + + #endregion } -public class LineChartDatasetDataLabels : ChartDatasetDataLabels -{ -} +public class LineChartDatasetDataLabels : ChartDatasetDataLabels { } diff --git a/blazorbootstrap/Models/Charts/ChartDataset/PieChart/PieChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/PieChart/PieChartDataset.cs index 030a5a664..784886f37 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/PieChart/PieChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/PieChart/PieChartDataset.cs @@ -1,203 +1,200 @@ namespace BlazorBootstrap; /// -/// The doughnut/pie chart allows a number of properties to be specified for each dataset. +/// The doughnut/pie chart allows a number of properties to be specified for each dataset. /// These are used to set display properties for a specific dataset. /// . /// public class PieChartDataset : ChartDataset { - #region Properties, Indexers - - /// - /// Arc background color. - /// - /// - /// Default value is 'rgba(0, 0, 0, 0.1)'. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? BackgroundColor { get; set; } - - /// - /// Supported values are 'center' and 'inner'. - /// When 'center' is set, the borders of arcs next to each other will overlap. - /// When 'inner' is set, it is guaranteed that all borders will not overlap. - /// - /// - /// Default value is 'center'. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? BorderAlign { get; set; } // TODO: change this to enum - - /// - /// Arc border color. - /// - /// - /// Default value is '#fff'. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? BorderColor { get; set; } - - /// - /// Arc border length and spacing of dashes. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? BorderDash { get; set; } - - /// - /// Arc border offset for line dashes. - /// - /// - /// Default value is 0.0. - /// - public double BorderDashOffset { get; set; } - - /// - /// Arc border join style. - /// Supported values are 'round', 'bevel', 'miter'. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? BorderJoinStyle { get; set; } // TODO: change this to enum - - /// - /// It is applied to all corners of the arc (outerStart, outerEnd, innerStart, innerRight). - /// - /// - /// Default value is 0. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? BorderRadius { get; set; } - - /// - /// Arc border width (in pixels). - /// - /// - /// Default value is 2. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? BorderWidth { get; set; } - - /// - /// Per-dataset override for the sweep that the arcs cover. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public double? Circumference { get; set; } - - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public PieChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link - - /// - /// Arc background color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? HoverBackgroundColor { get; set; } - - /// - /// Arc border color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? HoverBorderColor { get; set; } - - /// - /// Arc border length and spacing of dashes when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? HoverBorderDash { get; set; } - - /// - /// Arc border offset for line dashes when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public double? HoverBorderDashOffset { get; set; } - - /// - /// Arc border join style when hovered. - /// Supported values are 'round', 'bevel', 'miter'. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? HoverBorderJoinStyle { get; set; } // TODO: change this to enum - - /// - /// Arc border width when hovered (in pixels). - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? HoverBorderWidth { get; set; } - - /// - /// Arc offset when hovered (in pixels). - /// - /// - /// Default value is 0. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? HoverOffset { get; set; } - - /// - /// Arc offset (in pixels). - /// - /// - /// Default value is 0. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? Offset { get; set; } - - /// - /// Per-dataset override for the starting angle to draw arcs from. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public double? Rotation { get; set; } - - /// - /// Fixed arc offset (in pixels). Similar to but applies to all arcs. - /// - /// - /// Default value is 0. - /// - public double Spacing { get; set; } - - /// - /// The relative thickness of the dataset. - /// Providing a value for weight will cause the pie or doughnut dataset to be drawn - /// with a thickness relative to the sum of all the dataset weight values. - /// - /// - /// Default value is 1. - /// - public double Weight { get; set; } = 1; - - #endregion + #region Properties, Indexers + + /// + /// Arc background color. + /// + /// + /// Default value is 'rgba(0, 0, 0, 0.1)'. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? BackgroundColor { get; set; } + + /// + /// Supported values are 'center' and 'inner'. + /// When 'center' is set, the borders of arcs next to each other will overlap. + /// When 'inner' is set, it is guaranteed that all borders will not overlap. + /// + /// + /// Default value is 'center'. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? BorderAlign { get; set; } // TODO: change this to enum + + /// + /// Arc border color. + /// + /// + /// Default value is '#fff'. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? BorderColor { get; set; } + + /// + /// Arc border length and spacing of dashes. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? BorderDash { get; set; } + + /// + /// Arc border offset for line dashes. + /// + /// + /// Default value is 0.0. + /// + public double BorderDashOffset { get; set; } + + /// + /// Arc border join style. + /// Supported values are 'round', 'bevel', 'miter'. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? BorderJoinStyle { get; set; } // TODO: change this to enum + + /// + /// It is applied to all corners of the arc (outerStart, outerEnd, innerStart, innerRight). + /// + /// + /// Default value is 0. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? BorderRadius { get; set; } + + /// + /// Arc border width (in pixels). + /// + /// + /// Default value is 2. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? BorderWidth { get; set; } + + /// + /// Per-dataset override for the sweep that the arcs cover. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public double? Circumference { get; set; } + + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public PieChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link + + /// + /// Arc background color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? HoverBackgroundColor { get; set; } + + /// + /// Arc border color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? HoverBorderColor { get; set; } + + /// + /// Arc border length and spacing of dashes when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? HoverBorderDash { get; set; } + + /// + /// Arc border offset for line dashes when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public double? HoverBorderDashOffset { get; set; } + + /// + /// Arc border join style when hovered. + /// Supported values are 'round', 'bevel', 'miter'. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? HoverBorderJoinStyle { get; set; } // TODO: change this to enum + + /// + /// Arc border width when hovered (in pixels). + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? HoverBorderWidth { get; set; } + + /// + /// Arc offset when hovered (in pixels). + /// + /// + /// Default value is 0. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? HoverOffset { get; set; } + + /// + /// Arc offset (in pixels). + /// + /// + /// Default value is 0. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? Offset { get; set; } + + /// + /// Per-dataset override for the starting angle to draw arcs from. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public double? Rotation { get; set; } + + /// + /// Fixed arc offset (in pixels). Similar to but applies to all arcs. + /// + /// + /// Default value is 0. + /// + public double Spacing { get; set; } + + /// + /// The relative thickness of the dataset. + /// Providing a value for weight will cause the pie or doughnut dataset to be drawn + /// with a thickness relative to the sum of all the dataset weight values. + /// + /// + /// Default value is 1. + /// + public double Weight { get; set; } = 1; + + #endregion } -public class PieChartDatasetDataLabels : ChartDatasetDataLabels -{ -} +public class PieChartDatasetDataLabels : ChartDatasetDataLabels { } diff --git a/blazorbootstrap/Models/Charts/ChartDataset/PolarAreaChart/PolarAreaChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/PolarAreaChart/PolarAreaChartDataset.cs index c2f8b7cd9..b4f283e80 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/PolarAreaChart/PolarAreaChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/PolarAreaChart/PolarAreaChartDataset.cs @@ -2,142 +2,139 @@ public class PolarAreaChartDataset : ChartDataset { - #region Properties, Indexers - - /// - /// Arc background color. - /// - /// - /// Default value is 'rgba(0, 0, 0, 0.1)'. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? BackgroundColor { get; set; } - - /// - /// Supported values are 'center' and 'inner'. - /// When 'center' is set, the borders of arcs next to each other will overlap. - /// When 'inner' is set, it is guaranteed that all borders will not overlap. - /// - /// - /// Default value is 'center'. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? BorderAlign { get; set; } // TODO: change this to enum - - /// - /// Arc border color. - /// - /// - /// Default value is '#fff'. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? BorderColor { get; set; } - - /// - /// Arc border length and spacing of dashes. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? BorderDash { get; set; } - - /// - /// Arc border offset for line dashes. - /// - /// - /// Default value is 0.0. - /// - public double BorderDashOffset { get; set; } - - /// - /// Arc border join style. - /// Supported values are 'round', 'bevel', 'miter'. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? BorderJoinStyle { get; set; } // TODO: change this to enum - - /// - /// Arc border width (in pixels). - /// - /// - /// Default value is 2. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? BorderWidth { get; set; } - - /// - /// By default the Arc is curved. If , the Arc will be flat. - /// - /// - /// Default value is . - /// - public bool Circular { get; set; } = true; - - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public PieChartDatasetDataLabels Datalabels { get; set; } = new(); - - /// - /// Arc background color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? HoverBackgroundColor { get; set; } - - /// - /// Arc border color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? HoverBorderColor { get; set; } - - /// - /// Arc border length and spacing of dashes when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? HoverBorderDash { get; set; } - - /// - /// Arc border offset for line dashes when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public double? HoverBorderDashOffset { get; set; } - - /// - /// Arc border join style when hovered. - /// Supported values are 'round', 'bevel', 'miter'. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? HoverBorderJoinStyle { get; set; } // TODO: change this to enum - - /// - /// Arc border width when hovered (in pixels). - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? HoverBorderWidth { get; set; } - - #endregion + #region Properties, Indexers + + /// + /// Arc background color. + /// + /// + /// Default value is 'rgba(0, 0, 0, 0.1)'. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? BackgroundColor { get; set; } + + /// + /// Supported values are 'center' and 'inner'. + /// When 'center' is set, the borders of arcs next to each other will overlap. + /// When 'inner' is set, it is guaranteed that all borders will not overlap. + /// + /// + /// Default value is 'center'. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? BorderAlign { get; set; } // TODO: change this to enum + + /// + /// Arc border color. + /// + /// + /// Default value is '#fff'. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? BorderColor { get; set; } + + /// + /// Arc border length and spacing of dashes. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? BorderDash { get; set; } + + /// + /// Arc border offset for line dashes. + /// + /// + /// Default value is 0.0. + /// + public double BorderDashOffset { get; set; } + + /// + /// Arc border join style. + /// Supported values are 'round', 'bevel', 'miter'. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? BorderJoinStyle { get; set; } // TODO: change this to enum + + /// + /// Arc border width (in pixels). + /// + /// + /// Default value is 2. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? BorderWidth { get; set; } + + /// + /// By default the Arc is curved. If , the Arc will be flat. + /// + /// + /// Default value is . + /// + public bool Circular { get; set; } = true; + + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public PieChartDatasetDataLabels Datalabels { get; set; } = new(); + + /// + /// Arc background color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? HoverBackgroundColor { get; set; } + + /// + /// Arc border color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? HoverBorderColor { get; set; } + + /// + /// Arc border length and spacing of dashes when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? HoverBorderDash { get; set; } + + /// + /// Arc border offset for line dashes when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public double? HoverBorderDashOffset { get; set; } + + /// + /// Arc border join style when hovered. + /// Supported values are 'round', 'bevel', 'miter'. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? HoverBorderJoinStyle { get; set; } // TODO: change this to enum + + /// + /// Arc border width when hovered (in pixels). + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? HoverBorderWidth { get; set; } + + #endregion } -public class PolarAreaChartDatasetDataLabels : ChartDatasetDataLabels -{ -} +public class PolarAreaChartDatasetDataLabels : ChartDatasetDataLabels { } diff --git a/blazorbootstrap/Models/Charts/ChartDataset/RadarChart/RadarChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/RadarChart/RadarChartDataset.cs index 6f2bf590b..981ccc1be 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/RadarChart/RadarChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/RadarChart/RadarChartDataset.cs @@ -7,266 +7,264 @@ /// public class RadarChartDataset : ChartDataset { - #region Properties, Indexers - - /// - /// Get or sets the line fill color. - /// - /// - /// Default value is 'rgba(0, 0, 0, 0.1)'. - /// - public string BackgroundColor { get; set; } = "rgba(0, 0, 0, 0.1)"; - - /// - /// Cap style of the line. - /// Supported values are 'butt', 'round', and 'square'. - /// - /// - /// Default value is 'butt'. - /// - public string BorderCapStyle { get; set; } = "butt"; - - /// - /// Get or sets the line color. - /// - /// - /// Default value is 'rgba(0, 0, 0, 0.1)'. - /// - public string BorderColor { get; set; } = "rgba(0, 0, 0, 0.1)"; - - /// - /// Gets or sets the length and spacing of dashes. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? BorderDash { get; set; } - - /// - /// Offset for line dashes. - /// - /// - /// Default value is 0.0. - /// - public double BorderDashOffset { get; set; } - - /// - /// Line joint style. - /// There are three possible values for this property: 'round', 'bevel', and 'miter'. - /// - /// - /// Default value is 'miter'. - /// - public string BorderJoinStyle { get; set; } = "miter"; - - /// - /// Gets or sets the line width (in pixels). - /// - /// - /// Default value is 3. - /// - public double BorderWidth { get; set; } = 3; - - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public RadarChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: Add reference link - - /// - /// How to fill the area under the line. - /// - /// - /// Default value is . - /// - public bool Fill { get; set; } - - /// - /// The line fill color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public string? HoverBackgroundColor { get; set; } - - /// - /// Cap style of the line when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public string? HoverBorderCapStyle { get; set; } - - /// - /// The line color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public string? HoverBorderColor { get; set; } - - /// - /// Gets or sets the length and spacing of dashes when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? HoverBorderDash { get; set; } - - /// - /// Offset for line dashes when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public double? HoverBorderDashOffset { get; set; } - - /// - /// Line joint style. - /// There are three possible values for this property: 'round', 'bevel', and 'miter'. - /// - /// - /// Default value is 'miter'. - /// - public string HoverBorderJoinStyle { get; set; } = "miter"; - - /// - /// The bar border width when hovered (in pixels) when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public double? HoverBorderWidth { get; set; } - - /// - /// The fill color for points. - /// - /// - /// Default value is 'rgba(0, 0, 0, 0.1)'. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? PointBackgroundColor { get; set; } - - /// - /// The border color for points. - /// - /// - /// Default value is 'rgba(0, 0, 0, 0.1)'. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? PointBorderColor { get; set; } - - /// - /// The width of the point border in pixels. - /// - /// - /// Default value is 1. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? PointBorderWidth { get; set; } - - /// - /// The pixel size of the non-displayed point that reacts to mouse events. - /// - /// - /// Default value is 1. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? PointHitRadius { get; set; } - - /// - /// Point background color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? PointHoverBackgroundColor { get; set; } - - /// - /// Point border color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? PointHoverBorderColor { get; set; } - - /// - /// Border width of point when hovered. - /// - /// - /// Default value is 1. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? PointHoverBorderWidth { get; set; } - - /// - /// The radius of the point when hovered. - /// - /// - /// Default value is 4. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? PointHoverRadius { get; set; } - - /// - /// The radius of the point shape. If set to 0, the point is not rendered. - /// - /// - /// Default value is 3. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? PointRadius { get; set; } - - /// - /// The rotation of the point in degrees. - /// - /// - /// Default value is 0. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? PointRotation { get; set; } - - /// - /// Style of the point. - /// Supported values are 'circle', 'cross', 'crossRot', 'dash', 'line', 'rect', 'rectRounded', 'rectRot', 'star', and 'triangle' to style. - /// the point. - /// - /// - /// Default value is 'circle'. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? PointStyle { get; set; } - - /// - /// If , lines will be drawn between points with no or null data. - /// If , points with null data will create a break in the line. - /// Can also be a number specifying the maximum gap length to span. - /// The unit of the value depends on the scale used. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public bool? SpanGaps { get; set; } - - /// - /// Bezier curve tension of the line. Set to 0 to draw straight lines. - /// This option is ignored if monotone cubic interpolation is used. - /// - /// - /// Default value is 0. - /// - public double Tension { get; set; } - - #endregion + #region Properties, Indexers + + /// + /// Get or sets the line fill color. + /// + /// + /// Default value is 'rgba(0, 0, 0, 0.1)'. + /// + public string BackgroundColor { get; set; } = "rgba(0, 0, 0, 0.1)"; + + /// + /// Cap style of the line. + /// Supported values are 'butt', 'round', and 'square'. + /// + /// + /// Default value is 'butt'. + /// + public string BorderCapStyle { get; set; } = "butt"; + + /// + /// Get or sets the line color. + /// + /// + /// Default value is 'rgba(0, 0, 0, 0.1)'. + /// + public string BorderColor { get; set; } = "rgba(0, 0, 0, 0.1)"; + + /// + /// Gets or sets the length and spacing of dashes. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? BorderDash { get; set; } + + /// + /// Offset for line dashes. + /// + /// + /// Default value is 0.0. + /// + public double BorderDashOffset { get; set; } + + /// + /// Line joint style. + /// There are three possible values for this property: 'round', 'bevel', and 'miter'. + /// + /// + /// Default value is 'miter'. + /// + public string BorderJoinStyle { get; set; } = "miter"; + + /// + /// Gets or sets the line width (in pixels). + /// + /// + /// Default value is 3. + /// + public double BorderWidth { get; set; } = 3; + + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public RadarChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: Add reference link + + /// + /// How to fill the area under the line. + /// + /// + /// Default value is . + /// + public bool Fill { get; set; } + + /// + /// The line fill color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? HoverBackgroundColor { get; set; } + + /// + /// Cap style of the line when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? HoverBorderCapStyle { get; set; } + + /// + /// The line color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? HoverBorderColor { get; set; } + + /// + /// Gets or sets the length and spacing of dashes when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? HoverBorderDash { get; set; } + + /// + /// Offset for line dashes when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public double? HoverBorderDashOffset { get; set; } + + /// + /// Line joint style. + /// There are three possible values for this property: 'round', 'bevel', and 'miter'. + /// + /// + /// Default value is 'miter'. + /// + public string HoverBorderJoinStyle { get; set; } = "miter"; + + /// + /// The bar border width when hovered (in pixels) when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public double? HoverBorderWidth { get; set; } + + /// + /// The fill color for points. + /// + /// + /// Default value is 'rgba(0, 0, 0, 0.1)'. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? PointBackgroundColor { get; set; } + + /// + /// The border color for points. + /// + /// + /// Default value is 'rgba(0, 0, 0, 0.1)'. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? PointBorderColor { get; set; } + + /// + /// The width of the point border in pixels. + /// + /// + /// Default value is 1. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? PointBorderWidth { get; set; } + + /// + /// The pixel size of the non-displayed point that reacts to mouse events. + /// + /// + /// Default value is 1. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? PointHitRadius { get; set; } + + /// + /// Point background color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? PointHoverBackgroundColor { get; set; } + + /// + /// Point border color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? PointHoverBorderColor { get; set; } + + /// + /// Border width of point when hovered. + /// + /// + /// Default value is 1. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? PointHoverBorderWidth { get; set; } + + /// + /// The radius of the point when hovered. + /// + /// + /// Default value is 4. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? PointHoverRadius { get; set; } + + /// + /// The radius of the point shape. If set to 0, the point is not rendered. + /// + /// + /// Default value is 3. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? PointRadius { get; set; } + + /// + /// The rotation of the point in degrees. + /// + /// + /// Default value is 0. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? PointRotation { get; set; } + + /// + /// Style of the point. + /// Supported values are 'circle', 'cross', 'crossRot', 'dash', 'line', 'rect', 'rectRounded', 'rectRot', 'star', and + /// 'triangle' to style. + /// the point. + /// + /// + /// Default value is 'circle'. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? PointStyle { get; set; } + + /// + /// If , lines will be drawn between points with no or null data. + /// If , points with null data will create a break in the line. + /// Can also be a number specifying the maximum gap length to span. + /// The unit of the value depends on the scale used. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public bool? SpanGaps { get; set; } + + /// + /// Bezier curve tension of the line. Set to 0 to draw straight lines. + /// This option is ignored if monotone cubic interpolation is used. + /// + /// + /// Default value is 0. + /// + public double Tension { get; set; } + + #endregion } -public class RadarChartDatasetDataLabels : ChartDatasetDataLabels -{ -} +public class RadarChartDatasetDataLabels : ChartDatasetDataLabels { } diff --git a/blazorbootstrap/Models/Charts/ChartDataset/ScatterChart/ScatterChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/ScatterChart/ScatterChartDataset.cs index c1b609167..401a650be 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/ScatterChart/ScatterChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/ScatterChart/ScatterChartDataset.cs @@ -1,342 +1,340 @@ namespace BlazorBootstrap; /// -/// Scatter charts are based on basic line charts with the x-axis changed to a linear axis. +/// Scatter charts are based on basic line charts with the x-axis changed to a linear axis. /// To use a scatter chart, data must be passed as objects containing X and Y properties. /// . -/// 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 . +/// 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 . /// public class ScatterChartDataset : ChartDataset { - #region Properties, Indexers - - /// - /// Get or sets the line fill color. - /// - /// - /// Default value is 'rgba(0, 0, 0, 0.1)'. - /// - public string BackgroundColor { get; set; } = "rgba(0, 0, 0, 0.1)"; - - /// - /// Cap style of the line. - /// Supported values are 'butt', 'round', and 'square'. - /// - /// - /// Default value is 'butt'. - /// - public string BorderCapStyle { get; set; } = "butt"; - - /// - /// Get or sets the line color. - /// - /// - /// Default value is 'rgba(0, 0, 0, 0.1)'. - /// - public string BorderColor { get; set; } = "rgba(0, 0, 0, 0.1)"; - - /// - /// Gets or sets the length and spacing of dashes. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? BorderDash { get; set; } - - /// - /// Offset for line dashes. - /// - /// - /// Default value is 0.0. - /// - public double BorderDashOffset { get; set; } - - /// - /// Line joint style. - /// There are three possible values for this property: 'round', 'bevel', and 'miter'. - /// - /// - /// Default value is 'miter'. - /// - public string BorderJoinStyle { get; set; } = "miter"; - - /// - /// Gets or sets the line width (in pixels). - /// - /// - /// Default value is 3. - /// - public double BorderWidth { get; set; } = 3; - - /// - /// . - /// Supported values are 'default', and 'monotone'. - /// - /// - /// Default value is 'default'. - /// - public string CubicInterpolationMode { get; set; } = "default"; - - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public LineChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link - - /// - /// Draw the active points of a dataset over the other points of the dataset. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? DrawActiveElementsOnTop { get; set; } - - /// - /// How to fill the area under the line. - /// - /// - /// Default value is . - /// - public bool Fill { get; set; } - - /// - /// The line fill color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public string? HoverBackgroundColor { get; set; } - - /// - /// Cap style of the line when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public string? HoverBorderCapStyle { get; set; } - - /// - /// The line color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public string? HoverBorderColor { get; set; } - - /// - /// Gets or sets the length and spacing of dashes when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? HoverBorderDash { get; set; } - - /// - /// Offset for line dashes when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public double? HoverBorderDashOffset { get; set; } - - /// - /// Line joint style. - /// There are three possible values for this property: 'round', 'bevel', and 'miter'. - /// - /// - /// Default value is 'miter'. - /// - public string HoverBorderJoinStyle { get; set; } = "miter"; - - /// - /// The bar border width when hovered (in pixels) when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public double? HoverBorderWidth { get; set; } - - /// - /// The base axis of the dataset. 'x' for horizontal lines and 'y' for vertical lines. - /// - /// - /// Default value is 'x'. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public string? IndexAxis { get; set; } - - /// - /// The fill color for points. - /// - /// - /// Default value is 'rgba(0, 0, 0, 0.1)'. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? PointBackgroundColor { get; set; } - - /// - /// The border color for points. - /// - /// - /// Default value is 'rgba(0, 0, 0, 0.1)'. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? PointBorderColor { get; set; } - - /// - /// The width of the point border in pixels. - /// - /// - /// Default value is 1. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? PointBorderWidth { get; set; } - - /// - /// The pixel size of the non-displayed point that reacts to mouse events. - /// - /// - /// Default value is 1. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? PointHitRadius { get; set; } - - /// - /// Point background color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? PointHoverBackgroundColor { get; set; } - - /// - /// Point border color when hovered. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? PointHoverBorderColor { get; set; } - - /// - /// Border width of point when hovered. - /// - /// - /// Default value is 1. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? PointHoverBorderWidth { get; set; } - - /// - /// The radius of the point when hovered. - /// - /// - /// Default value is 4. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? PointHoverRadius { get; set; } - - /// - /// The radius of the point shape. If set to 0, the point is not rendered. - /// - /// - /// Default value is 3. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? PointRadius { get; set; } - - /// - /// The rotation of the point in degrees. - /// - /// - /// Default value is 0. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? PointRotation { get; set; } - - /// - /// Style of the point. - /// Supported values are 'circle', 'cross', 'crossRot', 'dash', 'line', 'rect', 'rectRounded', 'rectRot', 'star', and 'triangle' to style. - /// the point. - /// - /// - /// Default value is 'circle'. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public List? PointStyle { get; set; } - - //segment - //https://www.chartjs.org/docs/latest/charts/line.html#segment - - /// - /// If , the lines between points are not drawn. - /// By default, the scatter chart will override the showLine property of the line chart to false. - /// - /// - /// Default value is . - /// - public bool ShowLine { get; } = false; - - /// - /// If , lines will be drawn between points with no or null data. - /// If , points with null data will create a break in the line. - /// Can also be a number specifying the maximum gap length to span. - /// The unit of the value depends on the scale used. - /// - /// - /// Default value is . - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public bool? SpanGaps { get; set; } - - //stack - //https://www.chartjs.org/docs/latest/charts/line.html#general - - /// - /// true to show the line as a stepped line (tension will be ignored). - /// - /// - /// Default value is . - /// - public bool Stepped { get; set; } - - /// - /// Bezier curve tension of the line. Set to 0 to draw straight lines. - /// This option is ignored if monotone cubic interpolation is used. - /// - /// - /// Default value is 0. - /// - public double Tension { get; set; } - - /// - /// The ID of the x axis to plot this dataset on. - /// - /// - /// Default value is 'first x axis'. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public string? XAxisID { get; set; } - - /// - /// The ID of the y axis to plot this dataset on. - /// - /// - /// Default value is 'first y axis'. - /// - [JsonIgnore( Condition = JsonIgnoreCondition.WhenWritingNull )] - public string? YAxisID { get; set; } - - #endregion + #region Properties, Indexers + + /// + /// Get or sets the line fill color. + /// + /// + /// Default value is 'rgba(0, 0, 0, 0.1)'. + /// + public string BackgroundColor { get; set; } = "rgba(0, 0, 0, 0.1)"; + + /// + /// Cap style of the line. + /// Supported values are 'butt', 'round', and 'square'. + /// + /// + /// Default value is 'butt'. + /// + public string BorderCapStyle { get; set; } = "butt"; + + /// + /// Get or sets the line color. + /// + /// + /// Default value is 'rgba(0, 0, 0, 0.1)'. + /// + public string BorderColor { get; set; } = "rgba(0, 0, 0, 0.1)"; + + /// + /// Gets or sets the length and spacing of dashes. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? BorderDash { get; set; } + + /// + /// Offset for line dashes. + /// + /// + /// Default value is 0.0. + /// + public double BorderDashOffset { get; set; } + + /// + /// Line joint style. + /// There are three possible values for this property: 'round', 'bevel', and 'miter'. + /// + /// + /// Default value is 'miter'. + /// + public string BorderJoinStyle { get; set; } = "miter"; + + /// + /// Gets or sets the line width (in pixels). + /// + /// + /// Default value is 3. + /// + public double BorderWidth { get; set; } = 3; + + /// + /// . + /// Supported values are 'default', and 'monotone'. + /// + /// + /// Default value is 'default'. + /// + public string CubicInterpolationMode { get; set; } = "default"; + + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public LineChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link + + /// + /// Draw the active points of a dataset over the other points of the dataset. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? DrawActiveElementsOnTop { get; set; } + + /// + /// How to fill the area under the line. + /// + /// + /// Default value is . + /// + public bool Fill { get; set; } + + /// + /// The line fill color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? HoverBackgroundColor { get; set; } + + /// + /// Cap style of the line when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? HoverBorderCapStyle { get; set; } + + /// + /// The line color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? HoverBorderColor { get; set; } + + /// + /// Gets or sets the length and spacing of dashes when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? HoverBorderDash { get; set; } + + /// + /// Offset for line dashes when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public double? HoverBorderDashOffset { get; set; } + + /// + /// Line joint style. + /// There are three possible values for this property: 'round', 'bevel', and 'miter'. + /// + /// + /// Default value is 'miter'. + /// + public string HoverBorderJoinStyle { get; set; } = "miter"; + + /// + /// The bar border width when hovered (in pixels) when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public double? HoverBorderWidth { get; set; } + + /// + /// The base axis of the dataset. 'x' for horizontal lines and 'y' for vertical lines. + /// + /// + /// Default value is 'x'. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? IndexAxis { get; set; } + + /// + /// The fill color for points. + /// + /// + /// Default value is 'rgba(0, 0, 0, 0.1)'. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? PointBackgroundColor { get; set; } + + /// + /// The border color for points. + /// + /// + /// Default value is 'rgba(0, 0, 0, 0.1)'. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? PointBorderColor { get; set; } + + /// + /// The width of the point border in pixels. + /// + /// + /// Default value is 1. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? PointBorderWidth { get; set; } + + /// + /// The pixel size of the non-displayed point that reacts to mouse events. + /// + /// + /// Default value is 1. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? PointHitRadius { get; set; } + + /// + /// Point background color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? PointHoverBackgroundColor { get; set; } + + /// + /// Point border color when hovered. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? PointHoverBorderColor { get; set; } + + /// + /// Border width of point when hovered. + /// + /// + /// Default value is 1. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? PointHoverBorderWidth { get; set; } + + /// + /// The radius of the point when hovered. + /// + /// + /// Default value is 4. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? PointHoverRadius { get; set; } + + /// + /// The radius of the point shape. If set to 0, the point is not rendered. + /// + /// + /// Default value is 3. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? PointRadius { get; set; } + + /// + /// The rotation of the point in degrees. + /// + /// + /// Default value is 0. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? PointRotation { get; set; } + + /// + /// Style of the point. + /// Supported values are 'circle', 'cross', 'crossRot', 'dash', 'line', 'rect', 'rectRounded', 'rectRot', 'star', and + /// 'triangle' to style. + /// the point. + /// + /// + /// Default value is 'circle'. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? PointStyle { get; set; } + + //segment + //https://www.chartjs.org/docs/latest/charts/line.html#segment + + /// + /// If , the lines between points are not drawn. + /// By default, the scatter chart will override the showLine property of the line chart to false. + /// + /// + /// Default value is . + /// + public bool ShowLine { get; } = false; + + /// + /// If , lines will be drawn between points with no or null data. + /// If , points with null data will create a break in the line. + /// Can also be a number specifying the maximum gap length to span. + /// The unit of the value depends on the scale used. + /// + /// + /// Default value is . + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public bool? SpanGaps { get; set; } + + //stack + //https://www.chartjs.org/docs/latest/charts/line.html#general + + /// + /// true to show the line as a stepped line (tension will be ignored). + /// + /// + /// Default value is . + /// + public bool Stepped { get; set; } + + /// + /// Bezier curve tension of the line. Set to 0 to draw straight lines. + /// This option is ignored if monotone cubic interpolation is used. + /// + /// + /// Default value is 0. + /// + public double Tension { get; set; } + + /// + /// The ID of the x axis to plot this dataset on. + /// + /// + /// Default value is 'first x axis'. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? XAxisID { get; set; } + + /// + /// The ID of the y axis to plot this dataset on. + /// + /// + /// Default value is 'first y axis'. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? YAxisID { get; set; } + + #endregion } -public class ScatterChartDatasetDataLabels : ChartDatasetDataLabels -{ -} +public class ScatterChartDatasetDataLabels : ChartDatasetDataLabels { } From 1293784fce1a000e0c10af81e91d30e4b371fa8d Mon Sep 17 00:00:00 2001 From: Vikram Reddy Date: Sat, 7 Sep 2024 12:18:16 +0530 Subject: [PATCH 4/4] Formatting updates --- .../Models/Charts/ChartDataset/BarChart/BarChartDataset.cs | 3 ++- .../Charts/ChartDataset/DoughnutChart/DoughnutChartDataset.cs | 3 ++- .../Models/Charts/ChartDataset/LineChart/LineChartDataset.cs | 3 ++- .../Models/Charts/ChartDataset/PieChart/PieChartDataset.cs | 3 ++- .../ChartDataset/PolarAreaChart/PolarAreaChartDataset.cs | 3 ++- .../Models/Charts/ChartDataset/RadarChart/RadarChartDataset.cs | 3 ++- .../Charts/ChartDataset/ScatterChart/ScatterChartDataset.cs | 3 ++- 7 files changed, 14 insertions(+), 7 deletions(-) diff --git a/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDataset.cs index ce8b7c22c..441930f61 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/BarChart/BarChartDataset.cs @@ -75,7 +75,8 @@ public class BarChartDataset : ChartDataset /// public double CategoryPercentage { get; set; } = 0.8; - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public BarChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public BarChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link /// /// Should the bars be grouped on index axis. diff --git a/blazorbootstrap/Models/Charts/ChartDataset/DoughnutChart/DoughnutChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/DoughnutChart/DoughnutChartDataset.cs index b47c7594e..a6554bff5 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/DoughnutChart/DoughnutChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/DoughnutChart/DoughnutChartDataset.cs @@ -92,7 +92,8 @@ public class DoughnutChartDataset : ChartDataset [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public double? Circumference { get; set; } - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public DoughnutChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public DoughnutChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link /// /// Arc background color when hovered. diff --git a/blazorbootstrap/Models/Charts/ChartDataset/LineChart/LineChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/LineChart/LineChartDataset.cs index cfb156de2..8c035851b 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/LineChart/LineChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/LineChart/LineChartDataset.cs @@ -189,7 +189,8 @@ public LineChartDataset FillToValue(double value) /// public string CubicInterpolationMode { get; set; } = "default"; - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public LineChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public LineChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link /// /// Draw the active points of a dataset over the other points of the dataset. diff --git a/blazorbootstrap/Models/Charts/ChartDataset/PieChart/PieChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/PieChart/PieChartDataset.cs index 784886f37..80f91271c 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/PieChart/PieChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/PieChart/PieChartDataset.cs @@ -92,7 +92,8 @@ public class PieChartDataset : ChartDataset [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public double? Circumference { get; set; } - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public PieChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public PieChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link /// /// Arc background color when hovered. diff --git a/blazorbootstrap/Models/Charts/ChartDataset/PolarAreaChart/PolarAreaChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/PolarAreaChart/PolarAreaChartDataset.cs index b4f283e80..dc749cad6 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/PolarAreaChart/PolarAreaChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/PolarAreaChart/PolarAreaChartDataset.cs @@ -77,7 +77,8 @@ public class PolarAreaChartDataset : ChartDataset /// public bool Circular { get; set; } = true; - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public PieChartDatasetDataLabels Datalabels { get; set; } = new(); + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public PieChartDatasetDataLabels Datalabels { get; set; } = new(); /// /// Arc background color when hovered. diff --git a/blazorbootstrap/Models/Charts/ChartDataset/RadarChart/RadarChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/RadarChart/RadarChartDataset.cs index 981ccc1be..58655626d 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/RadarChart/RadarChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/RadarChart/RadarChartDataset.cs @@ -68,7 +68,8 @@ public class RadarChartDataset : ChartDataset /// public double BorderWidth { get; set; } = 3; - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public RadarChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: Add reference link + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public RadarChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: Add reference link /// /// How to fill the area under the line. diff --git a/blazorbootstrap/Models/Charts/ChartDataset/ScatterChart/ScatterChartDataset.cs b/blazorbootstrap/Models/Charts/ChartDataset/ScatterChart/ScatterChartDataset.cs index 401a650be..987823b5c 100644 --- a/blazorbootstrap/Models/Charts/ChartDataset/ScatterChart/ScatterChartDataset.cs +++ b/blazorbootstrap/Models/Charts/ChartDataset/ScatterChart/ScatterChartDataset.cs @@ -79,7 +79,8 @@ public class ScatterChartDataset : ChartDataset /// public string CubicInterpolationMode { get; set; } = "default"; - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public LineChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public LineChartDatasetDataLabels Datalabels { get; set; } = new(); // TODO: add the reference link /// /// Draw the active points of a dataset over the other points of the dataset.