RobotNet/RobotNet.WebApp/Charts/Models/ComboBarLineChart/ComboBarLineDataset.cs
2025-10-15 15:15:53 +07:00

117 lines
4.0 KiB
C#

using RobotNet.WebApp.Charts.Enums;
using RobotNet.WebApp.Charts.Models.Common.Dataset;
using System.Text.Json.Serialization;
namespace RobotNet.WebApp.Charts.Models.ComboBarLineChart;
public class ComboBarLineDataset : ChartDataset<double>
{
/// <summary>
/// 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.
/// </summary>
/// <remarks>
/// Default value is 0.9.
/// </remarks>
public double BarPercentage { get; set; } = 0.9;
/// <summary>
/// It is applied to the width of each bar, in pixels.
/// When this is enforced, barPercentage and categoryPercentage are ignored.
/// </summary>
/// <remarks>
/// Default value is <see langword="null" />.
/// </remarks>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public double? BarThickness { get; set; }
/// <summary>
/// This setting is used to avoid drawing the bar stroke at the base of the fill, or disable the border radius.
/// </summary>
public BorderSkipped BorderSkipped { get; set; } = BorderSkipped.Start;
/// <summary>
/// Percent (0-1) of the available width each category should be within the sample width.
/// </summary>
/// <remarks>
/// Default value is 0.8.
/// </remarks>
public double CategoryPercentage { get; set; } = 0.8;
/// <summary>
/// Should the bars be grouped on index axis.
/// When <see langword="true" />, all the datasets at same index value will be placed next to each other centering on that
/// index value.
/// When <see langword="false" />, each bar is placed on its actual index-axis value.
/// </summary>
/// <remarks>
/// Default value is <see langword="true" />.
/// </remarks>
public bool Grouped { get; set; } = true;
/// <summary>
/// The bar border radius when hovered (in pixels).
/// </summary>
/// <remarks>
/// Default value is 0.
/// </remarks>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<double>? HoverBorderRadius { get; set; }
/// <summary>
/// The base axis of the chart. 'x' for vertical charts and 'y' for horizontal charts.
/// Supported values are 'x' and 'y'.
/// </summary>
/// <remarks>
/// Default value is <see langword="null" />.
/// </remarks>
public IndexAxis IndexAxis { get; set; } = IndexAxis.X;
/// <summary>
/// Set this to ensure that bars are not sized thicker than this.
/// </summary>
/// <remarks>
/// Default value is <see langword="null" />.
/// </remarks>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public double? MaxBarThickness { get; set; }
/// <summary>
/// Set this to ensure that bars have a minimum length in pixels.
/// </summary>
/// <remarks>
/// Default value is <see langword="null" />.
/// </remarks>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public double? MinBarLength { get; set; }
public PointStyle PointStyle { get; set; } = PointStyle.Circle;
/// <summary>
/// If <see langword="true" />, null or undefined values will not be used for spacing calculations when determining bar
/// size.
/// </summary>
/// <remarks>
/// Default value is <see langword="false" />.
/// </remarks>
public bool SkipNull { get; set; }
/// <summary>
/// The ID of the x axis to plot this dataset on.
/// </summary>
/// <remarks>
/// Default value is first x axis.
/// </remarks>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? XAxisID { get; set; }
/// <summary>
/// The ID of the y axis to plot this dataset on.
/// </summary>
/// <remarks>
/// Default value is first y axis.
/// </remarks>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? YAxisID { get; set; }
}