I have a jQuery flot chart with this code:
$("table.statics").each(function() {
var colors = [];
$("table.statics thead th:not(:first)").each(function() {
colors.push($(this).css("color"));
});
$(this).graphTable({
series: 'columns',
position: 'replace',
height: '200px',
colors: colors
}, {
xaxis: {
tickSize: 1
}
});
});
This code is working fine, but now I want that the chart to resize when the window is resized.
How can i do this? I have the jquery.flot.resize.js included in my document.
Simply delete the
"height:200px"and give it"height:40%"or the amout you want.In giving percent you ensure that the size is calculated new everytime when the window is resized.