first commit -push
This commit is contained in:
35
RobotNet.WebApp/Charts/Models/Common/Plugins/ChartPlugins.cs
Normal file
35
RobotNet.WebApp/Charts/Models/Common/Plugins/ChartPlugins.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace RobotNet.WebApp.Charts.Models.Common.Plugins;
|
||||
|
||||
public class ChartPlugins
|
||||
{
|
||||
/// <summary>
|
||||
/// The chart legend displays data about the datasets that are appearing on the chart.
|
||||
/// </summary>
|
||||
public ChartPluginsLegend Legend { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// The chart title defines text to draw at the top of the chart.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public ChartPluginsTitle? Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Tooltip for the element.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public ChartPluginsTooltip? Tooltip { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// DataLabels for the element.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public ChartPluginsDataLabels? Datalabels { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Subtitle for the element.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public ChartPluginsSubtitle? Subtitle { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using RobotNet.WebApp.Charts.Enums;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace RobotNet.WebApp.Charts.Models.Common.Plugins;
|
||||
|
||||
public class ChartPluginsDataLabels
|
||||
{
|
||||
public DataLabelsAlignment Align { get; set; } = DataLabelsAlignment.Center;
|
||||
public DataLabelsAnchoring Anchor { get; set; } = DataLabelsAnchoring.Center;
|
||||
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? BackgroundColor { get; set; }
|
||||
public string BorderColor { get; set; } = "white";
|
||||
public double BorderRadius { get; set; } = 25;
|
||||
public double BorderWidth { get; set; } = 2;
|
||||
public bool Clamp { get; set; } = false;
|
||||
public bool Clip { get; set; } = false;
|
||||
public string Color { get; set; } = "white";
|
||||
public bool Display { get; set; } = true;
|
||||
public ChartFont Font { get; set; } = new();
|
||||
public int Offset { get; set; } = 4;
|
||||
public double Opacity { get; set; } = 1;
|
||||
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public ChartPadding? Padding { get; set; }
|
||||
public int Rotation { get; set; }
|
||||
|
||||
public DataLabelsAlignment TextAlign { get; set; } = DataLabelsAlignment.Center;
|
||||
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? TextStrokeColor { get; set; }
|
||||
public int TextStrokeWidth { get; set; }
|
||||
public int TextShadowBlur { get; set; }
|
||||
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? TextShadowColor { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
using RobotNet.WebApp.Charts.Enums;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace RobotNet.WebApp.Charts.Models.Common.Plugins;
|
||||
|
||||
public class ChartPluginsLegend
|
||||
{
|
||||
/// <summary>
|
||||
/// Alignment of the legend. Default values is 'center'. Other possible values 'start' and 'end'.
|
||||
/// </summary>
|
||||
public LegendAlignment Align { get; set; } = LegendAlignment.Center;
|
||||
|
||||
/// <summary>
|
||||
/// Is the legend shown? Default value is 'true'.
|
||||
/// </summary>
|
||||
public bool Display { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// If <see langword="true" />, Marks that this box should take the full width/height of the canvas (moving other boxes). This is unlikely to need to be changed in day-to-day use.
|
||||
/// </summary>
|
||||
public bool FullSize { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Label settings for the legend.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public ChartPluginsLegendLabels? Labels { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Maximum height of the legend, in pixels.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? MaxHeight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Maximum width of the legend, in pixels.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? MaxWidth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Position of the legend. Default value is 'top'. Other possible value is 'bottom'.
|
||||
/// </summary>
|
||||
public LegendPosition Position { get; set; } = LegendPosition.Top;
|
||||
|
||||
/// <summary>
|
||||
/// If <see langword="true" />, the Legend will show datasets in reverse order.
|
||||
/// </summary>
|
||||
public bool Reverse { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// If <see langword="true" />, for rendering of the legends will go from right to left.
|
||||
/// </summary>
|
||||
public bool Rtl { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// This will force the text direction 'rtl' or 'ltr' on the canvas for rendering the legend, regardless of the css specified on the canvas
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? TextDirection { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Title object
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public ChartPluginsLegendTitle? Title { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
using RobotNet.WebApp.Charts.Enums;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace RobotNet.WebApp.Charts.Models.Common.Plugins;
|
||||
|
||||
public class ChartPluginsLegendLabels
|
||||
{
|
||||
/// <summary>
|
||||
/// Width of coloured box.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? BoxWidth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Height of the coloured box
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? BoxHeight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Override the borderRadius to use.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? BorderRadius { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Color of label and the strikethrough.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? Color { get; set; }
|
||||
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public ChartFont? Font { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Padding between rows of colored boxes.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? Padding { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If specified, this style of point is used for the legend. Only used if <see cref="UsePointStyle"/>> is true.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public PointStyle? PointStyle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If <see cref="UsePointStyle"/> is <see langword="true" />, the width of the point style used for the legend.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? PointStyleWidth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Label borderRadius will match corresponding <see cref="BorderRadius"/>.
|
||||
/// </summary>
|
||||
public bool UseBorderRadius { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// If <see langword="true"/>, Label style will match corresponding point style (size is based on pointStyleWidth or the minimum value between <see cref="BoxWidth"/> and <see cref="Font"/> -> Size).
|
||||
/// </summary>
|
||||
public bool UsePointStyle { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Horizontal alignment of the label text
|
||||
/// </summary>
|
||||
public LegendAlignment TextAlign { get; set; } = LegendAlignment.Center;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace RobotNet.WebApp.Charts.Models.Common.Plugins;
|
||||
|
||||
public class ChartPluginsLegendTitle
|
||||
{
|
||||
/// <summary>
|
||||
/// Color of the legend. Default value is 'black'.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? Color { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Is the legend title displayed.
|
||||
/// </summary>
|
||||
public bool Display { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Padding around the title.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public ChartPadding? Padding { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The string title
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? Text { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Font Legend Title
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public ChartFont? Font { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using RobotNet.WebApp.Charts.Enums;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace RobotNet.WebApp.Charts.Models.Common.Plugins;
|
||||
|
||||
public class ChartPluginsSubtitle
|
||||
{
|
||||
/// <summary>
|
||||
/// Alignment of the title.
|
||||
/// Options are: 'start', 'center', and 'end'
|
||||
/// </summary>
|
||||
public TitleAlignment Align { get; set; } = TitleAlignment.Center;
|
||||
/// <summary>
|
||||
/// Color of text.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? Color { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Is the title shown?
|
||||
/// </summary>
|
||||
public bool Display { get; set; } = true;
|
||||
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public ChartFont? Font { get; set; }
|
||||
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? Text { get; set; }
|
||||
|
||||
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; }
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using RobotNet.WebApp.Charts.Enums;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace RobotNet.WebApp.Charts.Models.Common.Plugins;
|
||||
|
||||
public class ChartPluginsTitle
|
||||
{
|
||||
/// <summary>
|
||||
/// Alignment of the title.
|
||||
/// Options are: 'start', 'center', and 'end'
|
||||
/// </summary>
|
||||
public TitleAlignment Align { get; set; } = TitleAlignment.Center;
|
||||
/// <summary>
|
||||
/// Color of text.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? Color { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Is the title shown?
|
||||
/// </summary>
|
||||
public bool Display { get; set; } = true;
|
||||
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public ChartFont? Font { get; set; }
|
||||
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? Text { get; set; }
|
||||
|
||||
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; }
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
using RobotNet.WebApp.Charts.Enums;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace RobotNet.WebApp.Charts.Models.Common.Plugins;
|
||||
|
||||
public class ChartPluginsTooltip
|
||||
{
|
||||
/// <summary>
|
||||
/// Background color of the tooltip.
|
||||
/// </summary>
|
||||
public string BackgroundColor { get; set; } = "rgba(0, 0, 0, 0.8)";
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets which elements appear in the tooltip.
|
||||
/// </summary>
|
||||
public InteractionMode Mode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the value indicating if the hover mode only applies when the mouse position intersects an item on the chart.
|
||||
/// </summary>
|
||||
public bool? Intersect { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The mode for positioning the tooltip.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public TooltipPosition? Position { get; set; } = TooltipPosition.Average;
|
||||
|
||||
/// <summary>
|
||||
/// Horizontal alignment of the body text lines. left/right/center.
|
||||
/// </summary>
|
||||
public TooltipXAlignment BodyAlign { get; set; } = TooltipXAlignment.Left;
|
||||
|
||||
/// <summary>
|
||||
/// Color of body text.
|
||||
/// </summary>
|
||||
public string BodyColor { get; set; } = "#fff";
|
||||
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public ChartFont? BodyFont { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Spacing to add to top and bottom of each tooltip item.
|
||||
/// </summary>
|
||||
public int BodySpacing { get; set; } = 2;
|
||||
|
||||
/// <summary>
|
||||
/// Padding for Tooltips
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public ChartPadding? Padding { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Extra distance to move the end of the tooltip arrow away from the tooltip point.
|
||||
/// </summary>
|
||||
public int CaretPadding { get; set; } = 2;
|
||||
|
||||
/// <summary>
|
||||
/// Size, in px, of the tooltip arrow.
|
||||
/// </summary>
|
||||
public int CaretSize { get; set; } = 5;
|
||||
|
||||
/// <summary>
|
||||
/// If <see langword="true" />, color boxes are shown in the tooltip.
|
||||
/// </summary>
|
||||
public bool DisplayColors { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Are on-canvas tooltips enabled?
|
||||
/// </summary>
|
||||
public bool Enabled { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Horizontal alignment of the footer text lines. left/right/center.
|
||||
/// </summary>
|
||||
public TooltipXAlignment FooterAlign { get; set; } = TooltipXAlignment.Left;
|
||||
|
||||
/// <summary>
|
||||
/// Color of footer text.
|
||||
/// </summary>
|
||||
public string FooterColor { get; set; } = "#fff";
|
||||
|
||||
public ChartFont FooterFont { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Margin to add before drawing the footer.
|
||||
/// </summary>
|
||||
public int FooterMarginTop { get; set; } = 6;
|
||||
|
||||
/// <summary>
|
||||
/// Spacing to add to top and bottom of each footer line.
|
||||
/// </summary>
|
||||
public int FooterSpacing { get; set; } = 2;
|
||||
|
||||
/// <summary>
|
||||
/// Horizontal alignment of the title text lines. left/right/center.
|
||||
/// </summary>
|
||||
public TooltipXAlignment TitleAlign { get; set; } = TooltipXAlignment.Left;
|
||||
|
||||
/// <summary>
|
||||
/// Color of title text.
|
||||
/// </summary>
|
||||
public string TitleColor { get; set; } = "#fff";
|
||||
|
||||
public ChartFont TitleFont { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Margin to add on bottom of title section.
|
||||
/// </summary>
|
||||
public int TitleMarginBottom { get; set; } = 6;
|
||||
|
||||
/// <summary>
|
||||
/// Spacing to add to top and bottom of each title line.
|
||||
/// </summary>
|
||||
public int TitleSpacing { get; set; } = 2;
|
||||
|
||||
/// <summary>
|
||||
/// Position of the tooltip caret in the X direction. left/center/right.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public TooltipXAlignment? XAlign { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Position of the tooltip caret in the Y direction. top/center/bottom.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public TooltipYAlignment? YAlign { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Width of the color box if displayColors is true.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? BoxWidth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Height of the color box if displayColors is true.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? BoxHeight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Padding between the color box and the text.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? BoxPadding { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Size of the border.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? BorderWidth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Color of the border.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? BorderColor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Use the corresponding point style (from dataset options) instead of color boxes, ex: star, triangle etc. (size is based on the minimum value between boxWidth and boxHeight).
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public bool? UsePointStyle { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// true for rendering the tooltip from right to left.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public bool? Rtl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// This will force the text direction 'rtl' or 'ltr' on the canvas for rendering the tooltips, regardless of the css specified on the canvas
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? TextDirection { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user