RobotNet/RobotNet.WebApp/Charts/Models/Common/Plugins/ChartPluginsLegendLabels.cs
2025-10-15 15:15:53 +07:00

68 lines
2.3 KiB
C#

using RobotNet.WebApp.Charts.Enums;
using System.Text.Json.Serialization;
namespace RobotNet.WebApp.Charts.Models.Common.Plugins;
public class ChartPluginsLegendLabels
{
/// <summary>
/// Width of coloured box.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? BoxWidth { get; set; }
/// <summary>
/// Height of the coloured box
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? BoxHeight { get; set; }
/// <summary>
/// Override the borderRadius to use.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? BorderRadius { get; set; }
/// <summary>
/// Color of label and the strikethrough.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Color { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ChartFont? Font { get; set; }
/// <summary>
/// Padding between rows of colored boxes.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? Padding { get; set; }
/// <summary>
/// If specified, this style of point is used for the legend. Only used if <see cref="UsePointStyle"/>> is true.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public PointStyle? PointStyle { get; set; }
/// <summary>
/// If <see cref="UsePointStyle"/> is <see langword="true" />, the width of the point style used for the legend.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? PointStyleWidth { get; set; }
/// <summary>
/// Label borderRadius will match corresponding <see cref="BorderRadius"/>.
/// </summary>
public bool UseBorderRadius { get; set; } = false;
/// <summary>
/// If <see langword="true"/>, Label style will match corresponding point style (size is based on pointStyleWidth or the minimum value between <see cref="BoxWidth"/> and <see cref="Font"/> -> Size).
/// </summary>
public bool UsePointStyle { get; set; } = false;
/// <summary>
/// Horizontal alignment of the label text
/// </summary>
public LegendAlignment TextAlign { get; set; } = LegendAlignment.Center;
}