In our team project we are using the KendoUI controls here issue while minimize the window chart size not decreasing.How to increase/decrease the size of chart while maximize/minimize the window of browser.?
The Window enables you to set its width and height, and change its dimensions by dragging the resize handles.
You can enable column resizing for the Kendo UI grid via a simple configuration setting. All you have to do is set its resizable attribute to true, which will make its columns resizable by displaying drag handles/hints when you hover in between their headers.
changing the row height by using custom CSS styles, requires updating the rowHeight option too. For example, if we customize the row height by setting line-height: 28px; the rowHeight should represent the actual height of each Grid row (tr) element in the DOM.
Try this works to me:
<div id="example">
<div id="chart"></div>
</div>
<script>
// Chart Data Source
var exampleData = [
{ "FromDept": "ACT", "ToDept": "NSW", "Year": 2010, "Total": 101 },
{ "FromDept": "ACT", "ToDept": "NSW", "Year": 2011, "Total": 1001 },
{ "FromDept": "ACT", "ToDept": "NSW", "Year": 2012, "Total": 501 },
{ "FromDept": "ACT", "ToDept": "YNT", "Year": 2010, "Total": 501 }
];
// Function to create Chart
function createChart() {
// Creating kendo chart using exampleData
$("#chart").kendoChart({
title: {
text: "Sample"
},
dataSource:
{
data: exampleData,
},
legend: {
position: "bottom"
},
chartArea: {
background: ""
},
seriesDefaults: {
type: "line"
},
series: [{
field: "Total",
}],
valueAxis: {
labels: {
format: "${0}"
}
},
categoryAxis: {
field: "Year"
},
tooltip: {
visible: true,
format: "{0}%"
}
});
}
// Resize the chart whenever window is resized
$(window).resize(function () {
$("#chart svg").width(Number($(window).width()));
$("#chart svg").height(Number($(window).height()));
$("#chart").data("kendoChart").refresh();
});
// Document ready function
$(document).ready(function () {
// Initialize the chart with a delay to make sure
// the initial animation is visible
createChart();
// Initially
$("#chart svg").width(Number($(window).width()));
$("#chart svg").height(Number($(window).height()));
$("#chart").data("kendoChart").refresh();
});
</script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With