0

I'm working on line chart using a google js and I have given some sample values for testing and I'm getting the error

All series on a given axis must be of the same data type

Script

 function drawChart() {
            // var data = google.visualization.arrayToDataTable(chartData);
            var data = new google.visualization.DataTable();
            data.addColumn('number', 'Year');
            data.addColumn('string', 'Value');
            data.addColumn('number', 'Quantity');
            data.addRows([
                           [2008,'Value1',36],
                           [2009,'Value2',27],
                           [2010,'Value3',39]
            ]);
            var options = {
                title: "Company Performance Product Category Wise",
                pointSize: 5
            };
            var lineChart = new google.visualization.LineChart(document.getElementById('chart_div'));
            lineChart.draw(data, options);
        }

HTML

 <div id="chart_div" style="width: 600px; height: 400px">
        </div>
1
  • I cannot find where this code is using Highcharts. Please remove that tag. Jan 27, 2016 at 8:32

1 Answer 1

0

works fine with only two columns...

data.addColumn('string', 'Year');
data.addColumn('number', 'Quantity');
data.addRows([
 ['2008',36],
 ['2009',27],
 ['2010',39]
]);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.