File tree Expand file tree Collapse file tree 3 files changed +44
-4
lines changed
docs/BlazorApexCharts.Docs/Components/Issues Expand file tree Collapse file tree 3 files changed +44
-4
lines changed Original file line number Diff line number Diff line change 1+ @page " /issues/click"
2+ <ApexChart TItem =" MyData"
3+ Title =" Sample Data" OnClick =" Click" >
4+
5+ <ApexPointSeries TItem =" MyData"
6+ Items =" Data"
7+ Name =" Net Profit"
8+ SeriesType =" SeriesType.Bar"
9+ XValue =" e => e.Category"
10+ YValue =" e=> e.NetProfit" />
11+
12+ <ApexPointSeries TItem =" MyData"
13+ Items =" Data"
14+ Name =" Revenue"
15+ SeriesType =" SeriesType.Bar"
16+ XValue =" e => e.Category"
17+ YValue =" e=> e.Revenue" />
18+ </ApexChart >
19+
20+ @code {
21+ private List <MyData > Data { get ; set ; } = new ();
22+ protected override void OnInitialized ()
23+ {
24+ Data .Add (new MyData { Category = " Jan" , NetProfit = 12 , Revenue = 33 });
25+ Data .Add (new MyData { Category = " Feb" , NetProfit = 43 , Revenue = 42 });
26+ Data .Add (new MyData { Category = " Mar" , NetProfit = 112 , Revenue = 23 });
27+ }
28+
29+ public class MyData
30+ {
31+ public string Category { get ; set ; }
32+ public int NetProfit { get ; set ; }
33+ public int Revenue { get ; set ; }
34+ }
35+
36+ private void Click (SelectedData < MyData > obj )
37+ {
38+ Console .WriteLine (obj .DataPointIndex );
39+ }
40+ }
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ public static class JSLoader
1515 /// <param name="path"></param>
1616 public static async Task < IJSObjectReference > LoadAsync ( IJSRuntime jsRuntime , string path = null )
1717 {
18- var javascriptPath = "./_content/Blazor-ApexCharts/js/blazor-apexcharts.js?ver=6.0" ;
18+ var javascriptPath = "./_content/Blazor-ApexCharts/js/blazor-apexcharts.js?ver=6.0.1 " ;
1919 if ( ! string . IsNullOrWhiteSpace ( path ) ) { javascriptPath = path ; }
2020
2121 // load Module ftom ES6 script
Original file line number Diff line number Diff line change @@ -474,10 +474,10 @@ window.blazor_apexchart = {
474474 seriesIndex : - 1
475475 } ;
476476
477- if ( config . dataPointIndex >= 0 )
478- selection . dataPointIndex = config . dataPointIndex ;
477+ if ( config . dataPointIndex >= 0 && config . dataPointIndex !== null )
478+ selection . dataPointIndex = Number ( config . dataPointIndex ) ;
479479
480- if ( config . seriesIndex >= 0 )
480+ if ( config . seriesIndex >= 0 && config . seriesIndex !== null )
481481 selection . seriesIndex = config . seriesIndex ;
482482
483483 dotNetObject . invokeMethodAsync ( 'JSClick' , selection ) ;
You can’t perform that action at this time.
0 commit comments