File tree Expand file tree Collapse file tree 4 files changed +49
-3
lines changed
docs/BlazorApexCharts.Docs/Components Expand file tree Collapse file tree 4 files changed +49
-3
lines changed Original file line number Diff line number Diff line change 3
3
<DocExamples Title =" Before Reset Zoom" >
4
4
5
5
<Description >
6
- Click the home icon on the chart to reset the zoom
6
+
7
+ <Alert BackgroundColor =TablerColor.Danger >
8
+ <div class =" d-flex" >
9
+ <div class =" me-2" >
10
+ <Icon TextColor =TablerColor.Danger IconType =@Icons.Alert_triangle Size =40 />
11
+ </div >
12
+ <div >
13
+ <h4 class =" alert-title" >Only supported in Blazor WebAssembly!</h4 >
14
+ <div class =" text-muted" >Event 'OnBeforeResetZoom' is only supported in web assembly</div >
15
+ </div >
16
+ </div >
17
+ </Alert >
18
+
19
+ <h3 >Click the home icon on the chart to reset the zoom</h3 >
20
+
21
+
7
22
</Description >
8
23
9
24
<ChildContent >
Original file line number Diff line number Diff line change 2
2
3
3
<DocExamples Title =" Before Zoom" >
4
4
5
+ <Description >
6
+ <Alert BackgroundColor =TablerColor.Danger >
7
+ <div class =" d-flex" >
8
+ <div class =" me-2" >
9
+ <Icon TextColor =TablerColor.Danger IconType =@Icons.Alert_triangle Size =40 />
10
+ </div >
11
+ <div >
12
+ <h4 class =" alert-title" >Only supported in Blazor WebAssembly!</h4 >
13
+ <div class =" text-muted" >Event 'OnBeforeZoom' is only supported in web assembly</div >
14
+ </div >
15
+ </div >
16
+ </Alert >
17
+ </Description >
18
+
5
19
<ChildContent >
6
20
<CodeSnippet Title =" Basic" ClassName =@typeof(Basic).ToString() >
7
21
<Snippet >
Original file line number Diff line number Diff line change 37
37
@code {
38
38
private List <WeatherForecast > forecasts { get ; set ; }
39
39
private ApexChart <WeatherForecast > chart ;
40
- private string message ;
41
-
40
+
42
41
protected override async Task OnInitializedAsync ()
43
42
{
44
43
await LoadDataAsync ();
Original file line number Diff line number Diff line change @@ -813,6 +813,7 @@ public virtual async Task HideSeriesAsync(string seriesName)
813
813
814
814
private void PrepareChart ( )
815
815
{
816
+ CheckChart ( ) ;
816
817
SetSeries ( ) ;
817
818
SetSeriesColors ( ) ;
818
819
SetSeriesStroke ( ) ;
@@ -823,6 +824,23 @@ private void PrepareChart()
823
824
SetCustomTooltip ( ) ;
824
825
}
825
826
827
+ private void CheckChart ( )
828
+ {
829
+ var jsInProcess = JSRuntime is IJSInProcessRuntime ;
830
+ if ( OnBeforeZoom != null && ! jsInProcess )
831
+ {
832
+ throw new NotSupportedException ( "Event 'OnBeforeZoom' is not suported in blazor server" ) ;
833
+ }
834
+
835
+ if ( OnBeforeResetZoom != null && ! jsInProcess )
836
+ {
837
+ throw new NotSupportedException ( "Event 'OnBeforeResetZoom' is not suported in blazor server" ) ;
838
+ }
839
+
840
+
841
+ }
842
+
843
+
826
844
private void SetCustomTooltip ( )
827
845
{
828
846
if ( ApexPointTooltip == null ) { return ; }
You can’t perform that action at this time.
0 commit comments