File tree Expand file tree Collapse file tree
docs/BlazorApexCharts.Docs/Components Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33<DocExamples Title =" Before Reset Zoom" >
44
55 <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+
722 </Description >
823
924 <ChildContent >
Original file line number Diff line number Diff line change 22
33<DocExamples Title =" Before Zoom" >
44
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+
519 <ChildContent >
620 <CodeSnippet Title =" Basic" ClassName =@typeof(Basic).ToString() >
721 <Snippet >
Original file line number Diff line number Diff line change 3737@code {
3838 private List <WeatherForecast > forecasts { get ; set ; }
3939 private ApexChart <WeatherForecast > chart ;
40- private string message ;
41-
40+
4241 protected override async Task OnInitializedAsync ()
4342 {
4443 await LoadDataAsync ();
Original file line number Diff line number Diff line change @@ -813,6 +813,7 @@ public virtual async Task HideSeriesAsync(string seriesName)
813813
814814 private void PrepareChart ( )
815815 {
816+ CheckChart ( ) ;
816817 SetSeries ( ) ;
817818 SetSeriesColors ( ) ;
818819 SetSeriesStroke ( ) ;
@@ -823,6 +824,23 @@ private void PrepareChart()
823824 SetCustomTooltip ( ) ;
824825 }
825826
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+
826844 private void SetCustomTooltip ( )
827845 {
828846 if ( ApexPointTooltip == null ) { return ; }
You can’t perform that action at this time.
0 commit comments