first commit -push

This commit is contained in:
dungtt
2025-10-15 15:15:53 +07:00
parent 674ae395be
commit a9577c5756
885 changed files with 74595 additions and 0 deletions

View File

@@ -0,0 +1,86 @@
using RobotNet.WebApp.Charts.Enums;
using System.Text.Json.Serialization;
namespace RobotNet.WebApp.Charts.Models.BarChart.Axes;
public class ChartAxes
{
/// <summary>
/// If true, scale will include 0 if it is not already included.
/// </summary>
public bool BeginAtZero { get; set; } = true;
/// <summary>
/// Define options for the border that run perpendicular to the axis.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ChartAxesBorder? Border { get; set; }
/// <summary>
/// Gets or sets the grid configuration.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ChartAxesGrid? Grid { get; set; }
/// <summary>
/// User defined maximum number for the scale, overrides maximum value from data.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public double? Max { get; set; }
/// <summary>
/// User defined minimum number for the scale, overrides minimum value from data.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public double? Min { get; set; }
/// <summary>
/// Should the data be stacked.
/// By default data is not stacked.
/// If the stacked option of the value scale (y-axis on horizontal chart) is true, positive and negative values are stacked
/// separately.
/// </summary>
public bool Stacked { get; set; }
/// <summary>
/// Adjustment used when calculating the maximum data value.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public double? SuggestedMax { get; set; }
/// <summary>
/// Adjustment used when calculating the minimum data value.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public double? SuggestedMin { get; set; }
/// <summary>
/// Gets or sets the tick configuration.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ChartAxesTicks? Ticks { get; set; }
/// <summary>
/// Gets or sets the title configuration.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ChartAxesTitle? Title { get; set; }
/// <summary>
/// Gets or sets the index scale type. />.
/// </summary>
/// <remarks>
/// Default value is <see langword="null" />.
/// </remarks>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ChartAxesType? Type { get; set; } = null;
/// <summary>
/// The weight used to sort the axis. Higher weights are further away from the chart area.
/// </summary>
public int? Weight { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public TitlePosition? Position { get; set; }
}

View File

@@ -0,0 +1,41 @@
using System.Text.Json.Serialization;
namespace RobotNet.WebApp.Charts.Models.BarChart.Axes;
public class ChartAxesBorder
{
/// <summary>
/// The color of the border line.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Color { get; set; }
/// <summary>
/// Length and spacing of dashes on grid lines
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<int>? Dash { get; set; }
/// <summary>
/// Offset for line dashes.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? DashOffset { get; set; }
/// <summary>
/// If <see langword="true" />, draw a border at the edge between the axis and the chart area.
/// </summary>
public bool Display { get; set; } = true;
/// <summary>
/// The width of the border line.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? Width { get; set; }
/// <summary>
/// z-index of the border layer. Values <= 0 are drawn under datasets, > 0 on top.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? Z { get; set; }
}

View File

@@ -0,0 +1,82 @@
using System.Text.Json.Serialization;
namespace RobotNet.WebApp.Charts.Models.BarChart.Axes;
public class ChartAxesGrid
{
/// <summary>
/// If <see langword="true" />, gridlines are circular (on radar and polar area charts only).
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? Circular { get; set; }
/// <summary>
/// Color of the grid axis lines. Here one can write a CSS method or even a JavaScript method for a dynamic color.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Color { get; set; }
/// <summary>
/// If false, do not display grid lines for this axis.
/// </summary>
public bool Display { get; set; } = true;
/// <summary>
/// If <see langword="true" />, draw lines on the chart area inside the axis lines. This is useful when there are multiple
/// axes and you need to control which grid lines are drawn.
/// </summary>
public bool DrawOnChartArea { get; set; } = true;
/// <summary>
/// If <see langword="true" />, draw lines beside the ticks in the axis area beside the chart.
/// </summary>
public bool DrawTicks { get; set; } = true;
/// <summary>
/// Stroke width of grid lines.
/// </summary>
public int LineWidth { get; set; } = 1;
/// <summary>
/// If <see langword="true" />, grid lines will be shifted to be between labels. This is set to true for a bar chart by
/// default.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? Offset { get; set; } = false;
/// <summary>
/// Length and spacing of the tick mark line.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<int>? TickBorderDash { get; set; }
/// <summary>
/// Offset for the line dash of the tick mark.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? TickBorderDashOffset { get; set; }
/// <summary>
/// Color of the tick line. If unset, defaults to the grid line color.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? TickColor { get; set; }
/// <summary>
/// Length in pixels that the grid lines will draw into the axis area.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? TickLength { get; set; }
/// <summary>
/// Width of the tick mark in pixels.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? TickWidth { get; set; }
/// <summary>
/// z-index of the gridline layer. Values <= 0 are drawn under datasets, > 0 on top.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? Z { get; set; }
}

View File

@@ -0,0 +1,64 @@
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 ChartAxesTicks
{
[JsonPropertyName("align")]
public TicksAlignment Alignment { get; set; } = TicksAlignment.Center;
/// <summary>
/// Color of label backdrops
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? BackdropColor { get; set; }
/// <summary>
/// Padding of label backdrop
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? BackdropPadding { get; set; }
/// <summary>
/// Color of ticks
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Color { get; set; }
/// <summary>
/// If <see langword="true" />, show tick labels.
/// </summary>
public bool Display { get; set; } = true;
/// <summary>
/// defines options for the major tick marks that are generated by the axis.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ChartAxesTicksMajor? Major { get; set; }
/// <summary>
/// Sets the offset of the tick labels from the axis
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ChartPadding? Padding { get; set; }
/// <summary>
/// If <see langword="true" />, draw a background behind the tick labels.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? ShowLabelBackdrop { get; set; }
/// <summary>
/// The color of the stroke around the text.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? TextStrokeColor { get; set; }
/// <summary>
/// Stroke width around the text.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? TextStrokeWidth { get; set; }
}

View File

@@ -0,0 +1,10 @@
namespace RobotNet.WebApp.Charts.Models.BarChart.Axes;
public class ChartAxesTicksMajor
{
/// <summary>
/// If <see langword="true" />, major ticks are generated. A major tick will affect auto skipping and major will be defined
/// on ticks in the scriptable options context.
/// </summary>
public bool Enabled { get; set; } = false;
}

View File

@@ -0,0 +1,44 @@
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; }
}