Chart within a TileLayout does not resize when resizing the tile item

1 Answer 167 Views
Charts TileLayout
Roman
Top achievements
Rank 1
Iron
Roman asked on 13 Jan 2023, 10:53 AM

Hi there,

I'm facing a problem with charts in a tile layout. I have a TileLayout in my applicaton and added some charts (which are in another component) to it. I checked the documentation about TileLayout and resizing so I followed those steps. Please check out my code:

Razor MainPage:

<TelerikTileLayout Columns="5"
           ColumnWidth="300px"
           Reorderable="true"
           Resizable="true"
           OnResize="TileItemResize">
    <TileLayoutItems>
        <TileLayoutItem HeaderText="My Item Text" RowSpan="2">
            <Content>
                <TurnoverComparisonWidget @ref="TurnoverComparisonRef" SelectedWidget="widget" IsLoad="true"></TurnoverComparisonWidget>
            </Content>
        </TileLayoutItem>
    </TileLayoutItems>
</TelerikTileLayout>


Razor TurnoverComparisonWidget:

<TelerikChart @ref="ChartRef" Height="100%">
    <ChartTooltip Visible="true"></ChartTooltip>

    <ChartSeriesItems>
        <ChartSeries Type="ChartSeriesType.Column" Data="ChartData" Field="@nameof(ChartDataItem.Value)" CategoryField="@nameof(ChartDataItem.CategoryName)">
            <ChartSeriesLabels Visible="true" Format="{0:C2}"></ChartSeriesLabels>
        </ChartSeries>
    </ChartSeriesItems>
</TelerikChart>


C# MainPage:

public TurnoverComparisonWidget TurnoverComparisonRef { get; set; }

private void TileItemResize()
{
    TurnoverComparisonRef.Refresh();
}


C# TurnoverComparisonWidget:

public TelerikChart ChartRef { get; set; }

public void Refresh()
{
    ChartRef.Refresh();
}

But the chart is not resizing when I resize the tile layout item. It just stays the same size and never changes. Did I forget anything? I can't figure it out.

Best Regards,
Roman

1 Answer, 1 is accepted

Sort by
0
Yanislav
Telerik team
answered on 18 Jan 2023, 08:07 AM

Hi Roman,

I've reviewed the code snippets you've shared and everything seems fine to me. 

I've tried to reproduce the problem in a REPL example and everything seems to be working correctly. The Chart is refreshed when the tile is resized.

Can you spot something different in the scenario you have?

In order to further assist you, may I ask you to prepare an example or modify the REPL sample I've shared above, so the unexpected behavior is reproducible and send it back to me for further review? This way, I will be able to observe the issue and provide further guidance on handling the case.

Thank you in advance!

Regards,
Yanislav
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Charts TileLayout
Asked by
Roman
Top achievements
Rank 1
Iron
Answers by
Yanislav
Telerik team
Share this question
or