File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11@inject IJSRuntime JSRuntime
22
33<div id =" @(" chartcontainer " + Config.CanvasId)" class =" chart-container @Class"
4- style =" height :@Height; width :@Width; @(Style )" >
4+ style =" height :@Height; width :@Width; @(Style )"
5+ @onmouseout =" async (args) => await OnMouseOut(args)" >
56 <canvas id =" @Config.CanvasId" style =" @(Height != null ? $ " height:{Height} " : " " ) @(Width != null ? $" width:{Width}; " : " " )" ></canvas >
67</div >
Original file line number Diff line number Diff line change 22using Microsoft . AspNetCore . Components ;
33using Microsoft . JSInterop ;
44using System . Threading . Tasks ;
5+ using Microsoft . AspNetCore . Components . Web ;
56
67namespace PSC . Blazor . Components . Chartjs
78{
@@ -105,6 +106,14 @@ public void Dispose()
105106 this . oldReference ? . Dispose ( ) ;
106107 }
107108
109+ private ValueTask OnMouseOut ( MouseEventArgs mouseEventArgs )
110+ {
111+ if ( Config . Options is Options { OnMouseOutAsync : { } } options )
112+ return options . OnMouseOutAsync ( mouseEventArgs ) ;
113+ else
114+ return ValueTask . CompletedTask ;
115+ }
116+
108117 #region JavaScript invokable functions
109118
110119 [ JSInvokable ]
Original file line number Diff line number Diff line change 1- using System ;
2- using System . Collections . Generic ;
3- using System . Linq ;
4- using System . Text ;
5- using System . Threading . Tasks ;
6-
7- namespace PSC . Blazor . Components . Chartjs . Models . Common
1+ namespace PSC . Blazor . Components . Chartjs . Models . Common
82{
93 /// <summary>
104 /// Hover Context
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11using System . Threading . Tasks ;
2+ using Microsoft . AspNetCore . Components . Web ;
23
34namespace PSC . Blazor . Components . Chartjs . Models . Common
45{
@@ -92,5 +93,8 @@ public class Options : IOptions
9293 [ JsonPropertyName ( "scales" ) ]
9394 [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingNull ) ]
9495 public Dictionary < string , Axis > Scales { get ; set ; }
96+
97+ [ JsonIgnore ]
98+ public Func < MouseEventArgs , ValueTask > ? OnMouseOutAsync { get ; set ; }
9599 }
96100}
You can’t perform that action at this time.
0 commit comments