I'm using Google Charts to try and create a line chart that looks like the first one labelled Example:
https://developers.google.com/chart/interactive/docs/gallery/linechart
However, I cannot use google.visualization.arrayToDataTable() as shown in the 1st example.
The problem is I want to add annotations and annotationText to each plotted point. The documentation says I must use:
google.visualization.DataTable()
In order to do that, i must do the following:
var data1 = [
[ 'C' ,4, 'o', 'note'],
[ 'D' ,6, 'o', 'note'],
[ 'O' ,4, 'o', 'note']
];
var chartData = new google.visualization.DataTable();
chartData.addColumn('string', 'X'); // Implicit series 1 data col.
chartData.addColumn('number', 'DOGS'); // Implicit domain label col.
chartData.addColumn({type:'string', role:'annotation'});
chartData.addColumn({type:'string', role:'annotationText'});
chartData.addRows(data1);
var chart = new
google.visualization.LineChart(document.getElementById('visualization'));
var options = {
title: "My Title",
};
chart.draw(chartData,options);
This gives me one line of plotted data.
How do I adapt this to allow me to add a 2nd line of plotted data?goo