Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 1855 by
pinus.z...@gmail.com: Bug: chartArea doesn't work as
documented
https://code.google.com/p/google-visualization-api-issues/issues/detail?id=1855
What steps will reproduce the problem? Please provide a link to a
demonstration page if at all possible, or attach code.
Tho old BarChart uses the charArea to layout the chart components, the new
bar component doesn't do that. They share the same documentation but behave
totally different.
<div id="chart_div"></div>
google.load('visualization', '1.1', {
'packages': ['bar']
});
google.setOnLoadCallback(drawStuff);
function drawStuff() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Topping');
data.addColumn('number', 'Nescafe Instant');
data.addColumn('number', 'Folgers Instant');
data.addColumn('number', 'Nescafe Beans');
data.addColumn('number', 'FolgchartAreaers Beans');
data.addRows([
['2001', 321, 621, 816, 319],
['2002', 163, 231, 539, 594],
['2003', 125, 819, 123, 578],
['2004', 197, 536, 613, 298]
]);
// Set chart options
var options = {
isStacked: true,
width: 800,
height: 600,
chartArea: {
left: '7%', // leave 7% for hAxis text
top: '5px',
width: '93%', // use the rest for the chart
height: '80%'
},
chart: {
title: 'Year-by-year coffee consumption',
subtitle: 'This data is not real'
},
vAxis: {
viewWindow: {
min: 0,
max: 1000
}
},
series: {
2: {
targetAxisIndex: 1
},
3: {
targetAxisIndex: 1
}
}
};
// Instantiate and draw our chart, passing in some options.
var chart = new google.charts.Bar(document.getElementById('chart_div'));
chart.draw(data, google.charts.Bar.convertOptions(options));
};
What component is this issue related to (PieChart, LineChart, DataTable,
Query, etc)?
google.charts.Bar
Are you using the test environment (version 1.1)?
yes
What operating system and browser are you using?
Ubuntu 14.04
*********************************************************
For developers viewing this issue: please click the 'star' icon to be
notified of future changes, and to let us know how many of you are
interested in seeing it resolved.
*********************************************************
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings