Skip to content

Commit b97c45a

Browse files
ASP.NET Core Accumulation Charts sample
ASP.NET Core Accumulation Charts sample
1 parent f7bba76 commit b97c45a

File tree

79 files changed

+74850
-2
lines changed

Some content is hidden

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

79 files changed

+74850
-2
lines changed

Pages/Error.cshtml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
@page
2+
@model ErrorModel
3+
@{
4+
ViewData["Title"] = "Error";
5+
}
6+
7+
<h1 class="text-danger">Error.</h1>
8+
<h2 class="text-danger">An error occurred while processing your request.</h2>
9+
10+
@if (Model.ShowRequestId)
11+
{
12+
<p>
13+
<strong>Request ID:</strong> <code>@Model.RequestId</code>
14+
</p>
15+
}
16+
17+
<h3>Development Mode</h3>
18+
<p>
19+
Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred.
20+
</p>
21+
<p>
22+
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
23+
It can result in displaying sensitive information from exceptions to end users.
24+
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
25+
and restarting the app.
26+
</p>

Pages/Error.cshtml.cs

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using Microsoft.AspNetCore.Mvc;
2+
using Microsoft.AspNetCore.Mvc.RazorPages;
3+
using System.Diagnostics;
4+
5+
namespace mycoreproject.Pages
6+
{
7+
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
8+
[IgnoreAntiforgeryToken]
9+
public class ErrorModel : PageModel
10+
{
11+
public string? RequestId { get; set; }
12+
13+
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
14+
15+
private readonly ILogger<ErrorModel> _logger;
16+
17+
public ErrorModel(ILogger<ErrorModel> logger)
18+
{
19+
_logger = logger;
20+
}
21+
22+
public void OnGet()
23+
{
24+
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
25+
}
26+
}
27+
28+
}

Pages/Index.cshtml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
@page
2+
@model IndexModel
3+
@{
4+
ViewData["Title"] = "Home page";
5+
List<ChartData> Data = new List<ChartData>()
6+
{
7+
new ChartData { Browser= "Chrome", Users= 59.28 },
8+
new ChartData { Browser= "UC Browser", Users= 4.37 },
9+
new ChartData { Browser= "Internet Explorer", Users= 6.12 },
10+
new ChartData { Browser= "Sogou Explorer", Users= 1.73 },
11+
new ChartData { Browser= "QQ", Users= 3.96 },
12+
new ChartData { Browser= "Safari", Users= 4.73 },
13+
new ChartData { Browser= "Opera", Users= 3.12 },
14+
new ChartData { Browser= "Edge", Users= 7.48 },
15+
new ChartData { Browser= "Others", Users= 9.57 }
16+
};
17+
}
18+
19+
<ejs-accumulationchart id="chart" title="Browser Market Share">
20+
<e-accumulationchart-tooltipsettings enable=true>
21+
</e-accumulationchart-tooltipsettings>
22+
<e-accumulation-series-collection>
23+
<e-accumulation-series type="Pyramid"
24+
dataSource="Data"
25+
xName="Browser"
26+
yName="Users">
27+
<e-accumulationseries-datalabel visible=true>
28+
</e-accumulationseries-datalabel>
29+
</e-accumulation-series>
30+
</e-accumulation-series-collection>
31+
</ejs-accumulationchart>

Pages/Index.cshtml.cs

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using Microsoft.AspNetCore.Mvc;
2+
using Microsoft.AspNetCore.Mvc.RazorPages;
3+
4+
namespace mycoreproject.Pages
5+
{
6+
public class ChartData
7+
{
8+
public string Browser { get; set; }
9+
public double Users { get; set; }
10+
}
11+
public class IndexModel : PageModel
12+
{
13+
public void OnGet()
14+
{
15+
16+
}
17+
}
18+
}

Pages/Privacy.cshtml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@page
2+
@model PrivacyModel
3+
@{
4+
ViewData["Title"] = "Privacy Policy";
5+
}
6+
<h1>@ViewData["Title"]</h1>
7+
8+
<p>Use this page to detail your site's privacy policy.</p>

Pages/Privacy.cshtml.cs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using Microsoft.AspNetCore.Mvc;
2+
using Microsoft.AspNetCore.Mvc.RazorPages;
3+
4+
namespace mycoreproject.Pages
5+
{
6+
public class PrivacyModel : PageModel
7+
{
8+
private readonly ILogger<PrivacyModel> _logger;
9+
10+
public PrivacyModel(ILogger<PrivacyModel> logger)
11+
{
12+
_logger = logger;
13+
}
14+
15+
public void OnGet()
16+
{
17+
}
18+
}
19+
20+
}

Pages/Shared/_Layout.cshtml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>@ViewData["Title"] - mycoreproject</title>
7+
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
8+
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
9+
<link rel="stylesheet" href="~/mycoreproject.styles.css" asp-append-version="true" />
10+
<script src="https://cdn.syncfusion.com/ej2/24.1.46/dist/ej2.min.js"></script>
11+
</head>
12+
<body>
13+
<div class="container" style="padding:10px">
14+
<main role="main" class="pb-3">
15+
@RenderBody()
16+
</main>
17+
</div>
18+
19+
<script src="~/lib/jquery/dist/jquery.min.js"></script>
20+
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
21+
<script src="~/js/site.js" asp-append-version="true"></script>
22+
23+
@await RenderSectionAsync("Scripts", required: false)
24+
<ejs-scripts></ejs-scripts>
25+
</body>
26+
</html>

Pages/Shared/_Layout.cshtml.css

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/* Please see documentation at https://learn.microsoft.com/aspnet/core/client-side/bundling-and-minification
2+
for details on configuring this project to bundle and minify static web assets. */
3+
4+
a.navbar-brand {
5+
white-space: normal;
6+
text-align: center;
7+
word-break: break-all;
8+
}
9+
10+
a {
11+
color: #0077cc;
12+
}
13+
14+
.btn-primary {
15+
color: #fff;
16+
background-color: #1b6ec2;
17+
border-color: #1861ac;
18+
}
19+
20+
.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
21+
color: #fff;
22+
background-color: #1b6ec2;
23+
border-color: #1861ac;
24+
}
25+
26+
.border-top {
27+
border-top: 1px solid #e5e5e5;
28+
}
29+
.border-bottom {
30+
border-bottom: 1px solid #e5e5e5;
31+
}
32+
33+
.box-shadow {
34+
box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
35+
}
36+
37+
button.accept-policy {
38+
font-size: 1rem;
39+
line-height: inherit;
40+
}
41+
42+
.footer {
43+
position: absolute;
44+
bottom: 0;
45+
width: 100%;
46+
white-space: nowrap;
47+
line-height: 60px;
48+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script>
2+
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>

Pages/_ViewImports.cshtml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@using mycoreproject
2+
@namespace mycoreproject.Pages
3+
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
4+
@addTagHelper *, Syncfusion.EJ2

Pages/_ViewStart.cshtml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@{
2+
Layout = "_Layout";
3+
}

Program.cs

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
var builder = WebApplication.CreateBuilder(args);
2+
3+
// Add services to the container.
4+
builder.Services.AddRazorPages();
5+
6+
var app = builder.Build();
7+
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("Enter your license");
8+
9+
// Configure the HTTP request pipeline.
10+
if (!app.Environment.IsDevelopment())
11+
{
12+
app.UseExceptionHandler("/Error");
13+
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
14+
app.UseHsts();
15+
}
16+
17+
app.UseHttpsRedirection();
18+
app.UseStaticFiles();
19+
20+
app.UseRouting();
21+
22+
app.UseAuthorization();
23+
24+
app.MapRazorPages();
25+
26+
app.Run();

Properties/launchSettings.json

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"$schema": "http://json.schemastore.org/launchsettings.json",
3+
"iisSettings": {
4+
"windowsAuthentication": false,
5+
"anonymousAuthentication": true,
6+
"iisExpress": {
7+
"applicationUrl": "http://localhost:8238",
8+
"sslPort": 44355
9+
}
10+
},
11+
"profiles": {
12+
"http": {
13+
"commandName": "Project",
14+
"dotnetRunMessages": true,
15+
"launchBrowser": true,
16+
"applicationUrl": "http://localhost:5007",
17+
"environmentVariables": {
18+
"ASPNETCORE_ENVIRONMENT": "Development"
19+
}
20+
},
21+
"https": {
22+
"commandName": "Project",
23+
"dotnetRunMessages": true,
24+
"launchBrowser": true,
25+
"applicationUrl": "https://localhost:7212;http://localhost:5007",
26+
"environmentVariables": {
27+
"ASPNETCORE_ENVIRONMENT": "Development"
28+
}
29+
},
30+
"IIS Express": {
31+
"commandName": "IISExpress",
32+
"launchBrowser": true,
33+
"environmentVariables": {
34+
"ASPNETCORE_ENVIRONMENT": "Development"
35+
}
36+
}
37+
}
38+
}

README.md

+19-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,19 @@
1-
# getting-started-with-the-aspdotnet-core-accumulation-charts-control
2-
A quick-start project that shows how to add an Accumulation chart to a Syncfusion ASP.NET Core web application. This project contains simple code to create various Accumulation Charts, including pie, doughnut, pyramid, and funnel with a title, legend, data label, and tooltip.
1+
# Getting Started with the ASP.NET Core Accumulation Charts Control
2+
3+
A quick-start project that shows how to add an Accumulation chart to a Syncfusion ASP.NET Core web application. This project contains simple code to create various Accumulation Charts, including pie, doughnut, pyramid, and funnel with a title, legend, data label, and tooltip.
4+
5+
Refer to the getting started documentation for the Syncfusion ASP.NET Core Accumulation Charts component:
6+
https://ej2.syncfusion.com/aspnetcore/documentation/accumulation-chart/getting-started
7+
8+
Check out this online example for the Syncfusion ASP.NET Core Accumulation Charts component:
9+
https://ej2.syncfusion.com/aspnetcore/Chart/Pie#/fluent
10+
11+
Tutorial video: https://www.syncfusion.com/tutorial-videos
12+
13+
## Project pre-requisites
14+
15+
Make sure that you have the compatible versions of Visual Studio 2022 and .NET 8.0 SDK framework in your machine before starting to work on this project.
16+
17+
### How to run this application?
18+
19+
To run this application, you need to clone the `getting-started-with-the-aspdotnet-core--accumulation-charts-control` repository and then press the `F5` key to run the application.

appsettings.Development.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"DetailedErrors": true,
3+
"Logging": {
4+
"LogLevel": {
5+
"Default": "Information",
6+
"Microsoft.AspNetCore": "Warning"
7+
}
8+
}
9+
}

appsettings.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning"
6+
}
7+
},
8+
"AllowedHosts": "*"
9+
}

mycoreproject.csproj

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Syncfusion.EJ2.AspNet.Core" Version="24.2.4" />
11+
</ItemGroup>
12+
13+
</Project>

mycoreproject.csproj.user

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<ActiveDebugProfile>https</ActiveDebugProfile>
5+
</PropertyGroup>
6+
</Project>

mycoreproject.sln

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.8.34511.84
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mycoreproject", "mycoreproject.csproj", "{0C61CF14-7BCF-445E-9051-6488DA1FAD8B}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{0C61CF14-7BCF-445E-9051-6488DA1FAD8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{0C61CF14-7BCF-445E-9051-6488DA1FAD8B}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{0C61CF14-7BCF-445E-9051-6488DA1FAD8B}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{0C61CF14-7BCF-445E-9051-6488DA1FAD8B}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {A493AAC3-8284-45CD-BE9A-801B9873FE4C}
24+
EndGlobalSection
25+
EndGlobal

0 commit comments

Comments
 (0)