first commit -push
This commit is contained in:
55
RobotNet.WebApp/Charts/Models/Common/Elements/Arc.cs
Normal file
55
RobotNet.WebApp/Charts/Models/Common/Elements/Arc.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using RobotNet.WebApp.Charts.Enums;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace RobotNet.WebApp.Charts.Models.Common.Elements;
|
||||
|
||||
public class Arc
|
||||
{
|
||||
/// <summary>
|
||||
/// Arc angle to cover.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public double? Angle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Arc fill color.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? BackgroundColor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Arc stroke alignment.
|
||||
/// </summary>
|
||||
public BorderAlign BorderAlign { get; set; } = BorderAlign.Center;
|
||||
|
||||
/// <summary>
|
||||
/// Arc stroke color.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? BorderColor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Arc line dash
|
||||
/// </summary>
|
||||
public int[]? BorderDash { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Arc line dash offset
|
||||
/// </summary>
|
||||
public double BorderDashOffset { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Line join style.
|
||||
/// </summary>
|
||||
public BorderJoinStyle? BorderJoinStyle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Arc stroke width.
|
||||
/// </summary>
|
||||
public int BorderWidth { get; set; } = 2;
|
||||
|
||||
/// <summary>
|
||||
/// By default the Arc is curved. If circular: false the Arc will be flat
|
||||
/// </summary>
|
||||
public bool Circular { get; set; } = true;
|
||||
}
|
||||
46
RobotNet.WebApp/Charts/Models/Common/Elements/Bar.cs
Normal file
46
RobotNet.WebApp/Charts/Models/Common/Elements/Bar.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using RobotNet.WebApp.Charts.Enums;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace RobotNet.WebApp.Charts.Models.Common.Elements;
|
||||
|
||||
public class Bar
|
||||
{
|
||||
/// <summary>
|
||||
/// Bar fill color.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? BackgroundColor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Bar stroke width.
|
||||
/// </summary>
|
||||
public int BorderWidth { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// Bar stroke color.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? BorderColor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Skipped (excluded) border.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public BorderSkipped? BorderSkipped { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The bar border radius (in pixels).
|
||||
/// </summary>
|
||||
public int BorderRadius { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The amount of pixels to inflate the bar rectangle(s) when drawing.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? InflateAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Style of the point for legend.
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public PointStyle? PointStyle { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace RobotNet.WebApp.Charts.Models.Common.Elements;
|
||||
|
||||
public class ChartElements
|
||||
{
|
||||
/// <summary>
|
||||
/// Arcs are used in the polar area, doughnut and pie charts.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public Arc? Arc { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Bar elements are used to represent the bars in a bar chart.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public Bar? Bar { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Line elements are used to represent the line in a line chart.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public Line? Line { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Point elements are used to represent the points in a line, radar or bubble chart.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public Point? Point { get; set; }
|
||||
}
|
||||
71
RobotNet.WebApp/Charts/Models/Common/Elements/Line.cs
Normal file
71
RobotNet.WebApp/Charts/Models/Common/Elements/Line.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
using RobotNet.WebApp.Charts.Enums;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace RobotNet.WebApp.Charts.Models.Common.Elements;
|
||||
|
||||
public class Line
|
||||
{
|
||||
/// <summary>
|
||||
/// Bézier curve tension (0 for no Bézier curves).
|
||||
/// </summary>
|
||||
public int Tension { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Line fill color.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? BackgroundColor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Line stroke width.
|
||||
/// </summary>
|
||||
public int BorderWidth { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// Line stroke color.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? BorderColor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Line cap style.
|
||||
/// </summary>
|
||||
public string BorderCapStyle { get; set; } = "butt";
|
||||
|
||||
/// <summary>
|
||||
/// Line dash.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int[]? BorderDash { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Line dash offset.
|
||||
/// </summary>
|
||||
public double BorderDashOffset { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Line join style.
|
||||
/// </summary>
|
||||
public BorderJoinStyle BorderJoinStyle { get; set; } = BorderJoinStyle.Miter;
|
||||
|
||||
/// <summary>
|
||||
/// if true to keep Bézier control inside the chart, false for no restriction.
|
||||
/// </summary>
|
||||
public bool CapBezierPoints { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Interpolation mode to apply.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? CubicInterpolationMode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// How to fill the area under the line.
|
||||
/// </summary>
|
||||
public bool Fill { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// if true to show the line as a stepped line (tension will be ignored).
|
||||
/// </summary>
|
||||
public bool Stepped { get; set; }
|
||||
}
|
||||
54
RobotNet.WebApp/Charts/Models/Common/Elements/Point.cs
Normal file
54
RobotNet.WebApp/Charts/Models/Common/Elements/Point.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using RobotNet.WebApp.Charts.Enums;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace RobotNet.WebApp.Charts.Models.Common.Elements;
|
||||
|
||||
public class Point
|
||||
{
|
||||
/// <summary>
|
||||
/// Point radius.
|
||||
/// </summary>
|
||||
public double Radius { get; set; } = 3;
|
||||
|
||||
/// <summary>
|
||||
/// Point style.
|
||||
/// </summary>
|
||||
public PointStyle PointStyle { get; set; } = PointStyle.Circle;
|
||||
|
||||
/// <summary>
|
||||
/// Point rotation (in degrees).
|
||||
/// </summary>
|
||||
public double Rotation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Point fill color.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? BackgroundColor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Point stroke width.
|
||||
/// </summary>
|
||||
public int BorderWidth { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// Point stroke color.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? BorderColor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Extra radius added to point radius for hit detection.
|
||||
/// </summary>
|
||||
public double HitRadius { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// Point radius when hovered.
|
||||
/// </summary>
|
||||
public int HhoverRadius { get; set; } = 4;
|
||||
|
||||
/// <summary>
|
||||
/// Stroke width when hovered.
|
||||
/// </summary>
|
||||
public int HoverBorderWidth { get; set; } = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user