Chart Resize

Google Line Chart - Width and height of chart according to div size and resize if Window size change, through jQuery.

by Pixic

HTML

<script src="https://www.google.com/jsapi"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
    <div id="myweight" style="width: 100%; height: 100%"></div>

JavaScript

google.load("visualization", "1", {packages:["corechart"]});
	google.setOnLoadCallback(drawChart);
		
			
	function drawChart() {
		var data = google.visualization.arrayToDataTable(
			[
        ['Date', 'Weight (kg)', 'Trend (7days)', 'Goal'],
                ['	2013-05-20', 
						94.1,
						,
						85],
                ['	2013-05-21', 
						93.6,
						,
						85],
                ['	2013-05-22', 
						94.1,
						,
						85],
                ['	2013-05-23', 
						94.9,
						,
						85],
                ['	2013-05-24', 
						95.6,
						,
						85],
                ['	2013-05-25', 
						94.5,
						,
						85],
                ['	2013-05-26', 
						94.5,
						94.5,
						85],
                ['	2013-05-27', 
						94,
						94.5,
						85],
                ['	2013-05-28', 
						93.6,
						94.5,
						85],
                ['	2013-05-29', 
						94.7,
						94.5,
						85],
                ['	2013-05-30', 
						95.4,
						94.6,
						85],
                ['	2013-05-31', 
						94.9,
						94.5,
						85],
                ['	2013-06-01', 
						94,
						94.4,
						85],
                ['	2013-06-02', 
						94.5,
						94.4,
						85],
                ['	2013-06-03', 
						94.7,
						94.5,
						85],
                ['	2013-06-04', 
						93.8,
						94.6,
						85],
                ['	2013-06-05', 
						93.8,
						94.4,
						85],
                ['	2013-06-06', 
						93.8,
						94.2,
						85],
                ['	2013-06-07', 
						93.8,
						94.1,
						85],
                ['	2013-06-08', 
						93.8,
						94.0,
						85],
                ['	2013-06-09', 
						93.8,
						93.9,
						85],
                ['	2013-06-10', 
						93.8,
						93.8,
						85],
                ['	2013-06-11', 
						93.8,
						93.8,
						85],
                ['	2013-06-12', 
						93.8,
						93.8,
						85],
                ['	2013-06-13', 
						93.8,
						93.8,
						85],
                ['	2013-06-14', 
						93.8,
						93.8,
						85],
            ...