Chart: [Android] Chart renders incorrectly when nested in ScrollView
If the Chart control is nested inside a ScrollView, it is not sized properly on Android - it seems it occupies the available space, but the chart itself ( the axes and the series) are shrunk in size.
5 comments
ADMIN
Yana
Posted on:23 Oct 2024 21:01
Hello Fred,
Thank you for sharing the workaround, it would be really helpful for other users who experience the issue.
in the bellow, example ignore Padding="{Binding Chart1Margin}" on the content view, this is a holdover from other attempts to fix the issue and is not needed
Fred
Posted on:23 Oct 2024 20:37
For anyone else who is struggling with this issue,
I have found a workaround, setting a height request on the chart resolves the issue, in my case I needed the chart to be sized dynamically by a grid layout. I achieved this by nesting the chart in a content view and binding the chart's height request to the content view'sHeight. however, as the chart is a child of the content view we need a small buffer to parent layout cycling and infinite growth of the chart and content view. I set the chart's margin to -5 this lets the chart overflow the content view without resizing the content view; thus preventing infinite growth.
I am afraid this issue is still with status "Unplanned", which means we haven't scheduled it yet. All the reported issues are prioritized and planned according to various factors, such as severity, demand, complexity and other. We're going to update the item's status in the feedback portal, as soon as we plan it.