forked from syncfusion/blazor-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MultipleData.razor
78 lines (74 loc) · 3.23 KB
/
MultipleData.razor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
@page "/bullet-chart/multiple-data"
@using Syncfusion.Blazor.Charts
@using Syncfusion.Blazor
@inject NavigationManager NavigationManager
@inherits SampleBaseComponent;
<SampleDescription>
<p>This sample illustrates a bullet chart with multiple data to compare different values.</p>
</SampleDescription>
<ActionDescription>
<p>Tooltip is enabled in this example, to see the tooltip in action, hover a feature bar or comparative bar on the bullet chart.</p>
</ActionDescription>
<div class="control-section">
<div align="center">
<SfBulletChart DataSource="@LocalChartData" ValueField="CompletedStories" Theme="@theme" TargetField="RequiredStories" CategoryField="Name" ValueFill="#304560" Width="80%"
TargetColor="#304560" Height="400" Minimum="5" Maximum="45" Interval="5" Title="Sprint Planning" Subtitle="Estimated in story points" TitlePosition="TextPosition.Top">
<BulletChartTooltip TValue="BulletChartData" Enable="true"></BulletChartTooltip>
<BulletChartMinorTickLines Width="0"></BulletChartMinorTickLines>
<BulletChartRangeCollection>
<BulletChartRange End="25" Opacity="1" Color="#DBE7F3"> </BulletChartRange>
<BulletChartRange End="37" Opacity="1" Color="#BBCEE7"></BulletChartRange>
<BulletChartRange End="45" Opacity="1" Color="#96B2D7"></BulletChartRange>
</BulletChartRangeCollection>
</SfBulletChart>
</div>
</div>
@code{
public class BulletChartData
{
public double CompletedStories { get; set; }
public double RequiredStories { get; set; }
public string Name { get; set; }
}
public List<BulletChartData> LocalChartData = new List<BulletChartData>
{
new BulletChartData { CompletedStories = 25, RequiredStories = 20, Name = "David" },
new BulletChartData { CompletedStories = 20, RequiredStories = 25, Name = "Asif" },
new BulletChartData { CompletedStories = 10, RequiredStories = 15, Name = "Thomas" },
new BulletChartData { CompletedStories = 39, RequiredStories = 40, Name = "Rohit" },
new BulletChartData { CompletedStories = 40, RequiredStories = 40, Name = "Virat" },
new BulletChartData { CompletedStories = 25, RequiredStories = 28, Name = "Jude" },
new BulletChartData { CompletedStories = 18, RequiredStories = 10, Name = "Warner" },
new BulletChartData { CompletedStories = 28, RequiredStories = 30, Name = "Malik" },
};
private string CurrentUri;
private Theme theme { get; set; }
protected override void OnInitialized()
{
CurrentUri = NavigationManager.Uri;
if (CurrentUri.IndexOf("material") > -1)
{
theme = Theme.Material;
}
else if (CurrentUri.IndexOf("fabric") > -1)
{
theme = Theme.Fabric;
}
else if (CurrentUri.IndexOf("bootstrap") > -1)
{
theme = Theme.Bootstrap;
}
else if (CurrentUri.IndexOf("highcontrast") > -1)
{
theme = Theme.HighContrast;
}
else if (CurrentUri.IndexOf("tailwind") > -1)
{
theme = Theme.Tailwind;
}
else
{
theme = Theme.Bootstrap4;
}
}
}