Starting suddenly, my column charts are not displaying properly in
internet explorer.
The bars themselves never display.
It appears to be an issue with setting a minValue for the hAxis. When
I set the minValue to 0 the bars display fine, but when I set the
value to anything higher they don't display.
Anyone else experiencing anything like this?
The code:
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(function(){
rawValues = [425195,434893,446288];
rawKeys = ['2001','2011','2021 *est.'];
drawBarChart(rawKeys,rawValues,{
theDiv: 'popGraph',
legend: 'top',
width: 350,
height: 200,
graphType: 'bar',
keyName: '',
valueName: 'population'
});
});
function drawBarChart(keys,values,options)
{
var data = new google.visualization.DataTable();
data.addColumn('string', "");
for (i=0;i<keys.length;i++)
{
data.addColumn('number',keys[i]);
}
var chart = new
google.visualization.BarChart(document.getElementById(options.theDiv));
data.addRows(1);
data.setValue(0,0,options.keyName);
var count = 1;
var highNumber = values[0];
var lowNumber = values[0];
for (i=0;i<values.length;i++)
{
if (values[i] > highNumber)
{
highNumber = values[i];
}
if (values[i] < lowNumber)
{
lowNumber = values[i]
}
data.setValue(0,count,values[i]);
count++;
}
highNumber *= 1.01;
lowNumber *= 0.8;
if (options.hAxis)
{
highNumber = options.hAxis.maxValue;
lowNumber = options.hAxis.minValue;
}
chart.draw(data, {width: options.width, height:
options.height,
legend:options.legend,
colors:['#F7841B','#2985FF','#15BD32','#FB6053'],
chartArea: {
width: 250
},
hAxis: {
maxValue: highNumber,
minValue: lowNumber
}
});
}
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-visualization-api?hl=en.