The chart options1 and options2 specify different width and height values.
I want two separate charts with different overall sizes where the lines
fill the entire chart area.
The problem is that the larger chart cuts off the lines at 500 and 300
pixels instead of filling up the entire chart area.
If I specify the same height and width, this problem does not occur.
The script is shown below:
<script type="text/javascript">
google.load('visualization', '1.1', {packages: ['line']});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('date', 'Date');
data.addColumn('number', 'One');
data.addColumn('number', 'Two');
data.addColumn('number', 'Three');
data.addRows([
[new Date(2014,11,16), 184, 201.5, 48],[new Date(2014,11,23), 142, 154.6,
38.9],[new Date(2014,11,24), 242, 274.4, 85.1], [new Date(2014,11,25), 242,
297.8, 76.6]]);
var options1 = {
'title': 'Maconutrient Chart',
'width': 900,
'height': 500
};
var chart = new google.charts.Line(document.getElementById(
'linechart_material'));
var data2 = new google.visualization.DataTable();
data2.addColumn('number', 'Meal');
data2.addColumn('number', 'One');
data2.addColumn('number', 'Two');
data2.addColumn('number', 'Three');
data2.addRows([
[1, 15.53985503, 20.3055555, 2.38888888],
[2, 21, 8.16666666, 0],
[3, 0, 0, 0],
[4, 0, 0, 0],
[5, 0, 0, 0],
[6, 0, 0, 0]
]);
var Classicoptions = {
'title': 'Meal Chart',
'width': 500,
'height': 300
};
var chart2 = new google.charts.Line(document.getElementById('day_material'
));
chart.draw(data, options1);
chart2.draw(data2, Classicoptions);
}
</script>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.