Skip to content

Commit 6e65322

Browse files
authored
Code improvements (#745)
1 parent 3851f6c commit 6e65322

86 files changed

Lines changed: 291 additions & 449 deletions

File tree

Some content is hidden

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

BlazorBootstrap.Demo.RCL/Components/Pages/Charts/BarCharts/BarChart_Demo_01_Examples.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120

121121
private BarChartDataset GetRandomBarChartDataset()
122122
{
123-
var c = ColorBuilder.CategoricalTwelveColors[datasetsCount].ToColor();
123+
var c = ColorUtility.CategoricalTwelveColors[datasetsCount].ToColor();
124124

125125
datasetsCount += 1;
126126

BlazorBootstrap.Demo.RCL/Components/Pages/Charts/BarCharts/BarChart_Demo_02_Horizontal_BarChart.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
var dataset1 = new BarChartDataset()
1414
{
1515
Data = new List<double> { 55000, 15000, 18000, 21000 },
16-
BackgroundColor = new List<string> { ColorBuilder.CategoricalTwelveColors[0] },
17-
BorderColor = new List<string> { ColorBuilder.CategoricalTwelveColors[0] },
16+
BackgroundColor = new List<string> { ColorUtility.CategoricalTwelveColors[0] },
17+
BorderColor = new List<string> { ColorUtility.CategoricalTwelveColors[0] },
1818
BorderWidth = new List<double> { 0 },
1919
};
2020
datasets.Add(dataset1);

BlazorBootstrap.Demo.RCL/Components/Pages/Charts/BarCharts/BarChart_Demo_03_Stacked_BarChart.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
protected override void OnInitialized()
99
{
10-
var colors = ColorBuilder.CategoricalTwelveColors;
10+
var colors = ColorUtility.CategoricalTwelveColors;
1111

1212
var labels = new List<string> { "Chrome", "Firefox", "Safari", "Edge" };
1313
var datasets = new List<IChartDataset>();

BlazorBootstrap.Demo.RCL/Components/Pages/Charts/BarCharts/BarChart_Demo_04_Locale.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
protected override void OnInitialized()
99
{
10-
var colors = ColorBuilder.CategoricalTwelveColors;
10+
var colors = ColorUtility.CategoricalTwelveColors;
1111

1212
var labels = new List<string> { "Chrome", "Firefox", "Safari", "Edge" };
1313
var datasets = new List<IChartDataset>();

BlazorBootstrap.Demo.RCL/Components/Pages/Charts/BarCharts/BarChart_Demo_05_Stacked_BarChart_with_Datalabels.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
protected override void OnInitialized()
99
{
10-
var colors = ColorBuilder.CategoricalTwelveColors;
10+
var colors = ColorUtility.CategoricalTwelveColors;
1111

1212
var labels = new List<string> { "Chrome", "Firefox", "Safari", "Edge" };
1313
var datasets = new List<IChartDataset>();

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

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,12 @@
4848

4949
options.Plugins.Title!.Text = "MANHATTAN";
5050
options.Plugins.Title.Display = true;
51-
options.Plugins.Title.Font!.Size = 20;
51+
options.Plugins.Title.Font = new ChartFont { Size = 20 };
5252

5353
options.Responsive = true;
5454

55-
options.Scales.X!.Title!.Text = "Overs";
56-
options.Scales.X.Title.Display = true;
57-
58-
options.Scales.Y!.Title!.Text = "Runs";
59-
options.Scales.Y.Title.Display = true;
55+
options.Scales.X!.Title = new ChartAxesTitle { Text = "Overs", Display = true };
56+
options.Scales.Y!.Title = new ChartAxesTitle { Text = "Runs", Display = true };
6057

6158
await barChart.InitializeAsync(data, options);
6259
}
@@ -103,15 +100,12 @@
103100

104101
options.Plugins.Title!.Text = "WORM";
105102
options.Plugins.Title.Display = true;
106-
options.Plugins.Title.Font!.Size = 20;
103+
options.Plugins.Title.Font = new ChartFont { Size = 20 };
107104

108105
options.Responsive = true;
109106

110-
options.Scales.X!.Title!.Text = "Overs";
111-
options.Scales.X.Title.Display = true;
112-
113-
options.Scales.Y!.Title!.Text = "Runs";
114-
options.Scales.Y.Title.Display = true;
107+
options.Scales.X!.Title = new ChartAxesTitle { Text = "Overs", Display = true };
108+
options.Scales.Y!.Title = new ChartAxesTitle { Text = "Runs", Display = true };
115109

116110
await lineChart.InitializeAsync(data, options);
117111
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
protected override void OnInitialized()
2121
{
22-
backgroundColors = ColorBuilder.CategoricalTwelveColors;
22+
backgroundColors = ColorUtility.CategoricalTwelveColors;
2323
chartData = new ChartData { Labels = GetDefaultDataLabels(4), Datasets = GetDefaultDataSets(1) };
2424

2525
doughnutChartOptions = new();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
protected override void OnInitialized()
2020
{
21-
backgroundColors = ColorBuilder.CategoricalTwelveColors;
21+
backgroundColors = ColorUtility.CategoricalTwelveColors;
2222
chartData = new ChartData { Labels = GetDefaultDataLabels(4), Datasets = GetDefaultDataSets(3) };
2323

2424
doughnutChartOptions = new();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114

115115
private LineChartDataset GetRandomLineChartDataset()
116116
{
117-
var c = ColorBuilder.CategoricalTwelveColors[datasetsCount].ToColor();
117+
var c = ColorUtility.CategoricalTwelveColors[datasetsCount].ToColor();
118118

119119
datasetsCount += 1;
120120

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
protected override void OnInitialized()
99
{
10-
var colors = ColorBuilder.CategoricalTwelveColors;
10+
var colors = ColorUtility.CategoricalTwelveColors;
1111

1212
var labels = new List<string> { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" };
1313
var datasets = new List<IChartDataset>();

0 commit comments

Comments
 (0)