File tree Expand file tree Collapse file tree 1 file changed +1
-16
lines changed
docs/BlazorApexCharts.Docs/Components/Features/DynamicSeries Expand file tree Collapse file tree 1 file changed +1
-16
lines changed Original file line number Diff line number Diff line change 1
1
<DemoContainer >
2
-
3
2
<Button class =" m-3" OnClick =" AddNewSeries" BackgroundColor =" TablerColor.Primary" >Add Series</Button >
4
-
5
3
<Button class =" m-3" OnClick =" RemoveSeries" Disabled =" @(series.Count <= 1)" BackgroundColor =" TablerColor.Danger" >Remove Series</Button >
6
4
7
5
<ApexChart @ref =" chart" TItem =" Order"
17
15
OrderByDescending =" e=>e.Y"
18
16
SeriesType =" SeriesType.Bar" />
19
17
}
20
-
21
-
22
-
23
18
</ApexChart >
24
19
</DemoContainer >
25
20
28
23
private ApexChart <Order > chart ;
29
24
protected override void OnInitialized ()
30
25
{
31
-
32
26
series .Add (new MySeries
33
27
{
34
28
Name = " Customer" ,
44
38
await chart ? .UpdateSeriesAsync (true );
45
39
}
46
40
47
-
48
41
private async Task AddNewSeries ()
49
42
{
50
43
series .Add (new MySeries
51
44
{
52
45
Name = " Customer_" + (series .Count () + 1 ),
53
46
Orders = SampleData .GetRandomOrders ()
54
47
});
55
-
56
48
await chart ? .UpdateSeriesAsync (true );
57
-
58
49
}
59
50
60
-
61
-
62
-
63
51
class MySeries
64
52
{
65
-
66
53
public string Name { get ; set ; }
67
- public List<Order>
68
- Orders
69
- { get; set; }
54
+ public List <Order > Orders { get ; set ; }
70
55
}
71
56
}
72
57
You can’t perform that action at this time.
0 commit comments