Skip to content

Commit 7165de4

Browse files
committed
Prepared UG Pyramid and Funnel samples for AccumulationChart control
1 parent 3cafb12 commit 7165de4

File tree

104 files changed

+75443
-22
lines changed

Some content is hidden

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

104 files changed

+75443
-22
lines changed

AccumulationChart/AccumulationChartType/Pages/ColorPalette.cshtml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@* @page
1+
@page
22
@using static AccumulationChartType.Pages.ColorPaletteModel
33
@model AccumulationChartType.Pages.ColorPaletteModel
44
@{
@@ -12,13 +12,14 @@
1212
new PieChartData { xValue = "Opera", yValue = 11 },
1313
new PieChartData { xValue = "Android", yValue = 12 },
1414
};
15+
var palette = new string[] { "teal", "skyblue", "green", "red"};
1516
}
1617

1718
<ejs-accumulationchart id="container" enableBorderOnMouseMove="false">
1819
<e-accumulationchart-legendsettings visible="false">
1920
</e-accumulationchart-legendsettings>
2021
<e-accumulation-series-collection>
21-
<e-accumulation-series dataSource="chartData" xName="xValue" yName="yValue" name="Browser" palettes="['teal', 'skyblue', 'green', 'red']">
22+
<e-accumulation-series dataSource="chartData" xName="xValue" yName="yValue" name="Browser" palettes="palette">
2223
</e-accumulation-series>
2324
</e-accumulation-series-collection>
24-
</ejs-accumulationchart> *@
25+
</ejs-accumulationchart>
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
//using Microsoft.AspNetCore.Mvc;
2-
//using Microsoft.AspNetCore.Mvc.RazorPages;
1+
using Microsoft.AspNetCore.Mvc;
2+
using Microsoft.AspNetCore.Mvc.RazorPages;
33

4-
//namespace AccumulationChartType.Pages
5-
//{
6-
// public class ColorPaletteModel : PageModel
7-
// {
8-
// public void OnGet()
9-
// {
10-
// }
11-
// public class PieChartData
12-
// {
13-
// public string xValue;
14-
// public double yValue;
15-
// }
16-
// }
17-
//}
4+
namespace AccumulationChartType.Pages
5+
{
6+
public class ColorPaletteModel : PageModel
7+
{
8+
public void OnGet()
9+
{
10+
}
11+
public class PieChartData
12+
{
13+
public string xValue;
14+
public double yValue;
15+
}
16+
}
17+
}

AccumulationChart/AccumulationChartType/Pages/Shared/_Layout.cshtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@
4747
<li class="nav-item">
4848
<a class="nav-link text-dark" asp-area="" asp-page="/HidePieDoughnutBorder">HidePie/Doughnut Border</a>
4949
</li>
50-
@* <li class="nav-item">
50+
<li class="nav-item">
5151
<a class="nav-link text-dark" asp-area="" asp-page="/ColorPalette">Color Palette</a>
52-
</li> *@
52+
</li>
5353
@* <li class="nav-item">
54-
<a class="nav-link text-dark" asp-area="" asp-page="/MultiLevelPieChart">Multi Level Pie Chart</a>
54+
<a class="nav-link text-dark" asp-area="" asp-page="/MulriLevelPieChart">Multi Level Pie Chart</a>
5555
</li> *@
5656
<li class="nav-item">
5757
<a class="nav-link text-dark" asp-area="" asp-page="/Privacy">Privacy</a>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
@page
2+
@using static PyramidFunnelTypeSample.Pages.CustomizationModel
3+
@model PyramidFunnelTypeSample.Pages.CustomizationModel
4+
@{
5+
List<PyramidChartData> chartData = new List<PyramidChartData>
6+
{
7+
8+
new PyramidChartData { xValue = "Chrome", yValue = 37 },
9+
new PyramidChartData { xValue = "UC Browser", yValue = 17 },
10+
new PyramidChartData { xValue = "iPhone", yValue = 19 },
11+
new PyramidChartData { xValue = "Others", yValue = 4 },
12+
new PyramidChartData { xValue = "Opera", yValue = 11 },
13+
new PyramidChartData { xValue = "Android", yValue = 12 },
14+
};
15+
}
16+
17+
<ejs-accumulationchart id="container" title="Mobile Browser Statistics" pointRender="pointRender">
18+
<e-accumulationchart-legendsettings visible="false">
19+
</e-accumulationchart-legendsettings>
20+
<e-accumulation-series-collection>
21+
<e-accumulation-series dataSource="chartData" xName="xValue" yName="yValue" name="Browser"
22+
type="@Syncfusion.EJ2.Charts.AccumulationType.Pyramid" gapRatio="0.04">
23+
</e-accumulation-series>
24+
</e-accumulation-series-collection>
25+
</ejs-accumulationchart>
26+
27+
<script>
28+
var pointRender = function (args) {
29+
if ((args.point.x).indexOf("iPhone") > -1) {
30+
args.fill = '#f4bc42';
31+
}
32+
else {
33+
args.fill = '#597cf9';
34+
}
35+
};
36+
</script>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using Microsoft.AspNetCore.Mvc;
2+
using Microsoft.AspNetCore.Mvc.RazorPages;
3+
4+
namespace PyramidFunnelTypeSample.Pages
5+
{
6+
public class CustomizationModel : PageModel
7+
{
8+
public void OnGet()
9+
{
10+
}
11+
public class PyramidChartData
12+
{
13+
public string xValue;
14+
public double yValue;
15+
}
16+
}
17+
}
Lines changed: 26 additions & 0 deletions
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>
Lines changed: 28 additions & 0 deletions
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 PyramidFunnelTypeSample.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+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
@page
2+
@using static PyramidFunnelTypeSample.Pages.ExplodeModel
3+
@model PyramidFunnelTypeSample.Pages.ExplodeModel
4+
@{
5+
List<PyramidChartData> chartData = new List<PyramidChartData>
6+
{
7+
new PyramidChartData { xValue = "Chrome", yValue = 37 },
8+
new PyramidChartData { xValue = "UC Browser", yValue = 17 },
9+
new PyramidChartData { xValue = "iPhone", yValue = 19 },
10+
new PyramidChartData { xValue = "Others", yValue = 4 },
11+
new PyramidChartData { xValue = "Opera", yValue = 11 },
12+
new PyramidChartData { xValue = "Android", yValue = 12 },
13+
};
14+
}
15+
16+
<ejs-accumulationchart id="container" title="Mobile Browser Statistics">
17+
<e-accumulationchart-legendsettings visible="false">
18+
</e-accumulationchart-legendsettings>
19+
<e-accumulation-series-collection>
20+
<e-accumulation-series dataSource="chartData" xName="xValue" yName="yValue" name="Browser"
21+
type="@Syncfusion.EJ2.Charts.AccumulationType.Pyramid" explodeIndex="2" explode="true" explodeOffset="10">
22+
</e-accumulation-series>
23+
</e-accumulation-series-collection>
24+
</ejs-accumulationchart>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using Microsoft.AspNetCore.Mvc;
2+
using Microsoft.AspNetCore.Mvc.RazorPages;
3+
4+
namespace PyramidFunnelTypeSample.Pages
5+
{
6+
public class ExplodeModel : PageModel
7+
{
8+
public void OnGet()
9+
{
10+
}
11+
public class PyramidChartData
12+
{
13+
public string xValue;
14+
public double yValue;
15+
}
16+
}
17+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
@page
2+
@using static PyramidFunnelTypeSample.Pages.FunnelChartModel
3+
@model PyramidFunnelTypeSample.Pages.FunnelChartModel
4+
@{
5+
List<FunnelChartData> chartData = new List<FunnelChartData>
6+
{
7+
new FunnelChartData { xValue = "Chrome", yValue = 37 },
8+
new FunnelChartData { xValue = "UC Browser", yValue = 17 },
9+
new FunnelChartData { xValue = "iPhone", yValue = 19 },
10+
new FunnelChartData { xValue = "Others", yValue = 4 },
11+
new FunnelChartData { xValue = "Opera", yValue = 11 },
12+
new FunnelChartData { xValue = "Android", yValue = 12 },
13+
};
14+
}
15+
16+
<ejs-accumulationchart id="container" title="Mobile Browser Statistics">
17+
<e-accumulationchart-legendsettings visible="false">
18+
</e-accumulationchart-legendsettings>
19+
<e-accumulation-series-collection>
20+
<e-accumulation-series dataSource="chartData" xName="xValue" yName="yValue" name="Browser"
21+
type="@Syncfusion.EJ2.Charts.AccumulationType.Funnel">
22+
</e-accumulation-series>
23+
</e-accumulation-series-collection>
24+
</ejs-accumulationchart>

0 commit comments

Comments
 (0)