How to hire click function in Google timeline Chart

ساخت وبلاگ

I am using Google Timeline chart and want to hire a click function. Simply when I clicked on the colored rectangles or text I want a bootstrap Modal show up.

google.charts.load("current", {packages:["timeline"]});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var container = document.getElementById('example5.1');
var chart = new google.visualization.Timeline(container);
var dataTable = new google.visualization.DataTable();
dataTable.addColumn({ type: 'string', id: 'Room' });
dataTable.addColumn({ type: 'string', id: 'Name' });
dataTable.addColumn({ type: 'date', id: 'Start' });
dataTable.addColumn({ type: 'date', id: 'End' });
dataTable.addRows([ [ 'Magnolia Room', 'Beginning JavaScript', new Date(2017, 1, 30),
new Date(2017, 2, 30) ], [ 'Learning for Life', 'Intermediate JavaScript', new Date(2017, 3, 1),
new Date(2017, 4, 30) ], [ 'Magnolia Room', 'Advanced JavaScript', new Date(2017, 5, 01),
new Date(2017, 6, 30) ], [ 'Willow Room', 'Beginning Google Charts', new Date(2017, 1, 30),
new Date(2017, 3, 30) ], [ 'Willow Room', 'Intermediate Google Charts', new Date(2017, 4, 30),
new Date(2017, 5, 30) ], [ 'Willow Room', 'Advanced Google Charts', new Date(2017, 6, 30),
new Date(2018, 1, 30) ]]);
var options = {
timeline: { colorByRowLabel: true }
};
chart.draw(dataTable, options);
}

Please take a look at this Fiddle

please help.

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 429 تاريخ : چهارشنبه 3 خرداد 1396 ساعت: 22:05