Unplanned
Last Updated: 23 Oct 2024 21:01 by ADMIN
Fred
Created on: 16 Jan 2024 07:58
Category: Chart
Type: Bug Report
1
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.

Regards,
Yana
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Fred
Posted on: 23 Oct 2024 20:40
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's Height. 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.

see the bellow code for an example

----------------------------------------

"

<ContentView
    x:Name="CV1"
    Grid.Row="1"
    Grid.Column="1"
    Padding="{Binding Chart1Margin}"
    BackgroundColor="Transparent">
    <telerik:RadCartesianChart
        x:Name="Chart1"
        Margin="0,-5,0,-5"
        BackgroundColor="Transparent"
        HeightRequest="{Binding Source={x:Reference CV1}, Path=Height}">
        <telerik:RadCartesianChart.HorizontalAxis>
            <telerik:DateTimeContinuousAxis
                x:Name="AxisTime"
                LabelFontSize="{Binding TextSize}"
                LabelTextColor="{StaticResource CSTShadowColor}"
                LineColor="{StaticResource CSTShadowColor}"
                MajorStep="{Binding XAxisMajorStep}"
                MajorStepUnit="Second"
                Maximum="{Binding XAxisMax}"
                Minimum="{Binding XAxisMin}"
                PlotMode="OnTicks" />
        </telerik:RadCartesianChart.HorizontalAxis>
        <telerik:RadCartesianChart.VerticalAxis>
            <telerik:NumericalAxis
                x:Name="AxisY1"
                LabelFontSize="{Binding TextSize}"
                LabelTextColor="{StaticResource CSTShadowColor}"
                LineColor="{StaticResource CSTShadowColor}"
                Location="Left"
                MajorStep="{Binding Y1AxisMajorStep}"
                Maximum="{Binding Y1AxisMax}"
                Minimum="{Binding Y1AxisMin}"
                RangeExtendDirection="None"
                ShowLabels="True" />
        </telerik:RadCartesianChart.VerticalAxis>
        <telerik:RadCartesianChart.Series>
            <telerik:LineSeries
                CategoryBinding="Time"
                DisplayName="{Binding Y1AxisTitle}"
                ItemsSource="{Binding Data1}"
                Stroke="{StaticResource CSTSecondaryColor}"
                ValueBinding="Value" />
        </telerik:RadCartesianChart.Series>
        <telerik:RadCartesianChart.Grid>
            <telerik:CartesianChartGrid MajorLineColor="{StaticResource CSTShadowColor}" MajorLinesVisibility="X" />

        </telerik:RadCartesianChart.Grid>
    </telerik:RadCartesianChart>
</ContentView>

"

ADMIN
Yana
Posted on: 23 Oct 2024 07:16

Hello Fred,

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.

I am sorry for any inconvenience caused. 

Regards,
Yana
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Fred
Posted on: 22 Oct 2024 22:50
Hey is anything happening with this?