JavaScript
google.load("visualization", "1", {
packages: ["corechart"]
});
google.setOnLoadCallback(drawChart_1);
google.setOnLoadCallback(drawChart_2);
function drawChart_1() {
var data = google.visualization.arrayToDataTable([
["Y", "Your X & Y", "Product 1", "Product 2", "Product 3"],
[419, 589, null, null, null],
[386, null, 504, null, null],
[386, null, 526, null, null],
[387, null, 543, null, null],
[395, null, 564, null, null],
[402, null, 591, null, null],
[408, null, 612, null, null],
[378, null, null, 501, null],
[398, null, null, null, 600],
[460, null, null, null, 500]
]);
var options = {
title: 'Multiple lines: y values with non-sharing x points',
pointSize: 10
};
var chart = new google.visualization.LineChart(document.getElementById('chart_div_1'));
chart.draw(data, options);
}
function drawChart_2() {
var data = google.visualization.arrayToDataTable([
["Y", "Your X & Y", {label: 'Tooltip', role: 'tooltip'}, "Product 1", {label: 'Tooltip', role: 'tooltip'}, "Product 2", {label: 'Tooltip', role: 'tooltip'}, "Product 3", {label: 'Tooltip', role: 'tooltip'}],
[419,589,"tooltip info about your x & y",null,null,null,null,null,null],
[386,null,null,504,"tooltip info about product 1",null,null,null,null],
[386,null,null,526,"tooltip info about product 1",null,null,null,null],
[387,null,null,543,"tooltip info about product 1",null,null,null,null],
[395,null,null,564,"tooltip info about product 1",null,null,null,null],
[402,null,null,591,"tooltip info about product 1",null,null,null,null],
[408,null,null,612,"tooltip info about product 1",null,null,null,null],
[378,null,null,null,null,501,"tooltip info about product 2",null,null],
[383,null,null,null,null,511,"tooltip info about product 2",null,null],
[387,null,null,null,null,526,"tooltip info...