This is a migrated thread and some comments may be shown as answers.

Resize chart when div width increase and decrease

1 Answer 418 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Rohan
Top achievements
Rank 1
Veteran
Rohan asked on 17 Jul 2020, 06:36 AM

I try resize , refresh and redraw but chart width is still same.

When i click left menu a left menu hide and kendo div show from 70% to 100% but when div 100% show then kendo width is still 70% and once i toggle to 70% kendo cut right side on 70% width

my code structure 

 

Html

<div>

<div class="slider"><a class="showhide" href="#">Click Width increase and decrease </a></div>

<div class="kendo-chart-half"">

<div id="kendo-chart">

chart show

</div>

</div>

</div>

 

css 

.slider {width:30%: float:left}

.kendo-chart-half{width: 70%: float:left}

.kendo-chart-full{width: 100%: float:left}

Jquery 

$(document).on('click', '.showhide', function () {
    $('#verticalTabCol , .hiddenSlideVariable').toggle(200);
    $('.kendo-chart-half').toggleClass("kendo-chart-full", 200);
    $('#kendo-chart').data('kendoChart').resize();
    $('#kendo-chart').data('kendoChart').refresh();

    $('#kendo-chart').data('kendoChart').redraw();
});

1 Answer, 1 is accepted

Sort by
0
Alex Hajigeorgieva
Telerik team
answered on 20 Jul 2020, 03:48 PM

Hello, Rohan,

It appears that the CSS is defined with invalid values where there is a colon instead of a semicolon.

Defining the CSS appropriately, seems to work just fine in this simple test:

https://dojo.telerik.com/@bubblemaster/uqoBuwUB/2

Let me know in case you need further assistance with the chart resize() method.

Kind Regards,
Alex Hajigeorgieva
Progress Telerik

Tags
Charts
Asked by
Rohan
Top achievements
Rank 1
Veteran
Answers by
Alex Hajigeorgieva
Telerik team
Share this question
or