Responsive Pie Chart

1 Answer 52 Views
Chart
Jeffrey Monroe
Top achievements
Rank 2
Jeffrey Monroe asked on 23 Aug 2023, 12:06 AM

I am looking for a sample of a responsive pie chart. I have tried different suggestions from the forums but none seem to work. Is there a fully worked sample I can reference?

1 Answer, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 25 Aug 2023, 01:26 PM

Hi Jeffrey,

A possible recommendation to achieve the desired outcome would be to explicitly re-calculate the Chart's dimensions by utilizing the .refresh() method of the component whilst wiring to the window.resize event.

Here is an exemplary configuration:

@(Html.Kendo().Chart()
    .Name("chart")
    ...
 )


<script>
    $(window).resize(function () {
        $("#chart").data("kendoChart").refresh();
    });
</script>    

The aforementioned approach would then produce a result identical to the following once the dimensions of the viewport change:

Please give this suggestion a try and let me know how it works out for you.

Kind Regards,
Alexander
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages. If you're new to the Telerik family, be sure to check out our getting started resources, as well as the only REPL playground for creating, saving, running, and sharing server-side code.
Tags
Chart
Asked by
Jeffrey Monroe
Top achievements
Rank 2
Answers by
Alexander
Telerik team
Share this question
or