@@ -20,6 +20,7 @@ public partial class ApexChart<TItem> : IDisposable where TItem : class
20
20
[ Parameter ] public string Title { get ; set ; }
21
21
[ Parameter ] public XAxisType ? XAxisType { get ; set ; }
22
22
[ Parameter ] public bool Debug { get ; set ; }
23
+ [ Parameter ] public bool UnMarshalledJS { get ; set ; }
23
24
[ Parameter ] public object Width { get ; set ; }
24
25
[ Parameter ] public object Height { get ; set ; }
25
26
[ Parameter ] public EventCallback < SelectedData < TItem > > OnDataPointSelection { get ; set ; }
@@ -39,13 +40,16 @@ public partial class ApexChart<TItem> : IDisposable where TItem : class
39
40
private string chartId ;
40
41
public string ChartId => ChartId ;
41
42
private IJSUnmarshalledRuntime jsUnmarshalled ;
43
+ private IJSInProcessRuntime jsInprocess ;
44
+
42
45
private bool isWasm ;
43
46
44
47
protected override void OnInitialized ( )
45
48
{
46
- isWasm = this . JSRuntime is IJSInProcessRuntime ;
49
+ isWasm = JSRuntime is IJSInProcessRuntime ;
47
50
if ( isWasm )
48
51
{
52
+ jsInprocess = ( IJSInProcessRuntime ) JSRuntime ;
49
53
jsUnmarshalled = ( IJSUnmarshalledRuntime ) ServiceProvider . GetService ( typeof ( IJSUnmarshalledRuntime ) ) ;
50
54
}
51
55
}
@@ -361,11 +365,17 @@ public async Task UpdateSeriesAsync(bool animate = true)
361
365
Console . WriteLine ( $ "Serialize { sw . ElapsedMilliseconds } ") ;
362
366
363
367
364
- if ( jsUnmarshalled != null )
368
+ if ( jsUnmarshalled != null && UnMarshalledJS )
365
369
{
366
- jsUnmarshalled . InvokeUnmarshalled < string , string , string , bool > ( "blazor_apexchart.testUnmarshalled" , Options . Chart . Id , jsonSeries , animate . ToString ( ) ) ;
370
+ jsUnmarshalled . InvokeUnmarshalled < string , string , string , string > ( "blazor_apexchart.testUnmarshalled" , Options . Chart . Id , jsonSeries , animate . ToString ( ) . ToLower ( ) ) ;
367
371
Console . WriteLine ( $ "Invoke InvokeUnmarshalled { sw . ElapsedMilliseconds } ") ;
368
372
373
+ }
374
+ else if ( jsInprocess != null )
375
+ {
376
+ jsInprocess . InvokeVoid ( "blazor_apexchart.updateSeries" , Options . Chart . Id , jsonSeries , animate ) ;
377
+ Console . WriteLine ( $ "Invoke Void { sw . ElapsedMilliseconds } ") ;
378
+
369
379
}
370
380
else
371
381
{
@@ -377,7 +387,7 @@ public async Task UpdateSeriesAsync(bool animate = true)
377
387
sw . Stop ( ) ;
378
388
}
379
389
380
-
390
+
381
391
/// <summary>
382
392
/// For no axis charts only provide the seriesIndex value, set dataPointIndex to null
383
393
/// </summary>
0 commit comments