first commit -push
This commit is contained in:
36
RobotNet.WebApp/Charts/Models/RadarChart/Axis/AngleLines.cs
Normal file
36
RobotNet.WebApp/Charts/Models/RadarChart/Axis/AngleLines.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace RobotNet.WebApp.Charts.Models.RadarChart.Axis;
|
||||
|
||||
public class AngleLines
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the value indicating whether the angle line is displayed or not.
|
||||
/// </summary>
|
||||
public bool Display { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color of the angled lines.
|
||||
/// <para>See <see cref="ColorUtil"/> for working with colors.</para>
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? Color { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the width of the angled lines.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? LineWidth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the length and spacing of dashes of the angled lines.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int[]? BorderDash { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the offset for line dashes.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public double? BorderDashOffset { get; set; }
|
||||
}
|
||||
90
RobotNet.WebApp/Charts/Models/RadarChart/Axis/GridLines.cs
Normal file
90
RobotNet.WebApp/Charts/Models/RadarChart/Axis/GridLines.cs
Normal file
@@ -0,0 +1,90 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace RobotNet.WebApp.Charts.Models.RadarChart.Axis;
|
||||
|
||||
public class GridLines
|
||||
{
|
||||
/// <summary>
|
||||
/// If false, do not display grid lines for this axis.
|
||||
/// </summary>
|
||||
public bool Display { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// If true, gridlines are circular (on radar chart only).
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public bool? Circular { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The color of the grid lines. If specified as an array, the first color applies to the first grid line, the second to the second grid line and so on.
|
||||
/// <para>See <see cref="ColorUtil"/> for working with colors.</para>
|
||||
/// </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 double[]? BorderDash { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Stroke width of grid lines.
|
||||
/// </summary>
|
||||
public double LineWidth { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// If true, draw border at the edge between the axis and the chart area.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public bool? DrawBorder { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If 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>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public bool? DrawOnChartArea { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If true, draw lines beside the ticks in the axis area beside the chart.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public bool? DrawTicks { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Length in pixels that the grid lines will draw into the axis area.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? TickMarkLength { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Stroke width of the grid line for the first index (index 0).
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? ZeroLineWidth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Stroke color of the grid line for the first index (index 0).
|
||||
/// <para>See <see cref="ColorUtil"/> for working with colors.</para>
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? ZeroLineColor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Length and spacing of dashes of the grid line for the first index (index 0).
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public double[]? ZeroLineBorderDash { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Offset for line dashes of the grid line for the first index (index 0).
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public double? ZeroLineBorderDashOffset { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If true, grid lines will be shifted to be between labels. This is set to true for a category scale in a bar chart by default.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public bool? OffsetGridLines { get; set; }
|
||||
}
|
||||
47
RobotNet.WebApp/Charts/Models/RadarChart/Axis/PointLabels.cs
Normal file
47
RobotNet.WebApp/Charts/Models/RadarChart/Axis/PointLabels.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using RobotNet.WebApp.Charts.Models.Common;
|
||||
|
||||
namespace RobotNet.WebApp.Charts.Models.RadarChart.Axis;
|
||||
|
||||
public class PointLabels
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the font color for a point label.
|
||||
/// <para>See <see cref="ColorUtil"/> for working with colors.</para>
|
||||
/// </summary>
|
||||
public string? Color { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If true, point labels are shown. When display: 'auto', the label is hidden if it overlaps with another label
|
||||
/// </summary>
|
||||
public bool Display { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Background color of the point label.
|
||||
/// </summary>
|
||||
public string? BackdropColor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Border radius of the point label
|
||||
/// </summary>
|
||||
public double? BorderRadius { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Padding of label backdrop.
|
||||
/// </summary>
|
||||
public ChartPadding? BackdropPadding { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Padding between chart and point labels.
|
||||
/// </summary>
|
||||
public ChartPadding? Padding { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Font of the point label
|
||||
/// </summary>
|
||||
public ChartFont? Font { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If true, point labels are centered.
|
||||
/// </summary>
|
||||
public bool? CenterPointLabels { get; set; }
|
||||
}
|
||||
41
RobotNet.WebApp/Charts/Models/RadarChart/Axis/RadarAxis.cs
Normal file
41
RobotNet.WebApp/Charts/Models/RadarChart/Axis/RadarAxis.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using RobotNet.WebApp.Charts.Models.BarChart.Axes;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace RobotNet.WebApp.Charts.Models.RadarChart.Axis;
|
||||
|
||||
public class RadarAxis : ChartAxes
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the angle lines configuration.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public AngleLines? AngleLines { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the grid lines configuration.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public GridLines? GridLines { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the point labels configuration.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public PointLabels? PointLabels { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ticks configuration.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public new RadialTicks? Ticks { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether to animate scaling the chart from the centre
|
||||
/// </summary>
|
||||
public bool Animate { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Starting angle of the scale. In degrees, 0 is at top
|
||||
/// </summary>
|
||||
public double StartAngle { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace RobotNet.WebApp.Charts.Models.RadarChart.Axis;
|
||||
|
||||
public class RadarScale
|
||||
{
|
||||
public RadarAxis X { get; set; } = new();
|
||||
}
|
||||
67
RobotNet.WebApp/Charts/Models/RadarChart/Axis/RadialTicks.cs
Normal file
67
RobotNet.WebApp/Charts/Models/RadarChart/Axis/RadialTicks.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
using RobotNet.WebApp.Charts.Models.BarChart.Axes;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace RobotNet.WebApp.Charts.Models.RadarChart.Axis;
|
||||
|
||||
public class RadialTicks : ChartAxesTicks
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the horizontal padding of label backdrop.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? BackdropPaddingX { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the vertical padding of label backdrop.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? BackdropPaddingY { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the value indicating whether the scale will include 0 if it is not already included.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public bool? BeginAtZero { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the user defined minimum number for the scale, overrides minimum value from data.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public double? Min { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the user defined maximum number for the scale, overrides minimum value from data.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public double? Max { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the maximum number of ticks and gridlines to show.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? MaxTicksLimit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If defined and <see cref="StepSize"/> is not specified, the step size will be rounded to this many decimal places.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? Precision { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the user defined fixed step size for the scale.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public double? StepSize { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the adjustment used when calculating the maximum data value.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public double? SuggestedMax { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the adjustment used when calculating the minimum data value.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public double? SuggestedMin { get; set; }
|
||||
}
|
||||
156
RobotNet.WebApp/Charts/Models/RadarChart/RadarChartDataset.cs
Normal file
156
RobotNet.WebApp/Charts/Models/RadarChart/RadarChartDataset.cs
Normal file
@@ -0,0 +1,156 @@
|
||||
using RobotNet.WebApp.Charts.Models.Common.Dataset;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace RobotNet.WebApp.Charts.Models.RadarChart;
|
||||
|
||||
public class RadarChartDataset : ChartDataset<double>
|
||||
{
|
||||
/// <summary>
|
||||
/// Cap style of the line.
|
||||
/// Supported values are 'butt', 'round', and 'square'.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Default value is 'butt'.
|
||||
/// </remarks>
|
||||
public string BorderCapStyle { get; set; } = "butt";
|
||||
|
||||
/// <summary>
|
||||
/// How to fill the area under the line.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Default value is <see langword="false" />.
|
||||
/// </remarks>
|
||||
public bool Fill { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Cap style of the line when hovered.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Default value is <see langword="null" />.
|
||||
/// </remarks>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? HoverBorderCapStyle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The fill color for points.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Default value is 'rgba(0, 0, 0, 0.1)'.
|
||||
/// </remarks>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public List<string>? PointBackgroundColor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The border color for points.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Default value is 'rgba(0, 0, 0, 0.1)'.
|
||||
/// </remarks>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public List<string>? PointBorderColor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The width of the point border in pixels.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Default value is 1.
|
||||
/// </remarks>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public List<double>? PointBorderWidth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The pixel size of the non-displayed point that reacts to mouse events.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Default value is 1.
|
||||
/// </remarks>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public List<double>? PointHitRadius { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Point background color when hovered.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Default value is <see langword="null" />.
|
||||
/// </remarks>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public List<string>? PointHoverBackgroundColor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Point border color when hovered.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Default value is <see langword="null" />.
|
||||
/// </remarks>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public List<string>? PointHoverBorderColor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Border width of point when hovered.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Default value is 1.
|
||||
/// </remarks>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public List<double>? PointHoverBorderWidth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The radius of the point when hovered.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Default value is 4.
|
||||
/// </remarks>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public List<double>? PointHoverRadius { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The radius of the point shape. If set to 0, the point is not rendered.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Default value is 3.
|
||||
/// </remarks>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public List<double>? PointRadius { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The rotation of the point in degrees.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Default value is 0.
|
||||
/// </remarks>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public List<double>? PointRotation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Style of the point.
|
||||
/// Supported values are 'circle', 'cross', 'crossRot', 'dash', 'line', 'rect', 'rectRounded', 'rectRot', 'star', and
|
||||
/// 'triangle' to style.
|
||||
/// the point.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Default value is 'circle'.
|
||||
/// </remarks>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public List<string>? PointStyle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If <see langword="true" />, lines will be drawn between points with no or null data.
|
||||
/// If <see langword="false" />, points with null data will create a break in the line.
|
||||
/// Can also be a number specifying the maximum gap length to span.
|
||||
/// The unit of the value depends on the scale used.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Default value is <see langword="null" />.
|
||||
/// </remarks>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public bool? SpanGaps { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Bezier curve tension of the line. Set to 0 to draw straight lines.
|
||||
/// This option is ignored if monotone cubic interpolation is used.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Default value is 0.
|
||||
/// </remarks>
|
||||
public double Tension { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
using RobotNet.WebApp.Charts.Models.Common.Dataset;
|
||||
|
||||
namespace RobotNet.WebApp.Charts.Models.RadarChart;
|
||||
|
||||
public class RadarChartDatasetData(string? datasetLabel, double data, string? backgroundColor) : ChartDatasetData(datasetLabel, data, backgroundColor)
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using RobotNet.WebApp.Charts.Models.RadarChart.Axis;
|
||||
using RobotNet.WebApp.Charts.Models.Common;
|
||||
|
||||
namespace RobotNet.WebApp.Charts.Models.RadarChart;
|
||||
|
||||
public class RadarChartOptions : ChartOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the scale configuration for this chart.
|
||||
/// </summary>
|
||||
public RadarScale Scales { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether or not line gaps (by NaN data) will be spanned.
|
||||
/// If <see langword="false"/>, NaN data causes a break in the line.
|
||||
/// </summary>
|
||||
public bool? SpanGaps { get; set; }
|
||||
|
||||
public RadarChartPlugins Plugins { get; set; } = new();
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
using RobotNet.WebApp.Charts.Models.Common.Plugins;
|
||||
|
||||
namespace RobotNet.WebApp.Charts.Models.RadarChart;
|
||||
|
||||
public class RadarChartPlugins : ChartPlugins
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user