using System.Text.Json.Serialization; namespace RobotNet.WebApp.Charts.Models.Common.Dataset; public class ChartDataset : IChartDataset { public ChartDataset() { Oid = Guid.NewGuid(); } /// /// 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; } /// /// 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; } /// /// 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; } /// /// Gets or sets the chart type. /// /// /// Default value is . /// [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? Type { get; set; } /// /// 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; } /// /// 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 ChartDatasetDataLabels? Datalabels { get; set; } /// /// 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; }