File tree Expand file tree Collapse file tree 7 files changed +152
-11
lines changed
BlazorApexCharts.Docs.Server/Properties
Components/ChartTypes/HeatmapCharts Expand file tree Collapse file tree 7 files changed +152
-11
lines changed Original file line number Diff line number Diff line change 3
3
"IIS Express" : {
4
4
"commandName" : " IISExpress" ,
5
5
"launchBrowser" : true ,
6
- "launchUrl" : " rangebar -charts" ,
6
+ "launchUrl" : " heatmap -charts" ,
7
7
"environmentVariables" : {
8
8
"ASPNETCORE_ENVIRONMENT" : " Development"
9
9
}
Original file line number Diff line number Diff line change 21
21
<ProjectReference Include =" ..\..\src\Blazor-ApexCharts\Blazor-ApexCharts.csproj" />
22
22
</ItemGroup >
23
23
24
+ <ItemGroup >
25
+ <Folder Include =" Components\Issues\" />
26
+ </ItemGroup >
27
+
24
28
</Project >
Original file line number Diff line number Diff line change 1
1
<DemoContainer >
2
2
<ApexChart TItem =" SupportIncident"
3
3
Title =" Incident Severity"
4
- Options = " options " >
4
+ >
5
5
6
6
@foreach ( var source in incidents .GroupBy (e => e .Source ))
7
7
{
18
18
19
19
@code {
20
20
private List <SupportIncident > incidents { get ; set ; } = SampleData .GetSupportIncidents ();
21
- private ApexChartOptions <SupportIncident > options ;
22
-
23
- protected override void OnInitialized ()
24
- {
25
- options = new ApexChartOptions <SupportIncident >
26
- {
27
- Colors = new List <string > { " #008FFB" }
28
- };
29
- }
21
+
30
22
}
Original file line number Diff line number Diff line change
1
+ <DemoContainer >
2
+ <ApexChart TItem =" SupportIncident"
3
+ Title =" Incident Severity"
4
+ Options =" options" >
5
+
6
+ @foreach ( var source in incidents .GroupBy (e => e .Source ).OrderBy (e => e .Key ))
7
+ {
8
+ <ApexPointSeries TItem =" SupportIncident"
9
+ Items =" source.OrderBy(e=>e.WeekNumber)"
10
+ Name =" @source.Key.ToString()"
11
+ SeriesType =" SeriesType.Heatmap"
12
+ Color =" @GetColor(source.Key)"
13
+ XValue =" @(e => e.WeekName)"
14
+ YAggregate =" @(e => (int)e.Average(a=>a.Severity))" />
15
+ }
16
+
17
+ </ApexChart >
18
+ </DemoContainer >
19
+
20
+ @code {
21
+ private List <SupportIncident > incidents { get ; set ; } = SampleData .GetSupportIncidents ();
22
+ private ApexChartOptions <SupportIncident > options = new ();
23
+
24
+ private string GetColor (IncidentSource source )
25
+ {
26
+ switch (source )
27
+ {
28
+ case IncidentSource .Internal :
29
+ return " #FF0000" ;
30
+ case IncidentSource .ThirdParty :
31
+ return " #0000FF" ;
32
+ case IncidentSource .Integration :
33
+ return " #FF00FF" ;
34
+ default :
35
+ return " #008FFB" ;
36
+ }
37
+ }
38
+ }
Original file line number Diff line number Diff line change 8
8
</Snippet >
9
9
</CodeSnippet >
10
10
11
+ <CodeSnippet Title =" One color" ClassName =@typeof(OneColor).ToString() >
12
+ <Snippet >
13
+ <OneColor />
14
+ </Snippet >
15
+ </CodeSnippet >
11
16
17
+ <CodeSnippet Title =" Series Color" ClassName =@typeof(Colors).ToString() >
18
+ <Snippet >
19
+ <Colors />
20
+ </Snippet >
21
+ </CodeSnippet >
12
22
23
+ <CodeSnippet Title =NoShade ClassName =@typeof(NoShade).ToString() >
24
+ <Snippet >
25
+ <NoShade />
26
+ </Snippet >
27
+ </CodeSnippet >
13
28
14
29
</DocExamples >
Original file line number Diff line number Diff line change
1
+ <DemoContainer >
2
+ <ApexChart TItem =" SupportIncident"
3
+ Title =" Incident Severity"
4
+ Options =" options"
5
+ Debug >
6
+
7
+ @foreach ( var source in incidents .GroupBy (e => e .Source ))
8
+ {
9
+ <ApexPointSeries TItem =" SupportIncident"
10
+ Items =" source.OrderBy(e=>e.WeekNumber)"
11
+ Name =" @source.Key.ToString()"
12
+ SeriesType =" SeriesType.Heatmap"
13
+ XValue =" @(e => e.WeekName)"
14
+ YAggregate =" @(e => (int)e.Average(a=>a.Severity))"
15
+ ShowDataLabels =true
16
+ />
17
+ }
18
+
19
+ </ApexChart >
20
+ </DemoContainer >
21
+
22
+ @code {
23
+ private List <SupportIncident > incidents { get ; set ; } = SampleData .GetSupportIncidents ();
24
+ private ApexChartOptions <SupportIncident > options ;
25
+
26
+ protected override void OnInitialized ()
27
+ {
28
+ options = new ApexChartOptions <SupportIncident >
29
+ {
30
+ Stroke = new Stroke
31
+ {
32
+ Width = 0
33
+ },
34
+ PlotOptions = new PlotOptions
35
+ {
36
+ Heatmap = new PlotOptionsHeatmap
37
+ {
38
+ EnableShades = false ,
39
+ Radius = 300 ,
40
+ ColorScale = new PlotOptionsHeatmapColorScale
41
+ {
42
+ Ranges = new List <PlotOptionsHeatmapColorScaleRange > {
43
+ new PlotOptionsHeatmapColorScaleRange {
44
+ Color = " #0000FF" ,
45
+ From = 0 ,
46
+ To = 50
47
+ },
48
+ {
49
+ new PlotOptionsHeatmapColorScaleRange
50
+ {
51
+ Color = " #FF0000" ,
52
+ From = 50 ,
53
+ To = 100
54
+ }
55
+ }
56
+ }
57
+ }
58
+ }
59
+ }
60
+ };
61
+ }
62
+ }
Original file line number Diff line number Diff line change
1
+ <DemoContainer >
2
+ <ApexChart TItem =" SupportIncident"
3
+ Title =" Incident Severity"
4
+ Options =" options" >
5
+
6
+ @foreach ( var source in incidents .GroupBy (e => e .Source ))
7
+ {
8
+ <ApexPointSeries TItem =" SupportIncident"
9
+ Items =" source.OrderBy(e=>e.WeekNumber)"
10
+ Name =" @source.Key.ToString()"
11
+ SeriesType =" SeriesType.Heatmap"
12
+ XValue =" @(e => e.WeekName)"
13
+ YAggregate =" @(e => (int)e.Average(a=>a.Severity))" />
14
+ }
15
+
16
+ </ApexChart >
17
+ </DemoContainer >
18
+
19
+ @code {
20
+ private List <SupportIncident > incidents { get ; set ; } = SampleData .GetSupportIncidents ();
21
+ private ApexChartOptions <SupportIncident > options ;
22
+
23
+ protected override void OnInitialized ()
24
+ {
25
+ options = new ApexChartOptions <SupportIncident >
26
+ {
27
+ Colors = new List <string > { " #008FFB" }
28
+ };
29
+ }
30
+ }
You can’t perform that action at this time.
0 commit comments