Skip to content

Commit 8e51b65

Browse files
authored
Polar Area Chart + Other improvements (#773)
* PolarAreaChart + other chart improvements + README and other text update
1 parent 78141f3 commit 8e51b65

File tree

49 files changed

+2412
-540
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2412
-540
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@
6363
#*.RTF diff=astextplain
6464

6565
# blazor dlls
66-
*.dll binary
66+
*.dll binary

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## Ignore Visual Studio temporary files, build results, and
22
## files generated by popular Visual Studio add-ons.
33
##
4+
##
45
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
56

67
# User-specific files

BlazorBootstrap.Demo.RCL/Components/Layout/MainLayout.razor.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ internal override IEnumerable<NavItem> GetNavItems()
8181
new (){ Id = "601", Text = "Doughnut Chart", Href = "/charts/doughnut-chart", IconName = IconName.CircleFill, ParentId = "6", Match = NavLinkMatch.All },
8282
new (){ Id = "602", Text = "Line Chart", Href = "/charts/line-chart", IconName = IconName.GraphUp, ParentId = "6", Match = NavLinkMatch.All },
8383
new (){ Id = "603", Text = "Pie Chart", Href = "/charts/pie-chart", IconName = IconName.PieChartFill, ParentId = "6", Match = NavLinkMatch.All },
84+
new (){ Id = "604", Text = "Polar Area Chart", Href = "/charts/polar-area-chart", IconName = IconName.PieChartFill, ParentId = "6", Match = NavLinkMatch.All },
8485

8586
new(){ Id = "7", Text = "Services", IconName = IconName.WrenchAdjustableCircleFill, IconColor = IconColor.Success },
8687
new (){ Id = "700", Text = "Modal Service", Href = "/modal-service", IconName = IconName.WindowStack, ParentId = "7" },

BlazorBootstrap.Demo.RCL/Components/Pages/Charts/ChartsDocumentation.razor

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@
2121
<li><a href="/charts/doughnut-chart">Doughnut Chart</a></li>
2222
<li><a href="/charts/line-chart">Line Chart</a></li>
2323
<li><a href="/charts/pie-chart">Pie Chart</a></li>
24+
<li><a href="/charts/polar-area-chart">Polar Area Chart</a></li>
2425
</ol>
2526

2627
<Callout Color="CalloutColor.Info">
27-
We will add Bubble Chart, Polar Area Chart, Radar Chart, Scatter Chart, and Mixed Chart support in the subsequent versions.
28+
We will add Bubble Chart, Radar Chart, Scatter Chart, and Mixed Chart support in the subsequent versions.
2829
</Callout>
2930

3031
<SectionHeading Size="HeadingSize.H4" Text="Charts Setup" PageUrl="@pageUrl" HashTagName="charts-setup" />

BlazorBootstrap.Demo.RCL/Components/Pages/Charts/Charts_Demo_00_Examples.razor

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -69,27 +69,27 @@
6969
{
7070
Label = "India",
7171
Data = new List<double>{ 9, 20, 29, 33, 50, 66, 75, 86, 91, 105, 120, 126, 141, 150, 156, 164, 177, 180, 184, 195 },
72-
BackgroundColor = new List<string>{ "rgb(88, 80, 141)" },
73-
BorderColor = new List<string>{ "rgb(88, 80, 141)" },
74-
BorderWidth = new List<double>{2},
75-
HoverBorderWidth = new List<double>{4},
76-
PointBackgroundColor = new List<string>{ "rgb(88, 80, 141)" },
77-
PointBorderColor = new List<string>{ "rgb(88, 80, 141)" },
78-
PointRadius = new List<int>{0}, // hide points
79-
PointHoverRadius = new List<int>{4},
72+
BackgroundColor = "rgb(88, 80, 141)",
73+
BorderColor = "rgb(88, 80, 141)",
74+
BorderWidth = 2,
75+
HoverBorderWidth = 4,
76+
PointBackgroundColor = "rgb(88, 80, 141)",
77+
PointBorderColor = "rgb(88, 80, 141)",
78+
PointRadius = 0, // hide points
79+
PointHoverRadius = 4,
8080
},
8181
new LineChartDataset()
8282
{
8383
Label = "England",
8484
Data = new List<double>{ 1, 1, 8, 19, 24, 26, 39, 47, 56, 66, 75, 88, 95, 100, 109, 114, 124, 129, 140, 142 },
85-
BackgroundColor = new List<string>{ "rgb(255, 166, 0)" },
86-
BorderColor = new List<string>{ "rgb(255, 166, 0)" },
87-
BorderWidth = new List<double>{2},
88-
HoverBorderWidth = new List<double>{4},
89-
PointBackgroundColor = new List<string>{ "rgb(255, 166, 0)" },
90-
PointBorderColor = new List<string>{ "rgb(255, 166, 0)" },
91-
PointRadius = new List<int>{0}, // hide points
92-
PointHoverRadius = new List<int>{4},
85+
BackgroundColor = "rgb(255, 166, 0)",
86+
BorderColor = "rgb(255, 166, 0)",
87+
BorderWidth = 2,
88+
HoverBorderWidth = 4,
89+
PointBackgroundColor = "rgb(255, 166, 0)",
90+
PointBorderColor = "rgb(255, 166, 0)",
91+
PointRadius = 0, // hide points
92+
PointHoverRadius = 4,
9393
}
9494
}
9595
};

BlazorBootstrap.Demo.RCL/Components/Pages/Charts/DoughnutCharts/DoughnutChart_Demo_02_Datalabels.razor

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@
100100
var dataset = GetRandomDoughnutChartDataset();
101101

102102
if (index == 0)
103-
dataset.Datalabels.Anchor = "end";
103+
dataset.Datalabels.Anchor = Anchor.End;
104104
else if (index == numberOfDatasets - 1)
105-
dataset.Datalabels.Anchor = "start";
105+
dataset.Datalabels.Anchor = Anchor.Start;
106106
else
107-
dataset.Datalabels.Anchor = "center";
107+
dataset.Datalabels.Anchor = Anchor.Center;
108108

109109
datasets.Add(dataset);
110110
}

BlazorBootstrap.Demo.RCL/Components/Pages/Charts/LineCharts/LineChart_Demo_01_A_Examples.razor

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,13 @@
122122
{
123123
Label = $"Team {datasetsCount}",
124124
Data = GetRandomData(),
125-
BackgroundColor = new List<string> { c.ToRgbString() },
126-
BorderColor = new List<string> { c.ToRgbString() },
127-
BorderWidth = new List<double> { 2 },
128-
HoverBorderWidth = new List<double> { 4 },
129-
PointBackgroundColor = new List<string> { c.ToRgbString() },
130-
PointRadius = new List<int> { 0 }, // hide points
131-
PointHoverRadius = new List<int> { 4 }
125+
BackgroundColor = c.ToRgbString(),
126+
BorderColor = c.ToRgbString(),
127+
BorderWidth = 2,
128+
HoverBorderWidth = 4,
129+
PointBackgroundColor = c.ToRgbString(),
130+
PointRadius = 0, // hide points
131+
PointHoverRadius = 4,
132132
};
133133
}
134134

BlazorBootstrap.Demo.RCL/Components/Pages/Charts/LineCharts/LineChart_Demo_01_B_Examples.razor

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,41 +16,41 @@
1616
{
1717
Label = "Windows",
1818
Data = new List<double> { 7265791, 5899643, 6317759, 6315641, 5338211, 8496306, 7568556, 8538933, 8274297, 8657298, 7548388, 7764845 },
19-
BackgroundColor = new List<string> { colors[0] },
20-
BorderColor = new List<string> { colors[0] },
21-
BorderWidth = new List<double> { 2 },
22-
HoverBorderWidth = new List<double> { 4 },
23-
PointBackgroundColor = new List<string> { colors[0] },
24-
PointRadius = new List<int> { 0 }, // hide points
25-
PointHoverRadius = new List<int> { 4 }
19+
BackgroundColor = colors[0],
20+
BorderColor = colors[0],
21+
BorderWidth = 2,
22+
HoverBorderWidth = 4,
23+
PointBackgroundColor = colors[0],
24+
PointRadius = 0, // hide points
25+
PointHoverRadius = 4,
2626
};
2727
datasets.Add(dataset1);
2828

2929
var dataset2 = new LineChartDataset
3030
{
3131
Label = "macOS",
3232
Data = new List<double> { 1809499, 1816642, 2122410, 1809499, 1850793, 1846743, 1954797, 2391313, 1983430, 2469918, 2633303, 2821149 },
33-
BackgroundColor = new List<string> { colors[1] },
34-
BorderColor = new List<string> { colors[1] },
35-
BorderWidth = new List<double> { 2 },
36-
HoverBorderWidth = new List<double> { 4 },
37-
PointBackgroundColor = new List<string> { colors[1] },
38-
PointRadius = new List<int> { 0 }, // hide points
39-
PointHoverRadius = new List<int> { 4 }
33+
BackgroundColor = colors[1],
34+
BorderColor = colors[1],
35+
BorderWidth = 2,
36+
HoverBorderWidth = 4,
37+
PointBackgroundColor = colors[1],
38+
PointRadius = 0, // hide points
39+
PointHoverRadius = 4,
4040
};
4141
datasets.Add(dataset2);
4242

4343
var dataset3 = new LineChartDataset
4444
{
4545
Label = "Other",
4646
Data = new List<double> { 1081241, 1100363, 1118136, 1073255, 1120315, 1395736, 1488788, 1489466, 1489947, 1414739, 1735811, 1820171 },
47-
BackgroundColor = new List<string> { colors[2] },
48-
BorderColor = new List<string> { colors[2] },
49-
BorderWidth = new List<double> { 2 },
50-
HoverBorderWidth = new List<double> { 4 },
51-
PointBackgroundColor = new List<string> { colors[2] },
52-
PointRadius = new List<int> { 0 }, // hide points
53-
PointHoverRadius = new List<int> { 4 }
47+
BackgroundColor = colors[2],
48+
BorderColor = colors[2],
49+
BorderWidth = 2,
50+
HoverBorderWidth = 4,
51+
PointBackgroundColor = colors[2],
52+
PointRadius = 0, // hide points
53+
PointHoverRadius = 4,
5454
};
5555
datasets.Add(dataset3);
5656

BlazorBootstrap.Demo.RCL/Components/Pages/Charts/LineCharts/LineChart_Demo_02_Locale.razor

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,41 +16,41 @@
1616
{
1717
Label = "Windows",
1818
Data = new List<double> { 7265791, 5899643, 6317759, 6315641, 5338211, 8496306, 7568556, 8538933, 8274297, 8657298, 7548388, 7764845 },
19-
BackgroundColor = new List<string> { colors[0] },
20-
BorderColor = new List<string> { colors[0] },
21-
BorderWidth = new List<double> { 2 },
22-
HoverBorderWidth = new List<double> { 4 },
23-
PointBackgroundColor = new List<string> { colors[0] },
24-
PointRadius = new List<int> { 0 }, // hide points
25-
PointHoverRadius = new List<int> { 4 }
19+
BackgroundColor = colors[0],
20+
BorderColor = colors[0],
21+
BorderWidth = 2,
22+
HoverBorderWidth = 4,
23+
PointBackgroundColor = colors[0],
24+
PointRadius = 0, // hide points
25+
PointHoverRadius = 4,
2626
};
2727
datasets.Add(dataset1);
2828

2929
var dataset2 = new LineChartDataset
3030
{
3131
Label = "macOS",
3232
Data = new List<double> { 1809499, 1816642, 2122410, 1809499, 1850793, 1846743, 1954797, 2391313, 1983430, 2469918, 2633303, 2821149 },
33-
BackgroundColor = new List<string> { colors[1] },
34-
BorderColor = new List<string> { colors[1] },
35-
BorderWidth = new List<double> { 2 },
36-
HoverBorderWidth = new List<double> { 4 },
37-
PointBackgroundColor = new List<string> { colors[1] },
38-
PointRadius = new List<int> { 0 }, // hide points
39-
PointHoverRadius = new List<int> { 4 }
33+
BackgroundColor = colors[1],
34+
BorderColor = colors[1],
35+
BorderWidth = 2,
36+
HoverBorderWidth = 4,
37+
PointBackgroundColor = colors[1],
38+
PointRadius = 0, // hide points
39+
PointHoverRadius = 4,
4040
};
4141
datasets.Add(dataset2);
4242

4343
var dataset3 = new LineChartDataset
4444
{
4545
Label = "Other",
4646
Data = new List<double> { 1081241, 1100363, 1118136, 1073255, 1120315, 1395736, 1488788, 1489466, 1489947, 1414739, 1735811, 1820171 },
47-
BackgroundColor = new List<string> { colors[2] },
48-
BorderColor = new List<string> { colors[2] },
49-
BorderWidth = new List<double> { 2 },
50-
HoverBorderWidth = new List<double> { 4 },
51-
PointBackgroundColor = new List<string> { colors[2] },
52-
PointRadius = new List<int> { 0 }, // hide points
53-
PointHoverRadius = new List<int> { 4 }
47+
BackgroundColor = colors[2],
48+
BorderColor = colors[2],
49+
BorderWidth = 2,
50+
HoverBorderWidth = 4,
51+
PointBackgroundColor = colors[2],
52+
PointRadius = 0, // hide points
53+
PointHoverRadius = 4,
5454
};
5555
datasets.Add(dataset3);
5656

BlazorBootstrap.Demo.RCL/Components/Pages/Charts/LineCharts/LineChart_Demo_03_Dynamically_add_data.razor

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -56,27 +56,27 @@
5656
{
5757
Label = "India",
5858
Data = new List<double>(),
59-
BackgroundColor = new List<string> { "rgb(88, 80, 141)" },
60-
BorderColor = new List<string> { "rgb(88, 80, 141)" },
61-
BorderWidth = new List<double> { 2 },
62-
HoverBorderWidth = new List<double> { 4 },
63-
PointBackgroundColor = new List<string> { "rgb(88, 80, 141)" },
64-
PointBorderColor = new List<string> { "rgb(88, 80, 141)" },
65-
PointRadius = new List<int> { 0 }, // hide points
66-
PointHoverRadius = new List<int> { 4 }
59+
BackgroundColor = "rgb(88, 80, 141)",
60+
BorderColor = "rgb(88, 80, 141)",
61+
BorderWidth = 2,
62+
HoverBorderWidth = 4,
63+
PointBackgroundColor = "rgb(88, 80, 141)",
64+
PointBorderColor = "rgb(88, 80, 141)",
65+
PointRadius = 0, // hide points
66+
PointHoverRadius = 4,
6767
},
6868
new LineChartDataset
6969
{
7070
Label = "England",
7171
Data = new List<double>(),
72-
BackgroundColor = new List<string> { "rgb(255, 166, 0)" },
73-
BorderColor = new List<string> { "rgb(255, 166, 0)" },
74-
BorderWidth = new List<double> { 2 },
75-
HoverBorderWidth = new List<double> { 4 },
76-
PointBackgroundColor = new List<string> { "rgb(255, 166, 0)" },
77-
PointBorderColor = new List<string> { "rgb(255, 166, 0)" },
78-
PointRadius = new List<int> { 0 }, // hide points
79-
PointHoverRadius = new List<int> { 4 }
72+
BackgroundColor = "rgb(255, 166, 0)",
73+
BorderColor = "rgb(255, 166, 0)",
74+
BorderWidth = 2,
75+
HoverBorderWidth = 4,
76+
PointBackgroundColor = "rgb(255, 166, 0)",
77+
PointBorderColor = "rgb(255, 166, 0)",
78+
PointRadius = 0, // hide points
79+
PointHoverRadius = 4,
8080
}
8181
};
8282

BlazorBootstrap.Demo.RCL/Components/Pages/Charts/LineCharts/LineChart_Demo_04_Datalabels.razor

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,50 +16,50 @@
1616
{
1717
Label = "Windows",
1818
Data = new List<double> { 7265791, 5899643, 6317759, 6315641, 5338211, 8496306, 7568556, 8538933, 8274297, 8657298, 7548388, 7764845 },
19-
BackgroundColor = new List<string> { colors[0] },
20-
BorderColor = new List<string> { colors[0] },
21-
BorderWidth = new List<double> { 2 },
22-
HoverBorderWidth = new List<double> { 4 },
23-
PointBackgroundColor = new List<string> { colors[0] },
24-
PointRadius = new List<int> { 3 }, // show points
25-
PointHoverRadius = new List<int> { 4 },
19+
BackgroundColor = colors[0],
20+
BorderColor = colors[0],
21+
BorderWidth = 2,
22+
HoverBorderWidth = 4,
23+
PointBackgroundColor = colors[0],
24+
PointRadius = 3, // show points
25+
PointHoverRadius = 4,
2626

2727
// datalabels
28-
Datalabels = new() { Align = "end", Anchor = "end" }
28+
Datalabels = new() { Alignment = Alignment.End, Anchor = Anchor.End }
2929
};
3030
datasets.Add(dataset1);
3131

3232
var dataset2 = new LineChartDataset
3333
{
3434
Label = "macOS",
3535
Data = new List<double> { 1809499, 1816642, 2122410, 1809499, 1850793, 1846743, 1954797, 2391313, 1983430, 2469918, 2633303, 2821149 },
36-
BackgroundColor = new List<string> { colors[1] },
37-
BorderColor = new List<string> { colors[1] },
38-
BorderWidth = new List<double> { 2 },
39-
HoverBorderWidth = new List<double> { 4 },
40-
PointBackgroundColor = new List<string> { colors[1] },
41-
PointRadius = new List<int> { 3 }, // show points
42-
PointHoverRadius = new List<int> { 4 },
36+
BackgroundColor = colors[1],
37+
BorderColor = colors[1],
38+
BorderWidth = 2,
39+
HoverBorderWidth = 4,
40+
PointBackgroundColor = colors[1],
41+
PointRadius = 3, // show points
42+
PointHoverRadius = 4,
4343

4444
// datalabels
45-
Datalabels = new() { Align = "end", Anchor = "end" }
45+
Datalabels = new() { Alignment = Alignment.End, Anchor = Anchor.End }
4646
};
4747
datasets.Add(dataset2);
4848

4949
var dataset3 = new LineChartDataset
5050
{
5151
Label = "Other",
5252
Data = new List<double> { 1081241, 1100363, 1118136, 1073255, 1120315, 1395736, 1488788, 1489466, 1489947, 1414739, 1735811, 1820171 },
53-
BackgroundColor = new List<string> { colors[2] },
54-
BorderColor = new List<string> { colors[2] },
55-
BorderWidth = new List<double> { 2 },
56-
HoverBorderWidth = new List<double> { 4 },
57-
PointBackgroundColor = new List<string> { colors[2] },
58-
PointRadius = new List<int> { 3 }, // show points
59-
PointHoverRadius = new List<int> { 4 },
53+
BackgroundColor = colors[2],
54+
BorderColor = colors[2],
55+
BorderWidth = 2,
56+
HoverBorderWidth = 4,
57+
PointBackgroundColor = colors[2],
58+
PointRadius = 3, // show points
59+
PointHoverRadius = 4,
6060

6161
// datalabels
62-
Datalabels = new() { Align = "start", Anchor = "start" }
62+
Datalabels = new() { Alignment = Alignment.Start, Anchor = Anchor.Start }
6363
};
6464
datasets.Add(dataset3);
6565

BlazorBootstrap.Demo.RCL/Components/Pages/Charts/LineCharts/LineChart_Demo_05_Tick_Configuration.razor

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@
7777
{
7878
Label = $"Team {datasetsCount}",
7979
Data = GetRandomData(),
80-
BackgroundColor = new List<string> { c.ToRgbString() },
81-
BorderColor = new List<string> { c.ToRgbString() },
82-
BorderWidth = new List<double> { 2 },
83-
HoverBorderWidth = new List<double> { 4 },
84-
PointBackgroundColor = new List<string> { c.ToRgbString() },
85-
PointRadius = new List<int> { 0 }, // hide points
86-
PointHoverRadius = new List<int> { 4 }
80+
BackgroundColor = c.ToRgbString(),
81+
BorderColor = c.ToRgbString(),
82+
BorderWidth = 2,
83+
HoverBorderWidth = 4,
84+
PointBackgroundColor = c.ToRgbString(),
85+
PointRadius = 0, // hide points
86+
PointHoverRadius = 4,
8787
};
8888
}
8989

BlazorBootstrap.Demo.RCL/Components/Pages/Charts/PieCharts/PieChart_Demo_02_Datalabels.razor

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@
9898
var dataset = GetRandomPieChartDataset();
9999

100100
if (index == 0)
101-
dataset.Datalabels.Anchor = "end";
101+
dataset.Datalabels.Anchor = Anchor.End;
102102
else if (index == numberOfDatasets - 1)
103-
dataset.Datalabels.Anchor = "end";
103+
dataset.Datalabels.Anchor = Anchor.End;
104104
else
105-
dataset.Datalabels.Anchor = "center";
105+
dataset.Datalabels.Anchor = Anchor.Center;
106106

107107
datasets.Add(dataset);
108108
}

0 commit comments

Comments
 (0)