3
3
4
4
5
5
6
- <ItemSelect Label =" JS Interop Strategy" Items =" @(EnumHelper.GetList<JSInteropStrategy>())" @bind-SelectedValue =" @jsInteropStrategy" Changed =LoadData/ >
6
+ <ItemSelect Label =" JS Interop Strategy" Items =" @(EnumHelper.GetList<JSInteropStrategy>())" @bind-SelectedValue =" @jsInteropStrategy" Changed =LoadData />
7
7
8
8
<ItemSelect Label =" Datapoints" Items =points @bind-SelectedValue =pointsToLoad Changed =LoadData />
9
9
10
10
11
- <ApexChart TItem =" TimeSeries"
12
- Title =" Value"
13
- Height =" 150"
14
- XAxisType =" XAxisType.Datetime"
15
- JSInteropStrategy =jsInteropStrategy
16
- @ref =chart >
11
+ <ApexChart TItem =" TimeSeries"
12
+ Title =" Value"
13
+ Height =" 150"
14
+ XAxisType =" XAxisType.Datetime"
15
+ JSInteropStrategy =jsInteropStrategy
16
+ @ref =chart >
17
17
18
18
19
- <ApexPointSeries TItem =" TimeSeries"
20
- Items =" timeSeries.Take(pointsToLoad)"
21
- Name =" Value"
22
- SeriesType =" SeriesType.Line"
23
- XValue =" @(e => e.Date.ToUnixTimeMilliseconds())"
24
- YValue =" @( e=> e.Value)"
25
- Stroke =" @(new SeriesStroke { Width = 2, Color=" #1F15E5 " })" />
26
- </ApexChart >
19
+ <ApexPointSeries TItem =" TimeSeries"
20
+ Items =" timeSeries.Take(pointsToLoad)"
21
+ Name =" Value"
22
+ SeriesType =" SeriesType.Line"
23
+ XValue =" @(e => e.Date.ToUnixTimeMilliseconds())"
24
+ YValue =" @( e=> e.Value)"
25
+ Stroke =" @(new SeriesStroke { Width = 2, Color=" #1F15E5 " })" />
26
+ </ApexChart >
27
27
28
28
29
29
@if (isLoading )
39
39
@code {
40
40
private JSInteropStrategy jsInteropStrategy = JSInteropStrategy .UnMarshalled ;
41
41
private ApexChart <TimeSeries > chart ;
42
- private List <int > points = new List <int > { 100 , 1000 , 5000 , 10000 };
42
+ private List <int > points = new List <int > { 100 , 1000 , 5000 , 10000 , 25000 };
43
43
private int pointsToLoad = 100 ;
44
- private List <TimeSeries > timeSeries = new TimeSeriesGenerator (10000 ).TimeSeries ;
44
+ private List <TimeSeries > timeSeries = new TimeSeriesGenerator (25000 ).TimeSeries ;
45
45
private string message ;
46
46
private List <DataPoint <TimeSeries >> data ;
47
47
58
58
sw .Start ();
59
59
isLoading = true ;
60
60
61
- await Task .Delay (10 );
62
-
61
+ await Task .Delay (1 );
63
62
64
63
PopulateData ();
65
64
message = $" {pointsToLoad } Points: Populate Data {sw .ElapsedMilliseconds .ToString (" N0" )}ms, " ;
66
65
sw .Restart ();
67
-
68
- // await Task.Delay(10);
69
-
70
66
await chart .UpdateSeriesAsync (false );
71
67
sw .Stop ();
72
-
73
68
74
69
message += $" Update Chart {sw .ElapsedMilliseconds .ToString (" N0" )}ms" ;
75
70
isLoading = false ;
85
80
Items = new List <TimeSeries > { e }
86
81
}).ToList ();
87
82
}
88
-
89
- private void SerializeTest ()
90
- {
91
- var series = chart .Options .Series ;
92
- var options = new ChartSerializer ().GetOptions <TimeSeries >();
93
- var sw = new Stopwatch ();
94
- sw .Start ();
95
-
96
- // var result = serializer.
97
- var result = System .Text .Json .JsonSerializer .Serialize (series , options );
98
- sw .Stop ();
99
- message = $" Test [{pointsToLoad }] {sw .ElapsedMilliseconds .ToString (" N" )}ms" ;
100
- }
101
-
102
83
}
0 commit comments