diff --git a/ChartJs.Blazor/ChartJS/BarChart/BarConfig.cs b/ChartJs.Blazor/ChartJS/BarChart/BarConfig.cs index d062548..1c04673 100644 --- a/ChartJs.Blazor/ChartJS/BarChart/BarConfig.cs +++ b/ChartJs.Blazor/ChartJS/BarChart/BarConfig.cs @@ -9,6 +9,6 @@ namespace ChartJs.Blazor.ChartJS.BarChart /// public class BarConfig : ConfigBase { - public BarConfig(ChartTypes type = null) : base(type ?? ChartTypes.Bar) { } + public BarConfig(ChartType type = null) : base(type ?? ChartType.Bar) { } } } \ No newline at end of file diff --git a/ChartJs.Blazor/ChartJS/BarChart/Dataset/BaseBarDataset.cs b/ChartJs.Blazor/ChartJS/BarChart/Dataset/BaseBarDataset.cs index 8fe5e51..5d39f55 100644 --- a/ChartJs.Blazor/ChartJS/BarChart/Dataset/BaseBarDataset.cs +++ b/ChartJs.Blazor/ChartJS/BarChart/Dataset/BaseBarDataset.cs @@ -20,7 +20,7 @@ public BaseBarDataset(IEnumerable data) : this() public BaseBarDataset() { } - public override ChartTypes Type => ChartTypes.Bar; + public override ChartType Type => ChartType.Bar; /// /// The label for the dataset which appears in the legend and tooltips. @@ -42,7 +42,7 @@ public BaseBarDataset() { } /// /// Which edge to skip drawing the border for. /// - public Positions BorderSkipped { get; set; } + public Position BorderSkipped { get; set; } /// /// The ID of the group to which this dataset belongs to (when stacked, each group will be a separate stack) diff --git a/ChartJs.Blazor/ChartJS/BubbleChart/BubbleConfig.cs b/ChartJs.Blazor/ChartJS/BubbleChart/BubbleConfig.cs index e5bdc05..d050a5b 100644 --- a/ChartJs.Blazor/ChartJS/BubbleChart/BubbleConfig.cs +++ b/ChartJs.Blazor/ChartJS/BubbleChart/BubbleConfig.cs @@ -5,6 +5,6 @@ namespace ChartJs.Blazor.ChartJS.BubbleChart { public class BubbleConfig : ConfigBase { - public BubbleConfig() : base(ChartTypes.Bubble) { } + public BubbleConfig() : base(ChartType.Bubble) { } } } \ No newline at end of file diff --git a/ChartJs.Blazor/ChartJS/BubbleChart/BubbleDataset.cs b/ChartJs.Blazor/ChartJS/BubbleChart/BubbleDataset.cs index bd1aa06..b33665c 100644 --- a/ChartJs.Blazor/ChartJS/BubbleChart/BubbleDataset.cs +++ b/ChartJs.Blazor/ChartJS/BubbleChart/BubbleDataset.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using ChartJs.Blazor.ChartJS.Common; using ChartJs.Blazor.ChartJS.Common.Enums; using ChartJs.Blazor.Util; @@ -25,13 +26,13 @@ public class BubbleDataset public List Data { get; set; } = new List { new BubbleDataPoint { X = 1, Y = 2, r = 3 } }; - /// - /// See for working with colors. + /// + /// See for working with colors. /// public string HoverBackgroundColor { get; set; } - /// - /// See for working with colors. + /// + /// See for working with colors. /// public string HoverBorderColor { get; set; } @@ -46,12 +47,15 @@ public class BubbleDataset /// public string Label { get; set; } - public string PointStyle { get; set; } = BubblePointStyle.circle.ToString(); + /// + /// Gets or sets the point style. + /// + public IndexableOption PointStyle { get; set; } public int Rotation { get; set; } = 0; public int Radius { get; set; } = 3; - public ChartTypes Type { get; } = ChartTypes.Bubble; + public ChartType Type { get; } = ChartType.Bubble; } } \ No newline at end of file diff --git a/ChartJs.Blazor/ChartJS/BubbleChart/BubblePointStyle.cs b/ChartJs.Blazor/ChartJS/BubbleChart/BubblePointStyle.cs deleted file mode 100644 index 2f39614..0000000 --- a/ChartJs.Blazor/ChartJS/BubbleChart/BubblePointStyle.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace ChartJs.Blazor.ChartJS.BubbleChart -{ - public enum BubblePointStyle - { - circle, - cross, - crossRot, - dash, - line, - rect, - rectRounded, - rectRot, - star, - triangle - } -} \ No newline at end of file diff --git a/ChartJs.Blazor/ChartJS/Common/ConfigBase.cs b/ChartJs.Blazor/ChartJS/Common/ConfigBase.cs index 851b26f..88ac585 100644 --- a/ChartJs.Blazor/ChartJS/Common/ConfigBase.cs +++ b/ChartJs.Blazor/ChartJS/Common/ConfigBase.cs @@ -13,7 +13,7 @@ public abstract class ConfigBase /// Creates a new instance of /// /// The chartType this config is for - protected ConfigBase(ChartTypes chartType) + protected ConfigBase(ChartType chartType) { Type = chartType; } @@ -21,7 +21,7 @@ protected ConfigBase(ChartTypes chartType) /// /// Defines what type of chart this config is for /// - public ChartTypes Type { get; } + public ChartType Type { get; } /// /// The id for the html canvas element associated with this chart @@ -42,7 +42,7 @@ public abstract class ConfigBase : ConfigBase /// Creates a new instance of /// /// The chartType this config is for - protected ConfigBase(ChartTypes chartType) : base(chartType) + protected ConfigBase(ChartType chartType) : base(chartType) { Data = new TData(); } diff --git a/ChartJs.Blazor/ChartJS/Common/Enums/AxisDisplay.cs b/ChartJs.Blazor/ChartJS/Common/Enums/AxisDisplay.cs index f49e612..d18a52d 100644 --- a/ChartJs.Blazor/ChartJS/Common/Enums/AxisDisplay.cs +++ b/ChartJs.Blazor/ChartJS/Common/Enums/AxisDisplay.cs @@ -4,7 +4,7 @@ namespace ChartJs.Blazor.ChartJS.Common.Enums /// /// As per documentation here https://www.chartjs.org/docs/latest/axes/#common-configuration /// - public class AxisDisplay: ObjectEnum + public sealed class AxisDisplay : ObjectEnum { /// /// Hidden diff --git a/ChartJs.Blazor/ChartJS/Common/Enums/AxisType.cs b/ChartJs.Blazor/ChartJS/Common/Enums/AxisType.cs index 938f6ff..c2216be 100644 --- a/ChartJs.Blazor/ChartJS/Common/Enums/AxisType.cs +++ b/ChartJs.Blazor/ChartJS/Common/Enums/AxisType.cs @@ -3,7 +3,6 @@ /// /// As per documentation here https://www.chartjs.org/docs/latest/axes/cartesian/ /// - /// public sealed class AxisType : StringEnum { /// @@ -28,7 +27,7 @@ public sealed class AxisType : StringEnum /// If only data.labels is defined, this will be used. If data.xLabels is defined and the axis is horizontal, this will be used. /// Similarly, if data.yLabels is defined and the axis is vertical, this property will be used. /// Using both xLabels and yLabels together can create a chart that uses strings for both the X and Y axes. - /// Specifying any of the settings above defines the x axis as type: 'category' if not defined otherwise. + /// Specifying any of the settings above defines the x axis as type: if not defined otherwise. /// For more fine-grained control of category labels it is also possible to add labels as part of the category axis definition. /// Doing so does not apply the global defaults. /// See https://www.chartjs.org/docs/latest/axes/cartesian/category.html diff --git a/ChartJs.Blazor/ChartJS/Common/Enums/BorderAlign.cs b/ChartJs.Blazor/ChartJS/Common/Enums/BorderAlign.cs new file mode 100644 index 0000000..0fab106 --- /dev/null +++ b/ChartJs.Blazor/ChartJS/Common/Enums/BorderAlign.cs @@ -0,0 +1,25 @@ +namespace ChartJs.Blazor.ChartJS.Common.Enums +{ + /// + /// Specifies the border alignment of a and a . + /// As per documentation here https://www.chartjs.org/docs/latest/charts/doughnut.html#border-alignment + /// + public sealed class BorderAlign : StringEnum + { + /// + /// When is set, the borders of arcs next to each other will overlap. The default value. + /// + public static BorderAlign Center => new BorderAlign("center"); + + /// + /// When is set, it is guaranteed that all the borders will not overlap. + /// + public static BorderAlign Inner => new BorderAlign("inner"); + + /// + /// Creates a new instance of the class. + /// + /// The value to set. + private BorderAlign(string stringValue) : base(stringValue) { } + } +} diff --git a/ChartJs.Blazor/ChartJS/Common/Enums/BorderCapStyle.cs b/ChartJs.Blazor/ChartJS/Common/Enums/BorderCapStyle.cs new file mode 100644 index 0000000..7a11704 --- /dev/null +++ b/ChartJs.Blazor/ChartJS/Common/Enums/BorderCapStyle.cs @@ -0,0 +1,30 @@ +namespace ChartJs.Blazor.ChartJS.Common.Enums +{ + /// + /// Specifies the border cap style. + /// As per documentation here https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineCap + /// + public sealed class BorderCapStyle : StringEnum + { + /// + /// The ends of lines are squared off at the endpoints. + /// + public static BorderCapStyle Butt => new BorderCapStyle("butt"); + + /// + /// The ends of lines are rounded. + /// + public static BorderCapStyle Round => new BorderCapStyle("round"); + + /// + /// The ends of lines are squared off by adding a box with an equal width and half the height of the line's thickness. + /// + public static BorderCapStyle Square => new BorderCapStyle("square"); + + /// + /// Creates a new instance of the class. + /// + /// The value to set. + private BorderCapStyle(string stringValue) : base(stringValue) { } + } +} diff --git a/ChartJs.Blazor/ChartJS/Common/Enums/BorderJoinStyle.cs b/ChartJs.Blazor/ChartJS/Common/Enums/BorderJoinStyle.cs new file mode 100644 index 0000000..9b73956 --- /dev/null +++ b/ChartJs.Blazor/ChartJS/Common/Enums/BorderJoinStyle.cs @@ -0,0 +1,30 @@ +namespace ChartJs.Blazor.ChartJS.Common.Enums +{ + /// + /// Specifies the border join style. + /// As per documentation here https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin + /// + public sealed class BorderJoinStyle : StringEnum + { + /// + /// Fills an additional triangular area between the common endpoint of connected segments, and the separate outside rectangular corners of each segment. + /// + public static BorderJoinStyle Bevel => new BorderJoinStyle("bevel"); + + /// + /// Rounds off the corners of a shape by filling an additional sector of disc centered at the common endpoint of connected segments. The radius for these rounded corners is equal to the line width. + /// + public static BorderJoinStyle Round => new BorderJoinStyle("round"); + + /// + /// Connected segments are joined by extending their outside edges to connect at a single point, with the effect of filling an additional lozenge-shaped area. + /// + public static BorderJoinStyle Miter => new BorderJoinStyle("miter"); + + /// + /// Creates a new instance of the class. + /// + /// The value to set. + private BorderJoinStyle(string stringValue) : base(stringValue) { } + } +} diff --git a/ChartJs.Blazor/ChartJS/Common/Enums/ChartType.cs b/ChartJs.Blazor/ChartJS/Common/Enums/ChartType.cs new file mode 100644 index 0000000..58b4927 --- /dev/null +++ b/ChartJs.Blazor/ChartJS/Common/Enums/ChartType.cs @@ -0,0 +1,59 @@ +namespace ChartJs.Blazor.ChartJS.Common.Enums +{ + /// + /// Defines the chart types. + /// + public sealed class ChartType : StringEnum + { + /// + /// The bar chart type. + /// + public static ChartType Bar => new ChartType("bar"); + + /// + /// The horizontal bar chart type. + /// + public static ChartType HorizontalBar => new ChartType("horizontalBar"); + + /// + /// The line chart type. + /// + public static ChartType Line => new ChartType("line"); + + /// + /// The pie chart type. + /// + public static ChartType Pie => new ChartType("pie"); + + /// + /// The doughnut chart type. + /// + public static ChartType Doughnut => new ChartType("doughnut"); + + /// + /// The radar chart type. + /// + public static ChartType Radar => new ChartType("radar"); + + /// + /// The bubble chart type. + /// + public static ChartType Bubble => new ChartType("bubble"); + + /// + /// The polar area chart type. + /// + public static ChartType PolarArea => new ChartType("polarArea"); + + /// + /// The scatter chart type. + /// + public static ChartType Scatter => new ChartType("scatter"); + + /// + /// Creates a new instance of the class. + /// + /// The value to set. + private ChartType(string stringValue) : base(stringValue) { } + } +} diff --git a/ChartJs.Blazor/ChartJS/Common/Enums/ChartTypes.cs b/ChartJs.Blazor/ChartJS/Common/Enums/ChartTypes.cs deleted file mode 100644 index 7885e98..0000000 --- a/ChartJs.Blazor/ChartJS/Common/Enums/ChartTypes.cs +++ /dev/null @@ -1,22 +0,0 @@ -namespace ChartJs.Blazor.ChartJS.Common.Enums -{ - /// - /// Defines the type of a chart - /// - public sealed class ChartTypes : StringEnum - { -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - public static ChartTypes Bar => new ChartTypes("bar"); - public static ChartTypes HorizontalBar => new ChartTypes("horizontalBar"); - public static ChartTypes Line => new ChartTypes("line"); - public static ChartTypes Pie => new ChartTypes("pie"); - public static ChartTypes Doughnut => new ChartTypes("doughnut"); - public static ChartTypes Radar => new ChartTypes("radar"); - public static ChartTypes Bubble => new ChartTypes("bubble"); - public static ChartTypes PolarArea => new ChartTypes("polarArea"); - public static ChartTypes Scatter => new ChartTypes("scatter"); -#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member - - private ChartTypes(string stringRep) : base(stringRep) { } - } -} \ No newline at end of file diff --git a/ChartJs.Blazor/ChartJS/Common/Enums/CubicInterpolationMode.cs b/ChartJs.Blazor/ChartJS/Common/Enums/CubicInterpolationMode.cs new file mode 100644 index 0000000..94cb42e --- /dev/null +++ b/ChartJs.Blazor/ChartJS/Common/Enums/CubicInterpolationMode.cs @@ -0,0 +1,28 @@ +namespace ChartJs.Blazor.ChartJS.Common.Enums +{ + /// + /// Specifies the cubic interpolation mode. + /// As per documentation here https://www.chartjs.org/docs/latest/charts/line.html#cubicinterpolationmode + /// + public sealed class CubicInterpolationMode : StringEnum + { + /// + /// The default cubic interpolation mode. + /// The algorithm uses a custom weighted cubic interpolation, which produces pleasant curves for all types of datasets. + /// + public static CubicInterpolationMode Default => new CubicInterpolationMode("default"); + + /// + /// The monotone cubic interpolation mode. + /// The algorithm is more suited to y = f(x) datasets: + /// It preserves monotonicity (or piecewise monotonicity) of the dataset being interpolated, and ensures local extrema (if any) stay at input data points. + /// + public static CubicInterpolationMode Monotone => new CubicInterpolationMode("monotone"); + + /// + /// Creates a new instance of the class. + /// + /// The value to set. + private CubicInterpolationMode(string stringValue) : base(stringValue) { } + } +} diff --git a/ChartJs.Blazor/ChartJS/Common/Enums/FontStyle.cs b/ChartJs.Blazor/ChartJS/Common/Enums/FontStyle.cs new file mode 100644 index 0000000..b27b30b --- /dev/null +++ b/ChartJs.Blazor/ChartJS/Common/Enums/FontStyle.cs @@ -0,0 +1,40 @@ +namespace ChartJs.Blazor.ChartJS.Common.Enums +{ + /// + /// Specifies the css font style of text. + /// As per documentation here https://developer.mozilla.org/en-US/docs/Web/CSS/font-style + /// + public sealed class FontStyle : StringEnum + { + /// + /// Specifies a font that is classified as normal within a font-family. + /// + public static FontStyle Normal => new FontStyle("normal"); + + /// + /// Specifies a font that is classified as italic. If no italic version of the face is available, one classified as oblique is used instead. If neither is available, the style is artificially simulated. + /// + public static FontStyle Italic => new FontStyle("italic"); + + /// + /// Specifies a font that is classified as oblique. If no oblique version of the face is available, one classified as italic is used instead. If neither is available, the style is artificially simulated. + /// + public static FontStyle Oblique => new FontStyle("oblique"); + + /// + /// Specifies a font with its font style set to its default value. + /// + public static FontStyle Initial => new FontStyle("initial"); + + /// + /// Specifies a font that inherits the font style from its parent element. + /// + public static FontStyle Inherit => new FontStyle("inherit"); + + /// + /// Creates a new instance of the class. + /// + /// The value to set. + private FontStyle(string stringValue) : base(stringValue) { } + } +} diff --git a/ChartJs.Blazor/ChartJS/Common/Enums/PointStyle.cs b/ChartJs.Blazor/ChartJS/Common/Enums/PointStyle.cs new file mode 100644 index 0000000..45010fa --- /dev/null +++ b/ChartJs.Blazor/ChartJS/Common/Enums/PointStyle.cs @@ -0,0 +1,70 @@ + +namespace ChartJs.Blazor.ChartJS.Common.Enums +{ + /// + /// Specifies how a data-point on the chart will be styled. + /// As per documentation here https://www.chartjs.org/docs/latest/configuration/elements.html#point-styles + /// Some samples showcasing the different styles can be found here https://www.chartjs.org/samples/latest/charts/line/point-styles.html + /// + public sealed class PointStyle : StringEnum + { + /// + /// The circle point style. + /// + public static PointStyle Circle => new PointStyle("circle"); + + /// + /// The cross point style. + /// + public static PointStyle Cross => new PointStyle("cross"); + + /// + /// The rotated (45°) cross point style. + /// + public static PointStyle CrossRot => new PointStyle("crossRot"); + + /// + /// The dash point style. + /// Unlike , this style only displayes a dash on the right side of the point. + /// + public static PointStyle Dash => new PointStyle("dash"); + + /// + /// The line point style. + /// Unlike , this style displayes a dash on both the right and the left side of the point. + /// + public static PointStyle Line => new PointStyle("line"); + + /// + /// The rectangle point style. + /// + public static PointStyle Rect => new PointStyle("rect"); + + /// + /// The rounded rectangle point style. + /// + public static PointStyle RectRounded => new PointStyle("rectRounded"); + + /// + /// The rotated (45°) rectangle point style. + /// + public static PointStyle RectRot => new PointStyle("rectRot"); + + /// + /// The star point style. + /// Same as and overlapping. + /// + public static PointStyle Star => new PointStyle("star"); + + /// + /// The triangle point style. + /// + public static PointStyle Triangle => new PointStyle("triangle"); + + /// + /// Creates a new instance of the class. + /// + /// The value to set. + private PointStyle(string stringValue) : base(stringValue) { } + } +} \ No newline at end of file diff --git a/ChartJs.Blazor/ChartJS/Common/Enums/Position.cs b/ChartJs.Blazor/ChartJS/Common/Enums/Position.cs new file mode 100644 index 0000000..d891546 --- /dev/null +++ b/ChartJs.Blazor/ChartJS/Common/Enums/Position.cs @@ -0,0 +1,17 @@ +namespace ChartJs.Blazor.ChartJS.Common.Enums +{ + /// + /// Represents a relative direction or position on a 2D canvas. + /// + public sealed class Position : StringEnum + { +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + public static Position Left => new Position("left"); + public static Position Right => new Position("right"); + public static Position Top => new Position("top"); + public static Position Bottom => new Position("bottom"); +#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member + + private Position(string stringRep) : base(stringRep) { } + } +} \ No newline at end of file diff --git a/ChartJs.Blazor/ChartJS/Common/Enums/Positions.cs b/ChartJs.Blazor/ChartJS/Common/Enums/Positions.cs deleted file mode 100644 index 24e7df9..0000000 --- a/ChartJs.Blazor/ChartJS/Common/Enums/Positions.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace ChartJs.Blazor.ChartJS.Common.Enums -{ - /// - /// Represents a relative direction or position on a 2D canvas - /// - public sealed class Positions : StringEnum - { -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - public static Positions Left => new Positions("left"); - public static Positions Right => new Positions("right"); - public static Positions Top => new Positions("top"); - public static Positions Bottom => new Positions("bottom"); -#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member - - private Positions(string stringRep) : base(stringRep) { } - } -} \ No newline at end of file diff --git a/ChartJs.Blazor/ChartJS/Common/Enums/ScaleBound.cs b/ChartJs.Blazor/ChartJS/Common/Enums/ScaleBound.cs new file mode 100644 index 0000000..20fec76 --- /dev/null +++ b/ChartJs.Blazor/ChartJS/Common/Enums/ScaleBound.cs @@ -0,0 +1,21 @@ +namespace ChartJs.Blazor.ChartJS.Common.Enums +{ + /// + /// Specifies the scale boundary strategy. + /// As per documentation here https://www.chartjs.org/docs/latest/axes/cartesian/time.html#scale-bounds + /// + public sealed class ScaleBound : StringEnum + { + /// + /// Makes sure data are fully visible, labels outside are removed. + /// + public static ScaleBound Data => new ScaleBound("data"); + + /// + /// Makes sure ticks are fully visible, data outside are truncated. + /// + public static ScaleBound Ticks => new ScaleBound("ticks"); + + private ScaleBound(string stringRep) : base(stringRep) { } + } +} \ No newline at end of file diff --git a/ChartJs.Blazor/ChartJS/Common/Enums/ScaleBounds.cs b/ChartJs.Blazor/ChartJS/Common/Enums/ScaleBounds.cs deleted file mode 100644 index ff8a0f8..0000000 --- a/ChartJs.Blazor/ChartJS/Common/Enums/ScaleBounds.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace ChartJs.Blazor.ChartJS.Common.Enums -{ - /// - /// As per documentation here https://www.chartjs.org/docs/latest/axes/cartesian/time.html#scale-bounds - /// - /// - public sealed class ScaleBounds : StringEnum - { - /// - /// Makes sure data are fully visible, labels outside are removed - /// - public static ScaleBounds Data => new ScaleBounds("data"); - - /// - /// Makes sure ticks are fully visible, data outside are truncated - /// - public static ScaleBounds Ticks => new ScaleBounds("ticks"); - - private ScaleBounds(string stringRep) : base(stringRep) { } - } -} \ No newline at end of file diff --git a/ChartJs.Blazor/ChartJS/Common/Enums/SteppedLine.cs b/ChartJs.Blazor/ChartJS/Common/Enums/SteppedLine.cs index 3b166c6..bc3613d 100644 --- a/ChartJs.Blazor/ChartJS/Common/Enums/SteppedLine.cs +++ b/ChartJs.Blazor/ChartJS/Common/Enums/SteppedLine.cs @@ -4,7 +4,7 @@ namespace ChartJs.Blazor.ChartJS.Common.Enums /// /// As per documentation here https://www.chartjs.org/docs/latest/charts/line.html#stepped-line /// - public class SteppedLine : ObjectEnum + public sealed class SteppedLine : ObjectEnum { /// /// No Step Interpolation (default) diff --git a/ChartJs.Blazor/ChartJS/Common/Legends/Labels.cs b/ChartJs.Blazor/ChartJS/Common/Legends/Labels.cs index d3b161a..2f0f0c9 100644 --- a/ChartJs.Blazor/ChartJS/Common/Legends/Labels.cs +++ b/ChartJs.Blazor/ChartJS/Common/Legends/Labels.cs @@ -1,4 +1,5 @@ using ChartJs.Blazor.Util; +using ChartJs.Blazor.ChartJS.Common.Enums; namespace ChartJs.Blazor.ChartJS.Common.Legends { @@ -17,13 +18,10 @@ public class LegendLabelConfiguration /// public int FontSize { get; set; } = 12; - // TODO: implement with enum (normal, italic, oblique, initial, inherit) /// - /// Font style of text. - /// - /// Supported fonts: http://www.chartjs.org/docs/latest/configuration/legend.html#legend-label-configuration + /// Gets or sets the font style for the labels text. /// - public string FontStyle { get; set; } + public FontStyle FontStyle { get; set; } /// /// Color of text. diff --git a/ChartJs.Blazor/ChartJS/Common/Legends/Legend.cs b/ChartJs.Blazor/ChartJS/Common/Legends/Legend.cs index 2a38def..3cffae6 100644 --- a/ChartJs.Blazor/ChartJS/Common/Legends/Legend.cs +++ b/ChartJs.Blazor/ChartJS/Common/Legends/Legend.cs @@ -18,7 +18,7 @@ public class Legend /// /// Position of the legend /// - public Positions Position { get; set; } = Positions.Top; + public Position Position { get; set; } = Position.Top; /// /// Marks that this box should take the full width of the canvas (pushing down other boxes). This is unlikely to need to be changed in day-to-day use. diff --git a/ChartJs.Blazor/ChartJS/Common/SubTicks.cs b/ChartJs.Blazor/ChartJS/Common/SubTicks.cs index 99600fc..7bb360c 100644 --- a/ChartJs.Blazor/ChartJS/Common/SubTicks.cs +++ b/ChartJs.Blazor/ChartJS/Common/SubTicks.cs @@ -1,4 +1,5 @@ using ChartJs.Blazor.Util; +using ChartJs.Blazor.ChartJS.Common.Enums; namespace ChartJs.Blazor.ChartJS.Common { @@ -14,7 +15,7 @@ public abstract class SubTicks public string FontColor { get; set; } /// - /// Gets or sets the font family for a tick's label, follows CSS font-family options. + /// Gets or sets the font family for a tick's label. /// public string FontFamily { get; set; } @@ -24,9 +25,9 @@ public abstract class SubTicks public int FontSize { get; set; } = 12; /// - /// Gets or sets the font style for a tick's label, follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit). + /// Gets or sets the font style for a tick's label. /// - public string FontStyle { get; set; } + public FontStyle FontStyle { get; set; } /// /// Gets or sets the height of an individual line of text. diff --git a/ChartJs.Blazor/ChartJS/Common/Ticks.cs b/ChartJs.Blazor/ChartJS/Common/Ticks.cs index d9e7e19..f954480 100644 --- a/ChartJs.Blazor/ChartJS/Common/Ticks.cs +++ b/ChartJs.Blazor/ChartJS/Common/Ticks.cs @@ -1,4 +1,5 @@ using ChartJs.Blazor.Util; +using ChartJs.Blazor.ChartJS.Common.Enums; namespace ChartJs.Blazor.ChartJS.Common { @@ -20,7 +21,7 @@ public abstract class Ticks public string FontColor { get; set; } /// - /// Gets or sets the font family for the labels, follows CSS font-family options. + /// Gets or sets the font family for the labels. /// public string FontFamily { get; set; } @@ -30,9 +31,9 @@ public abstract class Ticks public int FontSize { get; set; } = 12; /// - /// Gets or sets the font style for the labels, follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit). + /// Gets or sets the font style for the labels. /// - public string FontStyle { get; set; } + public FontStyle FontStyle { get; set; } /// /// Gets or sets the height of an individual line of text. diff --git a/ChartJs.Blazor/ChartJS/LineChart/Axes/CartesianAxis.cs b/ChartJs.Blazor/ChartJS/LineChart/Axes/CartesianAxis.cs index 74b75c6..655dbc8 100644 --- a/ChartJs.Blazor/ChartJS/LineChart/Axes/CartesianAxis.cs +++ b/ChartJs.Blazor/ChartJS/LineChart/Axes/CartesianAxis.cs @@ -25,7 +25,7 @@ public abstract class CartesianAxis : Axis /// /// Position of the axis in the chart /// - public Positions Position { get; set; } + public Position Position { get; set; } /// /// If true, extra space is added to the both edges and the axis is scaled to fit into the chart area. diff --git a/ChartJs.Blazor/ChartJS/LineChart/Axes/TimeAxis.cs b/ChartJs.Blazor/ChartJS/LineChart/Axes/TimeAxis.cs index 999df3f..bb1c53d 100644 --- a/ChartJs.Blazor/ChartJS/LineChart/Axes/TimeAxis.cs +++ b/ChartJs.Blazor/ChartJS/LineChart/Axes/TimeAxis.cs @@ -24,7 +24,7 @@ public class TimeAxis : CartesianAxis /// /// The bounds property controls the scale boundary strategy (bypassed by min/max time options). /// - public ScaleBounds Bounds { get; set; } + public ScaleBound Bounds { get; set; } /// /// Configuration for time related stuff diff --git a/ChartJs.Blazor/ChartJS/LineChart/LineConfig.cs b/ChartJs.Blazor/ChartJS/LineChart/LineConfig.cs index 03e0839..0bc9e1c 100644 --- a/ChartJs.Blazor/ChartJS/LineChart/LineConfig.cs +++ b/ChartJs.Blazor/ChartJS/LineChart/LineConfig.cs @@ -11,6 +11,6 @@ public class LineConfig : ConfigBase /// /// Creates a new instance of /// - public LineConfig() : base(ChartTypes.Line) { } + public LineConfig() : base(ChartType.Line) { } } } \ No newline at end of file diff --git a/ChartJs.Blazor/ChartJS/LineChart/LineDataset.cs b/ChartJs.Blazor/ChartJS/LineChart/LineDataset.cs index 4d68fb9..9298dfc 100644 --- a/ChartJs.Blazor/ChartJS/LineChart/LineDataset.cs +++ b/ChartJs.Blazor/ChartJS/LineChart/LineDataset.cs @@ -27,7 +27,7 @@ public LineDataset() { } /// /// The type of chart this dataset is for. /// - public override ChartTypes Type => ChartTypes.Line; + public override ChartType Type => ChartType.Line; /// /// The label for the dataset which appears in the legend and tooltips. @@ -49,26 +49,20 @@ public LineDataset() { } /// public int BorderWidth { get; set; } = 1; - // TODO: Implement options /// - /// Cap style of the line. - /// See https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineCap for options. + /// Gets or sets the cap style of the line. /// - public string BorderCapStyle { get; set; } + public BorderCapStyle BorderCapStyle { get; set; } - // TODO: Implement options /// - /// Line joint style. - /// See https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin for options. + /// Gets or sets the line join style. /// - public string BorderJoinStyle { get; set; } + public BorderJoinStyle BorderJoinStyle { get; set; } - // TODO: Implement options /// - /// Algorithm used to interpolate a smooth curve from the discrete data points. - /// See https://www.chartjs.org/docs/latest/charts/line.html#cubicinterpolationmode for options. + /// Gets or sets the algorithm used to interpolate a smooth curve from the discrete data points. /// - public string CubicInterpolationMode { get; set; } + public CubicInterpolationMode CubicInterpolationMode { get; set; } /// /// Length and spacing of dashes. It's an int array. Whatever JS! diff --git a/ChartJs.Blazor/ChartJS/MixedChart/BaseMixableDataset.cs b/ChartJs.Blazor/ChartJS/MixedChart/BaseMixableDataset.cs index b1ea0ac..a40f6fa 100644 --- a/ChartJs.Blazor/ChartJS/MixedChart/BaseMixableDataset.cs +++ b/ChartJs.Blazor/ChartJS/MixedChart/BaseMixableDataset.cs @@ -13,7 +13,7 @@ public abstract class BaseMixableDataset : IMixableDataset /// /// The type of chart this dataset is for. /// - public abstract ChartTypes Type { get; } + public abstract ChartType Type { get; } private readonly List _data = new List(); diff --git a/ChartJs.Blazor/ChartJS/MixedChart/IMixableDataset.cs b/ChartJs.Blazor/ChartJS/MixedChart/IMixableDataset.cs index 2fce314..2d3b86e 100644 --- a/ChartJs.Blazor/ChartJS/MixedChart/IMixableDataset.cs +++ b/ChartJs.Blazor/ChartJS/MixedChart/IMixableDataset.cs @@ -12,7 +12,7 @@ public interface IMixableDataset /// /// The type of chart this dataset is for. /// - ChartTypes Type { get; } + ChartType Type { get; } /// /// The data contained in this dataset (readonly because covariant). diff --git a/ChartJs.Blazor/ChartJS/MixedChart/MixedConfig.cs b/ChartJs.Blazor/ChartJS/MixedChart/MixedConfig.cs index e2ef996..627536f 100644 --- a/ChartJs.Blazor/ChartJS/MixedChart/MixedConfig.cs +++ b/ChartJs.Blazor/ChartJS/MixedChart/MixedConfig.cs @@ -5,7 +5,7 @@ namespace ChartJs.Blazor.ChartJS.MixedChart { public class MixedConfig : ConfigBase> { - public MixedConfig() : base(ChartTypes.Bar) // This is not a mistake + public MixedConfig() : base(ChartType.Bar) // This is not a mistake { } } diff --git a/ChartJs.Blazor/ChartJS/PieChart/PieConfig.cs b/ChartJs.Blazor/ChartJS/PieChart/PieConfig.cs index 4325856..1f632f5 100644 --- a/ChartJs.Blazor/ChartJS/PieChart/PieConfig.cs +++ b/ChartJs.Blazor/ChartJS/PieChart/PieConfig.cs @@ -11,7 +11,7 @@ public class PieConfig : ConfigBase /// /// Creates a new instance of . /// - public PieConfig() : base(ChartTypes.Pie) + public PieConfig() : base(ChartType.Pie) { } } diff --git a/ChartJs.Blazor/ChartJS/PieChart/PieDataset.cs b/ChartJs.Blazor/ChartJS/PieChart/PieDataset.cs index 33c90df..40fe0d1 100644 --- a/ChartJs.Blazor/ChartJS/PieChart/PieDataset.cs +++ b/ChartJs.Blazor/ChartJS/PieChart/PieDataset.cs @@ -11,9 +11,9 @@ namespace ChartJs.Blazor.ChartJS.PieChart public class PieDataset { /// - /// Gets or sets the chart type. in this case. This is needed for mixed datasets only. + /// Gets or sets the chart type. in this case. This is needed for mixed datasets only. /// - public ChartTypes Type { get; } = ChartTypes.Pie; + public ChartType Type { get; } = ChartType.Pie; /// /// Gets or sets the fill color of the arcs in the dataset. @@ -22,12 +22,11 @@ public class PieDataset /// public IndexableOption BackgroundColor { get; set; } - // Todo: Make this an enum later?! /// - /// Gets or sets the border align. When 'center' is set, the borders of arcs next to each other will overlap. - /// When 'inner' is set, it is guaranteed that all the borders are not overlap. + /// Gets or sets the border align. When is set, the borders of arcs next to each other will overlap. + /// When is set, it is guaranteed that all the borders are not overlap. /// - public string BorderAlign { get; set; } = "center"; + public IndexableOption BorderAlign { get; set; } /// /// Gets or sets the border color of the arcs in the dataset. diff --git a/ChartJs.Blazor/ChartJS/PolarAreaChart/Axis/PointLabels.cs b/ChartJs.Blazor/ChartJS/PolarAreaChart/Axis/PointLabels.cs index 8983f66..3dbe855 100644 --- a/ChartJs.Blazor/ChartJS/PolarAreaChart/Axis/PointLabels.cs +++ b/ChartJs.Blazor/ChartJS/PolarAreaChart/Axis/PointLabels.cs @@ -1,4 +1,5 @@ using ChartJs.Blazor.ChartJS.Common; +using ChartJs.Blazor.ChartJS.Common.Enums; using ChartJs.Blazor.Util; namespace ChartJs.Blazor.ChartJS.PolarAreaChart.Axis @@ -23,7 +24,7 @@ public class PointLabels /// /// Gets or sets the font style to use when rendering a point label. /// - public string FontStyle { get; set; } + public FontStyle FontStyle { get; set; } /// /// Gets or sets the height of an individual line of text. diff --git a/ChartJs.Blazor/ChartJS/PolarAreaChart/PolarAreaConfig.cs b/ChartJs.Blazor/ChartJS/PolarAreaChart/PolarAreaConfig.cs index 8313871..8178fad 100644 --- a/ChartJs.Blazor/ChartJS/PolarAreaChart/PolarAreaConfig.cs +++ b/ChartJs.Blazor/ChartJS/PolarAreaChart/PolarAreaConfig.cs @@ -12,7 +12,7 @@ public class PolarAreaConfig : ConfigBase /// /// Creates a new instance of /// - public PolarAreaConfig() : base(ChartTypes.PolarArea) + public PolarAreaConfig() : base(ChartType.PolarArea) { } } diff --git a/ChartJs.Blazor/ChartJS/PolarAreaChart/PolarAreaDataset.cs b/ChartJs.Blazor/ChartJS/PolarAreaChart/PolarAreaDataset.cs index 2b287ef..24a8174 100644 --- a/ChartJs.Blazor/ChartJS/PolarAreaChart/PolarAreaDataset.cs +++ b/ChartJs.Blazor/ChartJS/PolarAreaChart/PolarAreaDataset.cs @@ -12,10 +12,10 @@ namespace ChartJs.Blazor.ChartJS.PolarAreaChart /// public class PolarAreaDataset { - /// - /// Gets the chart type. in this case. This is needed for mixed datasets only. + /// + /// Gets the chart type. in this case. This is needed for mixed datasets only. /// - public ChartTypes Type { get; } = ChartTypes.PolarArea; + public ChartType Type { get; } = ChartType.PolarArea; /// /// Gets or sets the fill color of the arcs in the dataset. @@ -23,12 +23,11 @@ public class PolarAreaDataset /// public IndexableOption BackgroundColor { get; set; } - // Todo: Make this an enum later?! /// - /// Gets or sets the border align. When 'center' is set, the borders of arcs next to each other will overlap. - /// When 'inner' is set, it is guaranteed that all the borders are not overlap. + /// Gets or sets the border align. When is set, the borders of arcs next to each other will overlap. + /// When is set, it is guaranteed that all the borders are not overlap. /// - public string BorderAlign { get; set; } + public IndexableOption BorderAlign { get; set; } /// /// Gets or sets the border color of the arcs in the dataset. @@ -58,8 +57,8 @@ public class PolarAreaDataset /// public IndexableOption HoverBorderWidth { get; set; } - /// - /// Gets the data in the dataset. + /// + /// Gets the data in the dataset. /// public List Data { get; } = new List(); } diff --git a/ChartJs.Blazor/ChartJS/RadarChart/RadarConfig.cs b/ChartJs.Blazor/ChartJS/RadarChart/RadarConfig.cs index cc0a849..3be876b 100644 --- a/ChartJs.Blazor/ChartJS/RadarChart/RadarConfig.cs +++ b/ChartJs.Blazor/ChartJS/RadarChart/RadarConfig.cs @@ -5,6 +5,6 @@ namespace ChartJs.Blazor.ChartJS.RadarChart { public class RadarConfig : ConfigBase { - public RadarConfig() : base(ChartTypes.Radar) { } + public RadarConfig() : base(ChartType.Radar) { } } } \ No newline at end of file diff --git a/ChartJs.Blazor/ChartJS/RadarChart/RadarDataset.cs b/ChartJs.Blazor/ChartJS/RadarChart/RadarDataset.cs index 03be712..13e8c3f 100644 --- a/ChartJs.Blazor/ChartJS/RadarChart/RadarDataset.cs +++ b/ChartJs.Blazor/ChartJS/RadarChart/RadarDataset.cs @@ -8,7 +8,7 @@ namespace ChartJs.Blazor.ChartJS.RadarChart { public class RadarDataset { - public ChartTypes Type { get; } = ChartTypes.Radar; + public ChartType Type { get; } = ChartType.Radar; /// /// The label for the dataset which appears in the legend and tooltips. @@ -38,14 +38,14 @@ public class RadarDataset public double BorderDashOffset { get; set; } /// - /// Cap style of the line + /// Gets or sets the cap style of the line. /// - public string BorderCapStyle { get; set; } + public BorderCapStyle BorderCapStyle { get; set; } /// - /// Line joint style + /// Gets or sets the line join style. /// - public string BorderJoinStyle { get; set; } + public BorderJoinStyle BorderJoinStyle { get; set; } /// /// Both line and radar charts support a fill option on the dataset object which can be used to create area between two datasets or a dataset and a boundary, i.e. the scale origin, start or end @@ -92,9 +92,9 @@ public class RadarDataset public IndexableOption PointRotation { get; set; } /// - /// Style of the point + /// Gets or sets the point style. /// - public IndexableOption PointStyle { get; set; } + public IndexableOption PointStyle { get; set; } /// /// The pixel size of the non-displayed point that reacts to mouse events. diff --git a/ChartJs.Blazor/ChartJS/RadarChart/RadarPointStyles.cs b/ChartJs.Blazor/ChartJS/RadarChart/RadarPointStyles.cs deleted file mode 100644 index ecfc141..0000000 --- a/ChartJs.Blazor/ChartJS/RadarChart/RadarPointStyles.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Newtonsoft.Json; - -namespace ChartJs.Blazor.ChartJS.RadarChart -{ - public class RadarPointStyles - { - private readonly string _style; - - public static RadarPointStyles CIRCLE = new RadarPointStyles("circle"); - public static RadarPointStyles CROSS = new RadarPointStyles("cross"); - public static RadarPointStyles CROSSROT = new RadarPointStyles("crossRot"); - public static RadarPointStyles DASH = new RadarPointStyles("dash"); - public static RadarPointStyles LINE = new RadarPointStyles("line"); - public static RadarPointStyles RECT = new RadarPointStyles("rect"); - public static RadarPointStyles RETROUNDED = new RadarPointStyles("rectRounded"); - public static RadarPointStyles RECTROT = new RadarPointStyles("rectRot"); - public static RadarPointStyles STAR = new RadarPointStyles("star"); - public static RadarPointStyles TRIANGLE = new RadarPointStyles("triangle"); - - [JsonConstructor] - public RadarPointStyles(string style) - { - _style = style; - } - - public override string ToString() - { - return _style; - } - } -} \ No newline at end of file diff --git a/ChartJs.Blazor/ChartJS/ScatterChart/ScatterConfig.cs b/ChartJs.Blazor/ChartJS/ScatterChart/ScatterConfig.cs index c8af00a..23c9338 100644 --- a/ChartJs.Blazor/ChartJS/ScatterChart/ScatterConfig.cs +++ b/ChartJs.Blazor/ChartJS/ScatterChart/ScatterConfig.cs @@ -5,6 +5,6 @@ namespace ChartJs.Blazor.ChartJS.ScatterChart { public class ScatterConfig : ConfigBase { - public ScatterConfig() : base(ChartTypes.Scatter) { } + public ScatterConfig() : base(ChartType.Scatter) { } } } \ No newline at end of file diff --git a/ChartJs.Blazor/ChartJS/ScatterChart/ScatterDataset.cs b/ChartJs.Blazor/ChartJS/ScatterChart/ScatterDataset.cs index d4e8166..08330a0 100644 --- a/ChartJs.Blazor/ChartJS/ScatterChart/ScatterDataset.cs +++ b/ChartJs.Blazor/ChartJS/ScatterChart/ScatterDataset.cs @@ -12,7 +12,7 @@ public class ScatterDataset public List Data { get; set; } - public ChartTypes Type { get; } = ChartTypes.Scatter; + public ChartType Type { get; } = ChartType.Scatter; public string Label { get; set; } = ""; @@ -32,19 +32,19 @@ public class ScatterDataset public int BorderWidth { get; set; } = 1; /// - /// Cap style of the line. + /// Gets or sets the cap style of the line. /// - public string BorderCapStyle { get; set; } + public BorderCapStyle BorderCapStyle { get; set; } /// - /// Line joint style. + /// Gets or sets the line join style. /// - public string BorderJoinStyle { get; set; } + public BorderJoinStyle BorderJoinStyle { get; set; } /// - /// Algorithm used to interpolate a smooth curve from the discrete data points. + /// Gets or sets the algorithm used to interpolate a smooth curve from the discrete data points. /// - public string CubicInterpolationMode { get; set; } + public CubicInterpolationMode CubicInterpolationMode { get; set; } /// /// Length and spacing of dashes. It's an int array. Whatever JS! diff --git a/ChartJs.Blazor/ChartJs.Blazor.xml b/ChartJs.Blazor/ChartJs.Blazor.xml index 83cfc11..f4380db 100644 --- a/ChartJs.Blazor/ChartJs.Blazor.xml +++ b/ChartJs.Blazor/ChartJs.Blazor.xml @@ -189,6 +189,11 @@ Defines the text associated to the dataset and which appears in the legend and tooltips. + + + Gets or sets the point style. + + This method is specifically used to convert an with a Tree structure to a . @@ -272,7 +277,7 @@ Contains the most basic required information about a chart - + Creates a new instance of @@ -295,7 +300,7 @@ The type of the options-subconfig The type of the data-subconfig - + Creates a new instance of @@ -335,7 +340,6 @@ As per documentation here https://www.chartjs.org/docs/latest/axes/cartesian/ - @@ -358,7 +362,7 @@ If only data.labels is defined, this will be used. If data.xLabels is defined and the axis is horizontal, this will be used. Similarly, if data.yLabels is defined and the axis is vertical, this property will be used. Using both xLabels and yLabels together can create a chart that uses strings for both the X and Y axes. - Specifying any of the settings above defines the x axis as type: 'category' if not defined otherwise. + Specifying any of the settings above defines the x axis as type: if not defined otherwise. For more fine-grained control of category labels it is also possible to add labels as part of the category axis definition. Doing so does not apply the global defaults. See https://www.chartjs.org/docs/latest/axes/cartesian/category.html @@ -370,10 +374,199 @@ When building its ticks, it will automatically calculate the most comfortable unit base on the size of the scale. - + + + Specifies the border alignment of a and a . + As per documentation here https://www.chartjs.org/docs/latest/charts/doughnut.html#border-alignment + + + + + When is set, the borders of arcs next to each other will overlap. The default value. + + + + + When is set, it is guaranteed that all the borders will not overlap. + + + + + Creates a new instance of the class. + + The value to set. + + + + Specifies the border cap style. + As per documentation here https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineCap + + + + + The ends of lines are squared off at the endpoints. + + + + + The ends of lines are rounded. + + + + + The ends of lines are squared off by adding a box with an equal width and half the height of the line's thickness. + + + + + Creates a new instance of the class. + + The value to set. + + + + Specifies the border join style. + As per documentation here https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin + + + + + Fills an additional triangular area between the common endpoint of connected segments, and the separate outside rectangular corners of each segment. + + + + + Rounds off the corners of a shape by filling an additional sector of disc centered at the common endpoint of connected segments. The radius for these rounded corners is equal to the line width. + + + + + Connected segments are joined by extending their outside edges to connect at a single point, with the effect of filling an additional lozenge-shaped area. + + + + + Creates a new instance of the class. + + The value to set. + + + + Defines the chart types. + + + + + The bar chart type. + + + + + The horizontal bar chart type. + + + + + The line chart type. + + + + + The pie chart type. + + + + + The doughnut chart type. + + + + + The radar chart type. + + + + + The bubble chart type. + + + + + The polar area chart type. + + + + + The scatter chart type. + + + - Defines the type of a chart + Creates a new instance of the class. + The value to set. + + + + Specifies the cubic interpolation mode. + As per documentation here https://www.chartjs.org/docs/latest/charts/line.html#cubicinterpolationmode + + + + + The default cubic interpolation mode. + The algorithm uses a custom weighted cubic interpolation, which produces pleasant curves for all types of datasets. + + + + + The monotone cubic interpolation mode. + The algorithm is more suited to y = f(x) datasets: + It preserves monotonicity (or piecewise monotonicity) of the dataset being interpolated, and ensures local extrema (if any) stay at input data points. + + + + + Creates a new instance of the class. + + The value to set. + + + + Specifies the css font style of text. + As per documentation here https://developer.mozilla.org/en-US/docs/Web/CSS/font-style + + + + + Specifies a font that is classified as normal within a font-family. + + + + + Specifies a font that is classified as italic. If no italic version of the face is available, one classified as oblique is used instead. If neither is available, the style is artificially simulated. + + + + + Specifies a font that is classified as oblique. If no oblique version of the face is available, one classified as italic is used instead. If neither is available, the style is artificially simulated. + + + + + Specifies a font with its font style set to its default value. + + + + + Specifies a font that inherits the font style from its parent element. + + + + + Creates a new instance of the class. + + The value to set. @@ -459,25 +652,91 @@ The hash of the underlying object. - + - Represents a relative direction or position on a 2D canvas + Specifies how a data-point on the chart will be styled. + As per documentation here https://www.chartjs.org/docs/latest/configuration/elements.html#point-styles + Some samples showcasing the different styles can be found here https://www.chartjs.org/samples/latest/charts/line/point-styles.html - + - As per documentation here https://www.chartjs.org/docs/latest/axes/cartesian/time.html#scale-bounds + The circle point style. - - + - Makes sure data are fully visible, labels outside are removed + The cross point style. - + - Makes sure ticks are fully visible, data outside are truncated + The rotated (45°) cross point style. + + + + + The dash point style. + Unlike , this style only displayes a dash on the right side of the point. + + + + + The line point style. + Unlike , this style displayes a dash on both the right and the left side of the point. + + + + + The rectangle point style. + + + + + The rounded rectangle point style. + + + + + The rotated (45°) rectangle point style. + + + + + The star point style. + Same as and overlapping. + + + + + The triangle point style. + + + + + Creates a new instance of the class. + + The value to set. + + + + Represents a relative direction or position on a 2D canvas. + + + + + Specifies the scale boundary strategy. + As per documentation here https://www.chartjs.org/docs/latest/axes/cartesian/time.html#scale-bounds + + + + + Makes sure data are fully visible, labels outside are removed. + + + + + Makes sure ticks are fully visible, data outside are truncated. @@ -736,11 +995,9 @@ - - Font style of text. - - Supported fonts: http://www.chartjs.org/docs/latest/configuration/legend.html#legend-label-configuration - + + Gets or sets the font style for the labels text. + @@ -1061,7 +1318,7 @@ - Gets or sets the font family for a tick's label, follows CSS font-family options. + Gets or sets the font family for a tick's label. @@ -1071,7 +1328,7 @@ - Gets or sets the font style for a tick's label, follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit). + Gets or sets the font style for a tick's label. @@ -1099,7 +1356,7 @@ - Gets or sets the font family for the labels, follows CSS font-family options. + Gets or sets the font family for the labels. @@ -1109,7 +1366,7 @@ - Gets or sets the font style for the labels, follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit). + Gets or sets the font style for the labels. @@ -1500,20 +1757,17 @@ - Cap style of the line. - See https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineCap for options. + Gets or sets the cap style of the line. - Line joint style. - See https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin for options. + Gets or sets the line join style. - Algorithm used to interpolate a smooth curve from the discrete data points. - See https://www.chartjs.org/docs/latest/charts/line.html#cubicinterpolationmode for options. + Gets or sets the algorithm used to interpolate a smooth curve from the discrete data points. @@ -1890,7 +2144,7 @@ - Gets or sets the chart type. in this case. This is needed for mixed datasets only. + Gets or sets the chart type. in this case. This is needed for mixed datasets only. @@ -1902,8 +2156,8 @@ - Gets or sets the border align. When 'center' is set, the borders of arcs next to each other will overlap. - When 'inner' is set, it is guaranteed that all the borders are not overlap. + Gets or sets the border align. When is set, the borders of arcs next to each other will overlap. + When is set, it is guaranteed that all the borders are not overlap. @@ -2173,7 +2427,7 @@ - Gets the chart type. in this case. This is needed for mixed datasets only. + Gets the chart type. in this case. This is needed for mixed datasets only. @@ -2184,8 +2438,8 @@ - Gets or sets the border align. When 'center' is set, the borders of arcs next to each other will overlap. - When 'inner' is set, it is guaranteed that all the borders are not overlap. + Gets or sets the border align. When is set, the borders of arcs next to each other will overlap. + When is set, it is guaranteed that all the borders are not overlap. @@ -2270,12 +2524,12 @@ - Cap style of the line + Gets or sets the cap style of the line. - Line joint style + Gets or sets the line join style. @@ -2324,7 +2578,7 @@ - Style of the point + Gets or sets the point style. @@ -2371,17 +2625,17 @@ - Cap style of the line. + Gets or sets the cap style of the line. - Line joint style. + Gets or sets the line join style. - Algorithm used to interpolate a smooth curve from the discrete data points. + Gets or sets the algorithm used to interpolate a smooth curve from the discrete data points. diff --git a/WebCore/Pages/LineLinearExample.razor b/WebCore/Pages/LineLinearExample.razor index 229d5f2..4c940ea 100644 --- a/WebCore/Pages/LineLinearExample.razor +++ b/WebCore/Pages/LineLinearExample.razor @@ -39,7 +39,7 @@ }, Legend = new Legend { - Position = Positions.Right, + Position = Position.Right, Labels = new LegendLabelConfiguration { UsePointStyle = true diff --git a/WebCore/Pages/LineLogarithmicExample.razor b/WebCore/Pages/LineLogarithmicExample.razor index ae2e1a3..075291e 100644 --- a/WebCore/Pages/LineLogarithmicExample.razor +++ b/WebCore/Pages/LineLogarithmicExample.razor @@ -33,7 +33,7 @@ }, Legend = new Legend { - Position = Positions.Right, + Position = Position.Right, Labels = new LegendLabelConfiguration { UsePointStyle = true diff --git a/WebCore/Pages/LineTimeExample.razor b/WebCore/Pages/LineTimeExample.razor index 61fb0c9..a008112 100644 --- a/WebCore/Pages/LineTimeExample.razor +++ b/WebCore/Pages/LineTimeExample.razor @@ -50,7 +50,7 @@ }, Legend = new Legend { - Position = Positions.Right, + Position = Position.Right, Labels = new LegendLabelConfiguration { UsePointStyle = true diff --git a/WebCore/Pages/SimpleLineLinearExample.razor b/WebCore/Pages/SimpleLineLinearExample.razor index 05647a9..25f3a15 100644 --- a/WebCore/Pages/SimpleLineLinearExample.razor +++ b/WebCore/Pages/SimpleLineLinearExample.razor @@ -35,7 +35,7 @@ }, Legend = new Legend { - Position = Positions.Right, + Position = Position.Right, Labels = new LegendLabelConfiguration { UsePointStyle = true