|
<SfDashboardLayout>
<DashboardLayoutPanels>
<DashboardLayoutPanel>
<HeaderTemplate><div>Anvendte behandlingsgrundlag</div></HeaderTemplate>
<ContentTemplate>
<SfMaps>
<MapsLayers>
<MapsLayer Visible="true" ShapeData='new {dataOptions ="https://cdn.syncfusion.com/maps/map-data/world-map.json"}'>
</MapsLayer>
</MapsLayers>
</SfMaps>
</ContentTemplate>
</DashboardLayoutPanel>
</DashboardLayoutPanels>
</SfDashboardLayout> |
Unfortunately, this sample seems not to work in the current version 19.4.0.38 - the height of the map does not adopt to the height of the DashboardElement.
When adding Heigth="100%" on the SfMap it even gets worse - after a single resize the browser complains about negative values in the dev console.
|
Queries |
Details | |
|
Unfortunately, this sample seems not to work in the current version 19.4.0.38 - the height of the map does not adopt to the height of the DashboardElement. |
The sample application provided previously in this forum is of older version. So we have updated the sample to the new version with updated code and packages. We need to make the following changes to resolve the reported issue in the Maps component with the Dashboard layout component.
When the Maps component is rendered within the panel of the Dashboard layout, the size of the Maps is not got properly from the panel of the Dashboard layout. The same issue is reproduced in the drag and resize of the panel. To resolve this issue, we need to call the “Refresh” method in the “OnResizeStop” and “OnWindowResize” events of Dashboard layout. Since the size of panel of the Dashboard layout is got after the some delay in the Maps component, a time delay of 1000 milliseconds must be provided before refreshing the Maps component. Please find the code snippet below.
Code Snippet:
We have created a sample to demonstrate the same and it can be downloaded from the below link.
Sample Application: https://www.syncfusion.com/downloads/support/forum/156808/ze/MapsLayout563769815
Screen Capture (Video): https://www.syncfusion.com/downloads/support/forum/156808/ze/dashboard887073354 | |
|
When adding Heigth="100%" on the SfMap it even gets worse - after a single resize the browser complains about negative values in the dev console. |
We are unable to reproduce the issue with the reported scenario. Please modify the above sample to reproduce the reported issue. It will be helpful for us to analyze and assist you further. |
Idumathi,
thank you very much - it is now working this way.
In my code I encapsulated the SfMap in another <div> that caused the behavior described when setting height="100%" - To clarify the issue, I changed your sample:
<SfDashboardLayout @ref="dashboardObject" AllowResizing="@AllowResizing" AllowFloating="@AllowFloating" CellSpacing="@CellSpacing" Columns="@Columns">
<DashboardLayoutEvents OnResizeStop="@ResizingHandler" OnWindowResize="@ResizingHandler"></DashboardLayoutEvents>
<DashboardLayoutPanels>
<DashboardLayoutPanel Id="24" Row="0" Col="5" SizeX="5" SizeY="7">
<HeaderTemplate><div> Maps </div></HeaderTemplate>
<ContentTemplate>
<div>
<SfMaps ID="Maps" @ref="Maps" Height="100%">
<MapsTitleSettings Text="Maps">
<MapsTitleTextStyle Size="16px" />
</MapsTitleSettings>
<MapsZoomSettings Enable="true" />
<MapsLayers>
<MapsLayer ShapeData='new {dataOptions ="https://cdn.syncfusion.com/maps/map-data/world-map.json"}'
TValue="string">
<MapsMarkerSettings>
<MapsMarker Visible="true" DataSource="California" Height="25" Width="15" TValue="City" AnimationDuration="0">
<MapsMarkerBorder Color="#285255" Width="2" />
<MapsMarkerTooltipSettings Visible="true" ValuePath="Name"
Format="<b>${Name}</b>" />
</MapsMarker>
<MapsMarker Visible="true" DataSource="NewYork" Height="25" Width="15" TValue="City" AnimationDuration="0">
<MapsMarkerBorder Color="#285255" Width="2" />
<MapsMarkerTooltipSettings Visible="true" ValuePath="Name"
Format="<b>${Name}</b>" />
</MapsMarker>
<MapsMarker Visible="true" DataSource="Iowa" Height="25" Width="15" TValue="City" AnimationDuration="0">
<MapsMarkerBorder Color="#285255" Width="2" />
<MapsMarkerTooltipSettings Visible="true" ValuePath="Name"
Format="<b>${Name}</b>" />
</MapsMarker>
</MapsMarkerSettings>
</MapsLayer>
</MapsLayers>
</SfMaps>
</div>
</ContentTemplate>
</DashboardLayoutPanel>
</DashboardLayoutPanels>
</SfDashboardLayout>
Please verify, this causes the behavior mentioned.
However, we ran in a whole lot of resizing issues with components incorporating in the dashboard (CircularGauge fixed with 19.4, Chart, Grid) that are all solvable with some Delays and Refresh "vodoo". It would be really helpful, if you could provide some comprehensive guide for embedding the various controls into the dashboard to avoid that painful experience...
Again, thank you and keep up the good work!
|
<SfDashboardLayout>
<DashboardLayoutEvent>
</DashboardLayoutEvents>
<DashboardLayoutPanels>
<DashboardLayoutPanel>
<ContentTemplate>
<div style="width:inherit; height:inherit">
<SfMaps ID="Maps" @ref="Maps" Height="100%">
</SfMaps>
</div>
<ContentTemplate>
</DashboardLayoutPanel>
</DashboardLayoutPanels>
</SfDashboardLayout> |
Dear Indumathi,
thank you for your clarification and suggested solution, it is perfectly working for me now.
Looking forward to hearing about the interaction with the dashboard team. The user expectation for dashboard look-and-feel is pretty high, so it would be important to have some out-of-the-box (on any device and resolution) working dashboard samples/guides embedding the most important components you provide.
Regards,
Christoph