Skip to content

Commit

Permalink
Add missing [JsonConverter(typeof(PlainJsonStringConverter))] to call…
Browse files Browse the repository at this point in the history
…backs
  • Loading branch information
mattosaurus committed Jul 1, 2020
1 parent 0a56e62 commit 9d99be3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/ChartJSCore/Models/Options/Hover/Hover.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
namespace ChartJSCore.Models
using ChartJSCore.Helpers;
using Newtonsoft.Json;

namespace ChartJSCore.Models
{
public class Hover : Base
{
Expand All @@ -8,6 +11,7 @@ public class Hover : Base

public int? AnimationDuration { get; set; }

[JsonConverter(typeof(PlainJsonStringConverter))]
public string OnHover { get; set; }
}
}
8 changes: 7 additions & 1 deletion src/ChartJSCore/Models/Options/Legend/Legend.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
namespace ChartJSCore.Models
using ChartJSCore.Helpers;
using Newtonsoft.Json;

namespace ChartJSCore.Models
{
public class Legend : Base
{
Expand All @@ -20,16 +23,19 @@ public class Legend : Base
/// <summary>
/// A callback that is called when a 'click' event is registered on top of a label item.
/// </summary>
[JsonConverter(typeof(PlainJsonStringConverter))]
public string OnClick { get; set; }

/// <summary>
/// Generates the HTML legend via calls to generateLegend.
/// </summary>
[JsonConverter(typeof(PlainJsonStringConverter))]
public string Callback { get; set; }

/// <summary>
/// A callback that is called when a 'mousemove' event is registered on top of a label item.
/// </summary>
[JsonConverter(typeof(PlainJsonStringConverter))]
public string OnHover { get; set; }

public LegendLabel Labels { get; set; }
Expand Down
2 changes: 2 additions & 0 deletions src/ChartJSCore/Models/Options/Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class Options : Base
/// <summary>
/// Called if the event is of type 'mouseup' or 'click'. Called in the context of the chart and passed an array of active elements.
/// </summary>
[JsonConverter(typeof(PlainJsonStringConverter))]
public string OnClick { get; set; }

/// <summary>
Expand All @@ -40,6 +41,7 @@ public class Options : Base
/// <summary>
/// Called when a resize occurs. Gets passed two arguments: the chart instance and the new size.
/// </summary>
[JsonConverter(typeof(PlainJsonStringConverter))]
public string OnResize { get; set; }

public Layout Layout { get; set; }
Expand Down

0 comments on commit 9d99be3

Please sign in to comment.