Google Chart - All series on a given axis must be of the same data type - error
JavaScript
1
Posts
1
Posters
0
Views
1
Watching
-
Dear all, I am experiencing the following error on the client-end -- All series on a given axis must be of the same data type. I have added in new control chartRangeSlider, which is causing this error, i think. I have checked the API documentation and I cannot seem to figure where I may be going wrong.
function drawVisualization(dataValues, chartTitle, columnNames, categoryCaption) {
if (dataValues.length < 1)
return;
var data = new google.visualization.DataTable();
data.addColumn('string', columnNames.split(',')[0]);
data.addColumn('number', columnNames.split(',')[1]);
data.addColumn('string', columnNames.split(',')[2]);
data.addColumn('datetime', columnNames.split(',')[3]);
data.addColumn('number', columnNames.split(',')[4]);for (var i = 0; i < dataValues.length; i++) { var date = new Date(parseInt(dataValues\[i\].Date.substr(6), 10)); data.addRow(\[dataValues\[i\].ColumnName, dataValues\[i\].Value, dataValues\[i\].Type, date, dataValues\[i\].ID\]); } // Define a Pie chart var pie = new google.visualization.ChartWrapper({ 'chartType': 'LineChart', 'containerId': 'PieChartContainer', 'options': { 'width': 950, 'height': 450, 'legend': 'right', //'hAxis': { //'format': "dd-MMM-yyyy", // 'maxValue': new Date (2014, 03, 07), 'minValue': new Date (2014, 02, 20), // 'viewWindow':{'max': new Date (2014, 03, 17)}, // }, 'title': chartTitle, 'chartArea': { 'left': 100, 'top': 100, 'right': 0, 'bottom': 100 }, 'pieSliceText': 'label', 'tooltip': {isHtml: true} }, 'view': { 'columns': \[4, 1\] } }); // Create a date range slider var myIdSlider = new google.visualization.ControlWrapper({ 'controlType': 'ChartRangeFilter', 'containerId': 'control\_div', 'options': { 'filterColumnLabel': columnNames.split(',')\[4\], 'filterColumnIndex': '4', 'chartView': { 'columns': \[4, 1\] }, } }); new google.visualization.Dashboard(document.getElementById('PieChartExample')).bind(\[myIdSlider\], \[pie\]).draw(data); }
</script>