using RobotNet.WebApp.Charts.Enums;
using RobotNet.WebApp.Charts.Models.Common;
using System.Text.Json.Serialization;

namespace RobotNet.WebApp.Charts.Models.BarChart.Axes;

public class ChartAxesTitle
{
    /// <summary>
    /// Alignment of the title.
    /// Options are: 'start', 'center', and 'end'
    /// </summary>
    [JsonPropertyName("align")]
    public TitleAlignment Alignment { get; set; } = TitleAlignment.Center;

    /// <summary>
    /// Color of text.
    /// </summary>
    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
    public string? Color { get; set; } = "black";

    /// <summary>
    /// Is the title shown?
    /// </summary>
    public bool Display { get; set; } = true;

    public ChartFont? Font { get; set; } = new();

    public bool FullSize { get; set; } = true;

    /// <summary>
    /// Gets or sets the position of the title.
    /// </summary>
    public TitlePosition Position { get; set; } = TitlePosition.Top;

    /// <summary>
    /// Gets or sets the number of pixels to add above and below the title text.
    /// </summary>
    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
    public ChartPadding? Padding { get; set; }

    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] 
    public string? Text { get; set; }
}
