first commit -push
This commit is contained in:
216
RobotNet.WebApp/Charts/Models/LineChart/LineChartDataset.cs
Normal file
216
RobotNet.WebApp/Charts/Models/LineChart/LineChartDataset.cs
Normal file
@@ -0,0 +1,216 @@
|
||||
using RobotNet.WebApp.Charts.Enums;
|
||||
using RobotNet.WebApp.Charts.Models.Common.Dataset;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace RobotNet.WebApp.Charts.Models.LineChart;
|
||||
|
||||
public class LineChartDataset : 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>
|
||||
/// Draw the active points of a dataset over the other points of the dataset.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Default value is <see langword="null" />.
|
||||
/// </remarks>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public List<bool>? DrawActiveElementsOnTop { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// How to fill the area under the line.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Default value is <see langword="false" />.
|
||||
/// </remarks>
|
||||
public object Fill { get; set; } = false;
|
||||
|
||||
/// <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 base axis of the dataset. 'x' for horizontal lines and 'y' for vertical lines.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Default value is 'x'.
|
||||
/// </remarks>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public IndexAxis? IndexAxis { 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; }
|
||||
|
||||
//segment
|
||||
//https://www.chartjs.org/docs/latest/charts/line.html#segment
|
||||
|
||||
/// <summary>
|
||||
/// If <see langword="false" />, the lines between points are not drawn.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Default value is <see langword="true" />.
|
||||
/// </remarks>
|
||||
public bool ShowLine { get; set; } = true;
|
||||
|
||||
/// <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; }
|
||||
|
||||
//stack
|
||||
//https://www.chartjs.org/docs/latest/charts/line.html#general
|
||||
|
||||
/// <summary>
|
||||
/// true to show the line as a stepped line (tension will be ignored).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Default value is <see langword="false" />.
|
||||
/// </remarks>
|
||||
public bool Stepped { 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; }
|
||||
|
||||
/// <summary>
|
||||
/// The ID of the x axis to plot this dataset on.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Default value is 'first x axis'.
|
||||
/// </remarks>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? XAxisID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The ID of the y axis to plot this dataset on.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Default value is 'first y axis'.
|
||||
/// </remarks>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? YAxisID { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
using RobotNet.WebApp.Charts.Models.Common.Dataset;
|
||||
|
||||
namespace RobotNet.WebApp.Charts.Models.LineChart;
|
||||
|
||||
public class LineChartDatasetData(string? datasetLabel, object data, string? backgroundColor) : ChartDatasetData(datasetLabel, data, backgroundColor)
|
||||
{
|
||||
}
|
||||
21
RobotNet.WebApp/Charts/Models/LineChart/LineChartOptions.cs
Normal file
21
RobotNet.WebApp/Charts/Models/LineChart/LineChartOptions.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using RobotNet.WebApp.Charts.Enums;
|
||||
using RobotNet.WebApp.Charts.Models.BarChart;
|
||||
using RobotNet.WebApp.Charts.Models.Common;
|
||||
|
||||
namespace RobotNet.WebApp.Charts.Models.LineChart;
|
||||
|
||||
public class LineChartOptions : ChartOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// The base axis of the chart. 'x' for vertical charts and 'y' for horizontal charts.
|
||||
/// Supported values are 'x' and 'y'.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Default value is <see langword="null"/>.
|
||||
/// </remarks>
|
||||
public IndexAxis IndexAxis { get; set; } = IndexAxis.X;
|
||||
|
||||
public LineChartPlugins Plugins { get; set; } = new();
|
||||
|
||||
public BarScales Scales { get; set; } = new();
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
using RobotNet.WebApp.Charts.Models.Common.Plugins;
|
||||
|
||||
namespace RobotNet.WebApp.Charts.Models.LineChart;
|
||||
|
||||
public class LineChartPlugins : ChartPlugins
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user