Skip to content

Commit 72f1352

Browse files
committed
Remove duplication and CSS
1 parent ab67e87 commit 72f1352

7 files changed

Lines changed: 8 additions & 16 deletions

File tree

src/Chart.razor.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
using System.Linq;
21
using Microsoft.AspNetCore.Components;
2+
using Microsoft.AspNetCore.Components.Web;
33
using Microsoft.JSInterop;
44
using System.Threading.Tasks;
5-
using Microsoft.AspNetCore.Components.Web;
65

76
namespace PSC.Blazor.Components.Chartjs
87
{
@@ -123,9 +122,9 @@ public static Task ChartClick(int indexValue)
123122
}
124123

125124
[JSInvokable]
126-
public static string[] TooltipCallbacksLabel(DotNetObjectReference<IChartConfig> config,int[] parameters)
125+
public static string[] TooltipCallbacksLabel(DotNetObjectReference<IChartConfig> config, int[] parameters)
127126
{
128-
var ctx = new TooltipContext(parameters[0],parameters[1]);
127+
var ctx = new TooltipContext(parameters[0], parameters[1]);
129128
if (config.Value.Options is Options options)
130129
return options.Plugins.Tooltip.Callbacks.Label(ctx);
131130
else

src/Chart.razor.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
.chart-container {
2-
display: inline-block;
32
position: relative;
4-
width: 100%;
53
}

src/Interfaces/IChartConfig.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ public interface IChartConfig
44
{
55
string CanvasId { get; }
66
string Type { get; set; }
7-
IOptions Options { get; }
7+
IOptions Options { get; }
88
}
99
}

src/Models/Common/Callbacks.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public sealed class Callbacks
1515
/// </value>
1616
[JsonInclude]
1717
[JsonPropertyName("hasLabel")]
18-
public bool HasLabel => Label != null;
18+
public bool HasLabel => Label != null;
1919

2020
/// <summary>
2121
/// Gets or sets the label.
@@ -24,6 +24,6 @@ public sealed class Callbacks
2424
/// The label.
2525
/// </value>
2626
[JsonIgnore]
27-
public Func<TooltipContext, string[]>? Label { get; set; }
27+
public Func<TooltipContext, string[]>? Label { get; set; }
2828
}
2929
}

src/Models/Common/Options.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using Microsoft.AspNetCore.Components.Web;
22
using System.Threading.Tasks;
3-
using Microsoft.AspNetCore.Components.Web;
43

54
namespace PSC.Blazor.Components.Chartjs.Models.Common
65
{
@@ -107,8 +106,5 @@ public class Options : IOptions
107106
[JsonPropertyName("scales")]
108107
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
109108
public Dictionary<string, Axis> Scales { get; set; }
110-
111-
[JsonIgnore]
112-
public Func<MouseEventArgs, ValueTask>? OnMouseOutAsync { get; set; }
113109
}
114110
}

src/Models/Common/TooltipContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/// <summary>
44
/// Tooltip Context
55
/// </summary>
6-
public readonly record struct TooltipContext(int DatasetIndex,int DataIndex)
6+
public readonly record struct TooltipContext(int DatasetIndex, int DataIndex)
77
{
88
}
99
}

src/wwwroot/lib/Chart.js/chart.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13521,5 +13521,4 @@ if (typeof window !== 'undefined') {
1352113521
}
1352213522

1352313523
return Chart;
13524-
13525-
}));
13524+
}));

0 commit comments

Comments
 (0)