diff --git a/src/ChartJSCore/Models/Options/Legend/LegendLabel.cs b/src/ChartJSCore/Models/Options/Legend/LegendLabel.cs index a8f8f46..10ccbca 100644 --- a/src/ChartJSCore/Models/Options/Legend/LegendLabel.cs +++ b/src/ChartJSCore/Models/Options/Legend/LegendLabel.cs @@ -29,7 +29,8 @@ public class LegendLabel : Base /// /// Padding between rows of colored boxes. /// - public int? Padding { get; set; } + [JsonConverter(typeof(PaddingConverter))] + public Padding Padding { get; set; } /// /// Generates legend items for each thing in the legend. Default implementation returns the text + styling for the color box. diff --git a/src/ChartJSCore/Models/Options/Scales/Ticks/CartesianTick.cs b/src/ChartJSCore/Models/Options/Scales/Ticks/CartesianTick.cs index 4323615..653f0c6 100644 --- a/src/ChartJSCore/Models/Options/Scales/Ticks/CartesianTick.cs +++ b/src/ChartJSCore/Models/Options/Scales/Ticks/CartesianTick.cs @@ -1,4 +1,7 @@ -namespace ChartJSCore.Models +using ChartJSCore.Helpers; +using Newtonsoft.Json; + +namespace ChartJSCore.Models { public class CartesianTick : Tick { @@ -35,6 +38,7 @@ public class CartesianTick : Tick /// /// Padding between the tick label and the axis. When set on a vertical axis, this applies in the horizontal (X) direction. When set on a horizontal axis, this applies in the vertical (Y) direction. /// - public int? Padding { get; set; } + [JsonConverter(typeof(PaddingConverter))] + public Padding Padding { get; set; } } } diff --git a/src/ChartJSCore/Models/Options/Scales/Ticks/RadialLinearTick.cs b/src/ChartJSCore/Models/Options/Scales/Ticks/RadialLinearTick.cs index 76fbc3a..28719bb 100644 --- a/src/ChartJSCore/Models/Options/Scales/Ticks/RadialLinearTick.cs +++ b/src/ChartJSCore/Models/Options/Scales/Ticks/RadialLinearTick.cs @@ -1,4 +1,5 @@ using ChartJSCore.Helpers; +using Newtonsoft.Json; namespace ChartJSCore.Models { @@ -9,15 +10,8 @@ public class RadialLinearTick : RadialTick /// public ChartColor BackdropColor { get; set; } - /// - /// Horizontal padding of label backdrop. - /// - public int? BackdropPaddingX { get; set; } - - /// - /// Vertical padding of label backdrop. - /// - public int? BackdropPaddingY { get; set; } + [JsonConverter(typeof(PaddingConverter))] + public Padding BackdropPadding { get; set; } /// /// If true, scale will include 0 if it is not already included.