Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polar Area Chart + Other improvements #773

Merged
merged 4 commits into from
Jun 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@
#*.RTF diff=astextplain

# blazor dlls
*.dll binary
*.dll binary
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
##
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore

# User-specific files
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ internal override IEnumerable<NavItem> GetNavItems()
new (){ Id = "601", Text = "Doughnut Chart", Href = "/charts/doughnut-chart", IconName = IconName.CircleFill, ParentId = "6", Match = NavLinkMatch.All },
new (){ Id = "602", Text = "Line Chart", Href = "/charts/line-chart", IconName = IconName.GraphUp, ParentId = "6", Match = NavLinkMatch.All },
new (){ Id = "603", Text = "Pie Chart", Href = "/charts/pie-chart", IconName = IconName.PieChartFill, ParentId = "6", Match = NavLinkMatch.All },
new (){ Id = "604", Text = "Polar Area Chart", Href = "/charts/polar-area-chart", IconName = IconName.PieChartFill, ParentId = "6", Match = NavLinkMatch.All },

new(){ Id = "7", Text = "Services", IconName = IconName.WrenchAdjustableCircleFill, IconColor = IconColor.Success },
new (){ Id = "700", Text = "Modal Service", Href = "/modal-service", IconName = IconName.WindowStack, ParentId = "7" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
<li><a href="/charts/doughnut-chart">Doughnut Chart</a></li>
<li><a href="/charts/line-chart">Line Chart</a></li>
<li><a href="/charts/pie-chart">Pie Chart</a></li>
<li><a href="/charts/polar-area-chart">Polar Area Chart</a></li>
</ol>

<Callout Color="CalloutColor.Info">
We will add Bubble Chart, Polar Area Chart, Radar Chart, Scatter Chart, and Mixed Chart support in the subsequent versions.
We will add Bubble Chart, Radar Chart, Scatter Chart, and Mixed Chart support in the subsequent versions.
</Callout>

<SectionHeading Size="HeadingSize.H4" Text="Charts Setup" PageUrl="@pageUrl" HashTagName="charts-setup" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,27 +69,27 @@
{
Label = "India",
Data = new List<double>{ 9, 20, 29, 33, 50, 66, 75, 86, 91, 105, 120, 126, 141, 150, 156, 164, 177, 180, 184, 195 },
BackgroundColor = new List<string>{ "rgb(88, 80, 141)" },
BorderColor = new List<string>{ "rgb(88, 80, 141)" },
BorderWidth = new List<double>{2},
HoverBorderWidth = new List<double>{4},
PointBackgroundColor = new List<string>{ "rgb(88, 80, 141)" },
PointBorderColor = new List<string>{ "rgb(88, 80, 141)" },
PointRadius = new List<int>{0}, // hide points
PointHoverRadius = new List<int>{4},
BackgroundColor = "rgb(88, 80, 141)",
BorderColor = "rgb(88, 80, 141)",
BorderWidth = 2,
HoverBorderWidth = 4,
PointBackgroundColor = "rgb(88, 80, 141)",
PointBorderColor = "rgb(88, 80, 141)",
PointRadius = 0, // hide points
PointHoverRadius = 4,
},
new LineChartDataset()
{
Label = "England",
Data = new List<double>{ 1, 1, 8, 19, 24, 26, 39, 47, 56, 66, 75, 88, 95, 100, 109, 114, 124, 129, 140, 142 },
BackgroundColor = new List<string>{ "rgb(255, 166, 0)" },
BorderColor = new List<string>{ "rgb(255, 166, 0)" },
BorderWidth = new List<double>{2},
HoverBorderWidth = new List<double>{4},
PointBackgroundColor = new List<string>{ "rgb(255, 166, 0)" },
PointBorderColor = new List<string>{ "rgb(255, 166, 0)" },
PointRadius = new List<int>{0}, // hide points
PointHoverRadius = new List<int>{4},
BackgroundColor = "rgb(255, 166, 0)",
BorderColor = "rgb(255, 166, 0)",
BorderWidth = 2,
HoverBorderWidth = 4,
PointBackgroundColor = "rgb(255, 166, 0)",
PointBorderColor = "rgb(255, 166, 0)",
PointRadius = 0, // hide points
PointHoverRadius = 4,
}
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@
var dataset = GetRandomDoughnutChartDataset();

if (index == 0)
dataset.Datalabels.Anchor = "end";
dataset.Datalabels.Anchor = Anchor.End;
else if (index == numberOfDatasets - 1)
dataset.Datalabels.Anchor = "start";
dataset.Datalabels.Anchor = Anchor.Start;
else
dataset.Datalabels.Anchor = "center";
dataset.Datalabels.Anchor = Anchor.Center;

datasets.Add(dataset);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@
{
Label = $"Team {datasetsCount}",
Data = GetRandomData(),
BackgroundColor = new List<string> { c.ToRgbString() },
BorderColor = new List<string> { c.ToRgbString() },
BorderWidth = new List<double> { 2 },
HoverBorderWidth = new List<double> { 4 },
PointBackgroundColor = new List<string> { c.ToRgbString() },
PointRadius = new List<int> { 0 }, // hide points
PointHoverRadius = new List<int> { 4 }
BackgroundColor = c.ToRgbString(),
BorderColor = c.ToRgbString(),
BorderWidth = 2,
HoverBorderWidth = 4,
PointBackgroundColor = c.ToRgbString(),
PointRadius = 0, // hide points
PointHoverRadius = 4,
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,41 +16,41 @@
{
Label = "Windows",
Data = new List<double> { 7265791, 5899643, 6317759, 6315641, 5338211, 8496306, 7568556, 8538933, 8274297, 8657298, 7548388, 7764845 },
BackgroundColor = new List<string> { colors[0] },
BorderColor = new List<string> { colors[0] },
BorderWidth = new List<double> { 2 },
HoverBorderWidth = new List<double> { 4 },
PointBackgroundColor = new List<string> { colors[0] },
PointRadius = new List<int> { 0 }, // hide points
PointHoverRadius = new List<int> { 4 }
BackgroundColor = colors[0],
BorderColor = colors[0],
BorderWidth = 2,
HoverBorderWidth = 4,
PointBackgroundColor = colors[0],
PointRadius = 0, // hide points
PointHoverRadius = 4,
};
datasets.Add(dataset1);

var dataset2 = new LineChartDataset
{
Label = "macOS",
Data = new List<double> { 1809499, 1816642, 2122410, 1809499, 1850793, 1846743, 1954797, 2391313, 1983430, 2469918, 2633303, 2821149 },
BackgroundColor = new List<string> { colors[1] },
BorderColor = new List<string> { colors[1] },
BorderWidth = new List<double> { 2 },
HoverBorderWidth = new List<double> { 4 },
PointBackgroundColor = new List<string> { colors[1] },
PointRadius = new List<int> { 0 }, // hide points
PointHoverRadius = new List<int> { 4 }
BackgroundColor = colors[1],
BorderColor = colors[1],
BorderWidth = 2,
HoverBorderWidth = 4,
PointBackgroundColor = colors[1],
PointRadius = 0, // hide points
PointHoverRadius = 4,
};
datasets.Add(dataset2);

var dataset3 = new LineChartDataset
{
Label = "Other",
Data = new List<double> { 1081241, 1100363, 1118136, 1073255, 1120315, 1395736, 1488788, 1489466, 1489947, 1414739, 1735811, 1820171 },
BackgroundColor = new List<string> { colors[2] },
BorderColor = new List<string> { colors[2] },
BorderWidth = new List<double> { 2 },
HoverBorderWidth = new List<double> { 4 },
PointBackgroundColor = new List<string> { colors[2] },
PointRadius = new List<int> { 0 }, // hide points
PointHoverRadius = new List<int> { 4 }
BackgroundColor = colors[2],
BorderColor = colors[2],
BorderWidth = 2,
HoverBorderWidth = 4,
PointBackgroundColor = colors[2],
PointRadius = 0, // hide points
PointHoverRadius = 4,
};
datasets.Add(dataset3);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,41 +16,41 @@
{
Label = "Windows",
Data = new List<double> { 7265791, 5899643, 6317759, 6315641, 5338211, 8496306, 7568556, 8538933, 8274297, 8657298, 7548388, 7764845 },
BackgroundColor = new List<string> { colors[0] },
BorderColor = new List<string> { colors[0] },
BorderWidth = new List<double> { 2 },
HoverBorderWidth = new List<double> { 4 },
PointBackgroundColor = new List<string> { colors[0] },
PointRadius = new List<int> { 0 }, // hide points
PointHoverRadius = new List<int> { 4 }
BackgroundColor = colors[0],
BorderColor = colors[0],
BorderWidth = 2,
HoverBorderWidth = 4,
PointBackgroundColor = colors[0],
PointRadius = 0, // hide points
PointHoverRadius = 4,
};
datasets.Add(dataset1);

var dataset2 = new LineChartDataset
{
Label = "macOS",
Data = new List<double> { 1809499, 1816642, 2122410, 1809499, 1850793, 1846743, 1954797, 2391313, 1983430, 2469918, 2633303, 2821149 },
BackgroundColor = new List<string> { colors[1] },
BorderColor = new List<string> { colors[1] },
BorderWidth = new List<double> { 2 },
HoverBorderWidth = new List<double> { 4 },
PointBackgroundColor = new List<string> { colors[1] },
PointRadius = new List<int> { 0 }, // hide points
PointHoverRadius = new List<int> { 4 }
BackgroundColor = colors[1],
BorderColor = colors[1],
BorderWidth = 2,
HoverBorderWidth = 4,
PointBackgroundColor = colors[1],
PointRadius = 0, // hide points
PointHoverRadius = 4,
};
datasets.Add(dataset2);

var dataset3 = new LineChartDataset
{
Label = "Other",
Data = new List<double> { 1081241, 1100363, 1118136, 1073255, 1120315, 1395736, 1488788, 1489466, 1489947, 1414739, 1735811, 1820171 },
BackgroundColor = new List<string> { colors[2] },
BorderColor = new List<string> { colors[2] },
BorderWidth = new List<double> { 2 },
HoverBorderWidth = new List<double> { 4 },
PointBackgroundColor = new List<string> { colors[2] },
PointRadius = new List<int> { 0 }, // hide points
PointHoverRadius = new List<int> { 4 }
BackgroundColor = colors[2],
BorderColor = colors[2],
BorderWidth = 2,
HoverBorderWidth = 4,
PointBackgroundColor = colors[2],
PointRadius = 0, // hide points
PointHoverRadius = 4,
};
datasets.Add(dataset3);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,27 +56,27 @@
{
Label = "India",
Data = new List<double>(),
BackgroundColor = new List<string> { "rgb(88, 80, 141)" },
BorderColor = new List<string> { "rgb(88, 80, 141)" },
BorderWidth = new List<double> { 2 },
HoverBorderWidth = new List<double> { 4 },
PointBackgroundColor = new List<string> { "rgb(88, 80, 141)" },
PointBorderColor = new List<string> { "rgb(88, 80, 141)" },
PointRadius = new List<int> { 0 }, // hide points
PointHoverRadius = new List<int> { 4 }
BackgroundColor = "rgb(88, 80, 141)",
BorderColor = "rgb(88, 80, 141)",
BorderWidth = 2,
HoverBorderWidth = 4,
PointBackgroundColor = "rgb(88, 80, 141)",
PointBorderColor = "rgb(88, 80, 141)",
PointRadius = 0, // hide points
PointHoverRadius = 4,
},
new LineChartDataset
{
Label = "England",
Data = new List<double>(),
BackgroundColor = new List<string> { "rgb(255, 166, 0)" },
BorderColor = new List<string> { "rgb(255, 166, 0)" },
BorderWidth = new List<double> { 2 },
HoverBorderWidth = new List<double> { 4 },
PointBackgroundColor = new List<string> { "rgb(255, 166, 0)" },
PointBorderColor = new List<string> { "rgb(255, 166, 0)" },
PointRadius = new List<int> { 0 }, // hide points
PointHoverRadius = new List<int> { 4 }
BackgroundColor = "rgb(255, 166, 0)",
BorderColor = "rgb(255, 166, 0)",
BorderWidth = 2,
HoverBorderWidth = 4,
PointBackgroundColor = "rgb(255, 166, 0)",
PointBorderColor = "rgb(255, 166, 0)",
PointRadius = 0, // hide points
PointHoverRadius = 4,
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,50 +16,50 @@
{
Label = "Windows",
Data = new List<double> { 7265791, 5899643, 6317759, 6315641, 5338211, 8496306, 7568556, 8538933, 8274297, 8657298, 7548388, 7764845 },
BackgroundColor = new List<string> { colors[0] },
BorderColor = new List<string> { colors[0] },
BorderWidth = new List<double> { 2 },
HoverBorderWidth = new List<double> { 4 },
PointBackgroundColor = new List<string> { colors[0] },
PointRadius = new List<int> { 3 }, // show points
PointHoverRadius = new List<int> { 4 },
BackgroundColor = colors[0],
BorderColor = colors[0],
BorderWidth = 2,
HoverBorderWidth = 4,
PointBackgroundColor = colors[0],
PointRadius = 3, // show points
PointHoverRadius = 4,

// datalabels
Datalabels = new() { Align = "end", Anchor = "end" }
Datalabels = new() { Alignment = Alignment.End, Anchor = Anchor.End }
};
datasets.Add(dataset1);

var dataset2 = new LineChartDataset
{
Label = "macOS",
Data = new List<double> { 1809499, 1816642, 2122410, 1809499, 1850793, 1846743, 1954797, 2391313, 1983430, 2469918, 2633303, 2821149 },
BackgroundColor = new List<string> { colors[1] },
BorderColor = new List<string> { colors[1] },
BorderWidth = new List<double> { 2 },
HoverBorderWidth = new List<double> { 4 },
PointBackgroundColor = new List<string> { colors[1] },
PointRadius = new List<int> { 3 }, // show points
PointHoverRadius = new List<int> { 4 },
BackgroundColor = colors[1],
BorderColor = colors[1],
BorderWidth = 2,
HoverBorderWidth = 4,
PointBackgroundColor = colors[1],
PointRadius = 3, // show points
PointHoverRadius = 4,

// datalabels
Datalabels = new() { Align = "end", Anchor = "end" }
Datalabels = new() { Alignment = Alignment.End, Anchor = Anchor.End }
};
datasets.Add(dataset2);

var dataset3 = new LineChartDataset
{
Label = "Other",
Data = new List<double> { 1081241, 1100363, 1118136, 1073255, 1120315, 1395736, 1488788, 1489466, 1489947, 1414739, 1735811, 1820171 },
BackgroundColor = new List<string> { colors[2] },
BorderColor = new List<string> { colors[2] },
BorderWidth = new List<double> { 2 },
HoverBorderWidth = new List<double> { 4 },
PointBackgroundColor = new List<string> { colors[2] },
PointRadius = new List<int> { 3 }, // show points
PointHoverRadius = new List<int> { 4 },
BackgroundColor = colors[2],
BorderColor = colors[2],
BorderWidth = 2,
HoverBorderWidth = 4,
PointBackgroundColor = colors[2],
PointRadius = 3, // show points
PointHoverRadius = 4,

// datalabels
Datalabels = new() { Align = "start", Anchor = "start" }
Datalabels = new() { Alignment = Alignment.Start, Anchor = Anchor.Start }
};
datasets.Add(dataset3);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@
{
Label = $"Team {datasetsCount}",
Data = GetRandomData(),
BackgroundColor = new List<string> { c.ToRgbString() },
BorderColor = new List<string> { c.ToRgbString() },
BorderWidth = new List<double> { 2 },
HoverBorderWidth = new List<double> { 4 },
PointBackgroundColor = new List<string> { c.ToRgbString() },
PointRadius = new List<int> { 0 }, // hide points
PointHoverRadius = new List<int> { 4 }
BackgroundColor = c.ToRgbString(),
BorderColor = c.ToRgbString(),
BorderWidth = 2,
HoverBorderWidth = 4,
PointBackgroundColor = c.ToRgbString(),
PointRadius = 0, // hide points
PointHoverRadius = 4,
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@
var dataset = GetRandomPieChartDataset();

if (index == 0)
dataset.Datalabels.Anchor = "end";
dataset.Datalabels.Anchor = Anchor.End;
else if (index == numberOfDatasets - 1)
dataset.Datalabels.Anchor = "end";
dataset.Datalabels.Anchor = Anchor.End;
else
dataset.Datalabels.Anchor = "center";
dataset.Datalabels.Anchor = Anchor.Center;

datasets.Add(dataset);
}
Expand Down
Loading
Loading