Skip to content

Commit ea1f20e

Browse files
committed
Initial commit
Initial commit
1 parent 0119c43 commit ea1f20e

File tree

1,147 files changed

+1726
-113260
lines changed

Some content is hidden

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

1,147 files changed

+1726
-113260
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,8 @@ _[Ss]cripts
7373
*.dll
7474
*.nupkg
7575
*.ncrunchsolution
76-
*.dot[Cc]over
76+
*.dot[Cc]over
77+
# dependencies
78+
node_modules
79+
wwwroot
80+
**/wwwroot/lib
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
using DataChart_Core_Overview.Models;
2+
using Infragistics.Web.Mvc;
3+
using Interfaces;
4+
using Microsoft.AspNetCore.Mvc;
5+
using Microsoft.Extensions.Logging;
6+
using System.Collections.Generic;
7+
using System.Diagnostics;
8+
9+
namespace DataChart_Core_Overview.Controllers
10+
{
11+
public class HomeController : Controller
12+
{
13+
private readonly ILogger<HomeController> _logger;
14+
private IUnitOfWork _unitOfWork;
15+
16+
public HomeController(ILogger<HomeController> logger, IUnitOfWork unitOfWork)
17+
{
18+
_logger = logger;
19+
_unitOfWork = unitOfWork;
20+
}
21+
22+
public IActionResult Index()
23+
{
24+
IList<DataChart> charts = new List<DataChart>();
25+
charts.Add(new DataChart { ID = "columnChart", Chart = createChartModel("Column") });
26+
charts.Add(new DataChart { ID = "PointChart", Chart = createChartModel("Point") });
27+
charts.Add(new DataChart { ID = "LineChart", Chart = createChartModel("Line") });
28+
charts.Add(new DataChart { ID = "SplineChart", Chart = createChartModel("Spline") });
29+
charts.Add(new DataChart { ID = "AreaChart", Chart = createChartModel("Area") });
30+
charts.Add(new DataChart { ID = "SplineAreaChart", Chart = createChartModel("Spline Area") });
31+
charts.Add(new DataChart { ID = "StepLineChart", Chart = createChartModel("Step Line") });
32+
charts.Add(new DataChart { ID = "StepArea", Chart = createChartModel("Step Area") });
33+
charts.Add(new DataChart { ID = "WaterfallChart", Chart = createChartModel("Waterfall") });
34+
35+
return View(charts);
36+
}
37+
38+
public IActionResult Privacy()
39+
{
40+
return View();
41+
}
42+
43+
private DataChartModel createChartModel(string type)
44+
{
45+
var model = new DataChartModel();
46+
string width = "350px";
47+
string height = "300px";
48+
model.DataSource = _unitOfWork.Categories.GetUnitsSoldByMonthForSpecificCountries();
49+
50+
if (type == "Column")
51+
{
52+
width = "900px";
53+
height = "400px";
54+
model.Legend = new LegendModel { ID = "legend" };
55+
model.Subtitle = "How many uniter have been sold from each product category";
56+
model.DataSource = _unitOfWork.Categories.GetSpecificCountries();
57+
}
58+
59+
model.Title = type == "Column" ? "Units sold by category" : type;
60+
model.Width = width;
61+
model.Height = height;
62+
63+
model.Axes.Add(new CategoryXAxisModel
64+
{
65+
Name = "xAxis",
66+
Title = type == "Column" ? "Product Category" : null,
67+
Label = type == "Column" ? "Category" : "Month",
68+
TopMargin = 10
69+
});
70+
71+
model.Axes.Add(new NumericYAxisModel
72+
{
73+
Name = "yAxis",
74+
Title = type == "Column" ? "Product Category" : null,
75+
MaximumValue = type == "Column" ? 1900 : 300,
76+
RightMargin = 5
77+
});
78+
79+
model.Series.Add(createSeries("USA", "USA", type));
80+
model.Series.Add(createSeries("Germany", "Germany", type));
81+
model.Series.Add(createSeries("Brazil", "Brazil", type));
82+
83+
return model;
84+
}
85+
86+
private SeriesModel createSeries(string seriesMemberPath, string seriesName, string type)
87+
{
88+
HorizontalAnchoredCategorySeriesModel series;
89+
90+
switch (type)
91+
{
92+
case "Point":
93+
series = new PointSeriesModel();
94+
break;
95+
96+
case "Line":
97+
series = new LineSeriesModel();
98+
break;
99+
100+
case "Spline":
101+
series = new SplineSeriesModel();
102+
break;
103+
104+
case "Area":
105+
series = new AreaSeriesModel();
106+
break;
107+
108+
case "Spline Area":
109+
series = new SplineAreaSeriesModel();
110+
break;
111+
112+
case "Step Line":
113+
series = new StepLineSeriesModel();
114+
break;
115+
116+
case "Step Area":
117+
series = new StepAreaSeriesModel();
118+
break;
119+
120+
case "Waterfall":
121+
series = new WaterfallSeriesModel();
122+
break;
123+
124+
default:
125+
series = new ColumnSeriesModel();
126+
break;
127+
}
128+
129+
series.XAxis = "xAxis";
130+
series.YAxis = "yAxis";
131+
series.Name = seriesName;
132+
series.Title = seriesName;
133+
series.ValueMemberPath = seriesMemberPath;
134+
series.MarkerType = type == "Point" ? MarkerType.Circle : MarkerType.None;
135+
series.Thickness = (type == "Column" && type == "waterfall") ? 1 : 3;
136+
series.IsTransitionInEnabled = true;
137+
series.IsHighlightingEnabled = true;
138+
series.ShowTooltip = true;
139+
140+
return series;
141+
}
142+
143+
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
144+
public IActionResult Error()
145+
{
146+
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
147+
}
148+
}
149+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<RootNamespace>DataChart_Core_Overview</RootNamespace>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<PackageReference Include="Infragistics.Web.AspNetCore" Version="6.20.1.9" />
10+
</ItemGroup>
11+
12+
<ItemGroup>
13+
<ProjectReference Include="..\Persistence\Repositories\Repositories.csproj" />
14+
</ItemGroup>
15+
16+
</Project>

ASP.NET-Core-Samples.sln renamed to DataChart-Core-Overview/DataChart-Core-Overview.sln

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.28307.489
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.30413.136
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Scheduler-Core-CRUD", "Scheduler-Core-CRUD\Scheduler-Core-CRUD.csproj", "{7ADEA363-6771-4B85-A22A-199CBEE8A8B9}"
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DataChart-Core-Overview", "DataChart-Core-Overview.csproj", "{24FA6B75-D366-4133-AC4C-73404CF5B7E3}"
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1010
Debug|Any CPU = Debug|Any CPU
1111
Release|Any CPU = Release|Any CPU
1212
EndGlobalSection
1313
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{7ADEA363-6771-4B85-A22A-199CBEE8A8B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15-
{7ADEA363-6771-4B85-A22A-199CBEE8A8B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
16-
{7ADEA363-6771-4B85-A22A-199CBEE8A8B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
17-
{7ADEA363-6771-4B85-A22A-199CBEE8A8B9}.Release|Any CPU.Build.0 = Release|Any CPU
14+
{24FA6B75-D366-4133-AC4C-73404CF5B7E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{24FA6B75-D366-4133-AC4C-73404CF5B7E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{24FA6B75-D366-4133-AC4C-73404CF5B7E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{24FA6B75-D366-4133-AC4C-73404CF5B7E3}.Release|Any CPU.Build.0 = Release|Any CPU
1818
EndGlobalSection
1919
GlobalSection(SolutionProperties) = preSolution
2020
HideSolutionNode = FALSE
2121
EndGlobalSection
2222
GlobalSection(ExtensibilityGlobals) = postSolution
23-
SolutionGuid = {63690AE1-4DD5-4D97-8050-74967EA7C290}
23+
SolutionGuid = {0D147159-7BA6-4D41-BF4E-DE0FA10B363B}
2424
EndGlobalSection
2525
EndGlobal
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using Infragistics.Web.Mvc;
2+
3+
namespace DataChart_Core_Overview.Models
4+
{
5+
public class DataChart
6+
{
7+
public string ID;
8+
public DataChartModel Chart;
9+
}
10+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using System;
2+
3+
namespace DataChart_Core_Overview.Models
4+
{
5+
public class ErrorViewModel
6+
{
7+
public string RequestId { get; set; }
8+
9+
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
10+
}
11+
}

DataChart-Core-Overview/Program.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using Microsoft.AspNetCore.Hosting;
2+
using Microsoft.Extensions.Hosting;
3+
4+
namespace DataChart_Core_Overview
5+
{
6+
public class Program
7+
{
8+
public static void Main(string[] args)
9+
{
10+
CreateHostBuilder(args).Build().Run();
11+
}
12+
13+
public static IHostBuilder CreateHostBuilder(string[] args) =>
14+
Host.CreateDefaultBuilder(args)
15+
.ConfigureWebHostDefaults(webBuilder =>
16+
{
17+
webBuilder.UseStartup<Startup>();
18+
});
19+
}
20+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"iisSettings": {
3+
"windowsAuthentication": false,
4+
"anonymousAuthentication": true,
5+
"iisExpress": {
6+
"applicationUrl": "http://localhost:50779",
7+
"sslPort": 44332
8+
}
9+
},
10+
"profiles": {
11+
"IIS Express": {
12+
"commandName": "IISExpress",
13+
"launchBrowser": true,
14+
"environmentVariables": {
15+
"ASPNETCORE_ENVIRONMENT": "Development"
16+
}
17+
},
18+
"DataChart_Core_Overview": {
19+
"commandName": "Project",
20+
"launchBrowser": true,
21+
"applicationUrl": "https://localhost:5001;http://localhost:5000",
22+
"environmentVariables": {
23+
"ASPNETCORE_ENVIRONMENT": "Development"
24+
}
25+
}
26+
}
27+
}

DataChart-Core-Overview/Startup.cs

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
using Microsoft.AspNetCore.Builder;
2+
using Microsoft.AspNetCore.Hosting;
3+
using Microsoft.Extensions.Configuration;
4+
using Microsoft.Extensions.DependencyInjection;
5+
using Microsoft.Extensions.Hosting;
6+
using Repositories;
7+
8+
namespace DataChart_Core_Overview
9+
{
10+
public class Startup
11+
{
12+
public Startup(IConfiguration configuration, IWebHostEnvironment env)
13+
{
14+
Configuration = configuration;
15+
}
16+
17+
public IConfiguration Configuration { get; }
18+
19+
// This method gets called by the runtime. Use this method to add services to the container.
20+
public void ConfigureServices(IServiceCollection services)
21+
{
22+
services.AddPersistence(Configuration);
23+
services.AddControllersWithViews();
24+
}
25+
26+
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
27+
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
28+
{
29+
if (env.IsDevelopment())
30+
{
31+
app.UseDeveloperExceptionPage();
32+
}
33+
else
34+
{
35+
app.UseExceptionHandler("/Home/Error");
36+
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
37+
app.UseHsts();
38+
}
39+
app.UseHttpsRedirection();
40+
app.UseStaticFiles();
41+
42+
app.UseRouting();
43+
44+
app.UseAuthorization();
45+
46+
app.UseEndpoints(endpoints =>
47+
{
48+
endpoints.MapControllerRoute(
49+
name: "default",
50+
pattern: "{controller=Home}/{action=Index}/{id?}");
51+
});
52+
}
53+
}
54+
}

0 commit comments

Comments
 (0)