We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

SfChart and SfStockChart resize

Hi,

I try achive auto resize content dashboard elements like charts but:

  1. After resize any of dashboard elements chart1 (SFChart) disapear.
  2. Auto resize of chart2 (SFStockChart) not working.

In code I'm handle OnResizeStop event, and use extra style for e-chart.

 

<style>
    .e-chart {
        width: inherit !important;
        height: inherit !important;
    }
    .e-accumulationchart {
        width: inherit !important;
        height: inherit !important;
    }
</style>
<SfDashboardLayout @ref="dashboardObject" AllowFloating="true" AllowResizing="true" Columns="5">
    <DashboardLayoutEvents OnResizeStop="onResizeStop"></DashboardLayoutEvents>
    <DashboardLayoutPanels>
        <DashboardLayoutPanel Id="one" Column="0" Row="0">
            <HeaderTemplate>Panel 1</HeaderTemplate>
            <ContentTemplate>
                <div style="height:100%; width:100%">
                    <SfChart @ref="chart1" Title="AAPL Stock Price">
                    </SfChart>
                </div>
            </ContentTemplate>
        </DashboardLayoutPanel>
        <DashboardLayoutPanel Id="three" Row="0" Column="1" SizeX=2 SizeY=2>
            <HeaderTemplate>Panel 3</HeaderTemplate>
            <ContentTemplate>
                <div style="height:100%; width:100%">
                    <SfStockChart @ref="chart2" Title="AAPL Stock Price">
                    </SfStockChart>
                </div>
            </ContentTemplate>
        </DashboardLayoutPanel>
    </DashboardLayoutPanels>
</SfDashboardLayout>
@code {
    SfDashboardLayout? dashboardObject;
    SfChart? chart1;
    SfStockChart? chart2;
    void onResizeStop()
    {
        chart1?.RefreshAsync();
        chart2?.Refresh();
    }
}

Attachment: Index_b8b8b744.zip

2 Replies

DG Durga Gopalakrishnan Syncfusion Team November 9, 2022 10:30 AM

Hi Vegar,


Greetings from Syncfusion.


We have considered your reported scenario as bug and logged a defect report for this issue. This fix will be available in our weekly patch release which is scheduled to be rolled out on 22nd November 2022. We appreciate your patience until then. You can keep track of the bug from the below feedback link.


Feedback Link : https://www.syncfusion.com/feedback/38960/chart-and-stockchart-is-not-resized-properly-on-panel-resize


If you have any more specification/precise replication procedure or a scenario to be tested, you can add it as a comment in the portal.


Regards,

Durga Gopalakrishnan.



DG Durga Gopalakrishnan Syncfusion Team November 22, 2022 08:47 AM

Hi Vegar,


We are glad to announce that our v20.3.0.58 patch release is rolled out; we have added the fix for reported issue. You can use the latest Syncfusion.Blazor.Charts NuGet package.


NuGet Package : https://www.nuget.org/packages/Syncfusion.Blazor.Charts/


We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.


Regards,

Durga Gopalakrishnan.


Loader.
Live Chat Icon For mobile
Up arrow icon