4 equally sized DashboardLayoutPanel with responsive properties inside Dashboard
Good day,

I have four panels inside the dashboard layout. I want them to be equally sized and spaced and not overlapping each other. I want two rows two panels in each row.
Like this:
| Panel1 | Panel2 |
| Panel3 | Panel4 |
Issue:
Panel2 is under panel 4. Chart in panel3 and grid in panel4 are extending outside of their respective panels. I am seeing the vertical scroll bar which tells that these are not fitting the screen height. Kindly help.
This is what I have tried so far:
<EjsDashboardLayout ID="dashboard" CellSpacing="@(new double[]{10, 10})" Columns="4" AllowDragging="false">
<DashboardLayoutPanel Id="Panel1" Col=0 Row=1 SizeX=2 SizeY=1.3>
<DashboardLayoutPanel Id="Panel2" SizeX=2 SizeY=1.3 Col=3 Row=1>
<DashboardLayoutPanel Id="Panel3" Col=0 Row=2 SizeX=2 SizeY=1.5>
<DashboardLayoutPanel Id="Panel4" SizeX=2 SizeY=1.5 Col=3 Row=2>
What settings do I use? As I want the enitre panel to be responsive and not extend the screen size in horizontal or vertical direction?
Thanks.
Junaid
SIGN IN To post a reply.
5 Replies
KM
Kanagambigai Murugan
Syncfusion Team
December 2, 2019 12:49 PM UTC
Hi Junaid,
Good day to you.
We have validated your reported issue. To overcome this issue, you need to call the refresh method of chart/grid component in the dashboard layout’s created event if you are using content template to render the component. Also you need to set the width and height of the component as 100% to overcome the reported issues. Please refer to the following code snippet.
|
<EjsDashboardLayout CellSpacing="@(new double[]{20 ,20 })" Columns="4" CellAspectRatio="2">
<DashboardLayoutEvents Created="@onCreate"></DashboardLayoutEvents>
<DashboardLayoutPanels>
<DashboardLayoutPanel Row="0" Col="0" SizeX="2" SizeY="2">
<ContentTemplate>
<div style="width:100%;height:100%">
<EjsAccumulationChart ID="pie" Height="100%" Width="100%" @ref="chartObj">
<AccumulationChartSeriesCollection>
<AccumulationChartSeries DataSource="@MedalDetails" XName="Country" YName="Medals">
</AccumulationChartSeries>
</AccumulationChartSeriesCollection>
</EjsAccumulationChart>
</div>
</ContentTemplate>
</DashboardLayoutPanel>
public async Task onCreate(object args)
{
await Task.Delay(1000); // simulate the async operations
this.chartObj.Refresh();
this.barchartObj.Refresh();
this.GridObj1.Refresh();
this.GridObj2.Refresh();
} |
The vertical scroll bar appears due to the customization in application level. Please refer to following screenshot.
Sample: https://www.syncfusion.com/downloads/support/directtrac/149567/ze/DashBoardLayout-1064824518.zip
Kindly check the above sample and get back to us if you need further assistance on this.
Regards,
Kanagambigai M.
JU
Junaid
December 2, 2019 02:38 PM UTC
Good day,
Thanks.. that solved my problem.
In one of your tutorials on Dashboards, I have seen the usage of :
protected override async Task OnAfterRenderAsync(bool firstRender){.....}
.. for doing the same thing you did by using OnCreate..
How are both of these methods different? Which one is better to use?
Regards.
Junaid
SP
Sowmiya Padmanaban
Syncfusion Team
December 3, 2019 01:45 PM UTC
Hi Junaid,
Thanks for contacting Syncfusion support.
We would like to let you know that created event will be triggered once the dashboard layout component is rendered, whereas OnAfterRenderAsync will be invoked only after the blazor component has been completely rendered (eg: home component). If you are only using only the Dashboard layout in your page, then you can make use of the created event of the Dashboard layout component itself. Else if you make any manipulations while assigning chart or grid component data then you can make use of onAfterRenderAsync to refresh the panel content components at your end.
Please let us know, if you have any concerns.
Regards,
Sowmiya.P
JU
Junaid
December 3, 2019 02:19 PM UTC
Goo day,
Thank you so much.
Regards.
Junaid
SP
Sowmiya Padmanaban
Syncfusion Team
December 4, 2019 05:23 AM UTC
Hi Junaid,
Most welcome. We are glad to hear that the provided solution helped you to achieve your requirement. Please get back to us if you need any futher assistance on this.
Regards,
Sowmiya.P
SIGN IN To post a reply.
- 5 Replies
- 3 Participants
-
JU Junaid
- Nov 30, 2019 12:41 PM UTC
- Dec 4, 2019 05:23 AM UTC