Skip to content

Commit 28c1db8

Browse files
committed
934883: Test and resolve issues in UG all sections - ASP core MVC Dashboard Layout control.
1 parent 6c44cb1 commit 28c1db8

File tree

2 files changed

+67
-4
lines changed

2 files changed

+67
-4
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
public class componentSpacingModel
2+
{
3+
public double[]? cellSpacing { get; set; }
4+
}
5+
public class ChartData
6+
{
7+
public string? month;
8+
public double sales;
9+
}
10+
public class LineData
11+
{
12+
public double x;
13+
public double y;
14+
}
15+
16+
public class PieData
17+
{
18+
public string x;
19+
public double y;
20+
public string? text;
21+
}

ej2-asp-core-mvc/code-snippet/dashboard-layout/dragging-handler/tagHelper

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,48 @@
1+
@{
2+
...
3+
componentSpacingModel modelValue = new componentSpacingModel();
4+
modelValue.cellSpacing = new double[] { 10, 10 };
5+
6+
List<ChartData> chartData = new List<ChartData>
7+
{
8+
new ChartData { month = "Jan", sales = 35, },
9+
new ChartData { month = "Feb", sales = 28, },
10+
new ChartData { month = "Mar", sales = 34, },
11+
new ChartData { month = "Apr", sales = 32, },
12+
new ChartData { month = "May", sales = 40, },
13+
new ChartData { month = "Jun", sales = 32, },
14+
new ChartData { month = "Jul", sales = 35, },
15+
new ChartData { month = "Aug", sales = 55, },
16+
new ChartData { month = "Sep", sales = 38, },
17+
new ChartData { month = "Oct", sales = 30, },
18+
new ChartData { month = "Nov", sales = 25, },
19+
new ChartData { month = "Dec", sales = 32, }
20+
};
21+
22+
List<LineData> lineData = new List<LineData>
23+
{
24+
new LineData { x = 2013, y = 28, },
25+
new LineData { x = 2014, y = 25, },
26+
new LineData { x = 2015, y = 26, },
27+
new LineData { x = 2016, y = 27, },
28+
new LineData { x = 2017, y = 32, },
29+
new LineData { x = 2018, y = 35, }
30+
};
31+
32+
List<PieData> pieData1 = new List<PieData>
33+
{
34+
new PieData { x = "Chrome", y = 37, text = "37%", },
35+
new PieData { x = "UC Browser", y = 17, text = "17%", },
36+
new PieData { x = "iPhone", y = 19, text = "19%", },
37+
new PieData { x = "Others", y = 4, text = "4%", },
38+
new PieData { x = "Opera", y = 11, text = "11%", },
39+
new PieData { x = "Android", y = 12, text = "12%", }
40+
};
41+
}
42+
143
<div>
244
<!-- Dashboardlayout element declaration -->
3-
<ejs-dashboardlayout id="dashboard_default" columns="6" draggableHandle=".e-panel-header" cellSpacing="@Model.cellSpacing">
45+
<ejs-dashboardlayout id="dashboard_default" columns="6" draggableHandle=".e-panel-header" cellSpacing="@modelValue.cellSpacing">
446
<e-dashboardlayout-panels>
547
<e-dashboardlayout-panel id="Panel1" sizeX="3" sizeY="2" row="0" col="3" header="<div class='header'>Last year sales comparison</div><span class='handler e-icons burg-icon'></span>" content="#column">
648
</e-dashboardlayout-panel>
@@ -17,7 +59,7 @@
1759
<ejs-chart id="columnChart" height="162px">
1860
<e-chart-primaryxaxis valueType="Category"></e-chart-primaryxaxis>
1961
<e-series-collection>
20-
<e-series dataSource="ViewBag.chartSource" xName='month' yName='sales' type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column">
62+
<e-series dataSource="chartData" xName='month' yName='sales' type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column">
2163
</e-series>
2264
</e-series-collection>
2365
</ejs-chart>
@@ -29,7 +71,7 @@
2971
<ejs-chart id="lineChart" height="162px">
3072
<e-chart-primaryxaxis valueType="Category"></e-chart-primaryxaxis>
3173
<e-series-collection>
32-
<e-series dataSource="ViewBag.lineSource" xName='x' yName='y' type="@Syncfusion.EJ2.Charts.ChartSeriesType.Line">
74+
<e-series dataSource="lineData" xName='x' yName='y' type="@Syncfusion.EJ2.Charts.ChartSeriesType.Line">
3375
</e-series>
3476
</e-series-collection>
3577
</ejs-chart>
@@ -43,7 +85,7 @@
4385
<e-accumulationchart-legendsettings visible="false">
4486
</e-accumulationchart-legendsettings>
4587
<e-accumulation-series-collection>
46-
<e-accumulation-series dataSource="ViewBag.pieSource1" xName="x" yName="y" radius="70%" name="Browser">
88+
<e-accumulation-series dataSource="pieData1" xName="x" yName="y" radius="70%" name="Browser">
4789
<e-accumulationseries-datalabel name="text" visible="true" position="Inside">
4890
</e-accumulationseries-datalabel>
4991
</e-accumulation-series>

0 commit comments

Comments
 (0)