Gantt Tooltips - How to customize?

72 views
Skip to first unread message

Curt Christianson

unread,
Aug 19, 2016, 12:40:34 PM8/19/16
to Google Visualization API
I've added the column to the data:

var data = new google.visualization.DataTable();

data.addColumn('string', 'Task ID');

data.addColumn('string', 'Task Name');

data.addColumn('string', 'Resource');

data.addColumn('date', 'Start Date');

data.addColumn('date', 'End Date');

data.addColumn('number', 'Duration');

data.addColumn('number', 'Percent Complete');

data.addColumn('string', 'Dependencies');

data.addColumn({type: 'string', role: 'tooltip'});


I've added the extra data in the data.addRows([

  ['1', 'Title here', "Res", new Date(2016, 7, 2), new Date(2016, 10, 2), 0, 100, null, 'tooltip here']

]);


I've added it to the options:

var options = {

    tooltip: {isHtml: true)

};


But I can't get anything but the default tooltip. I would like to remove existing items from the tooltip and add custom items. What am I missing?

PCase

unread,
Sep 14, 2016, 6:54:16 AM9/14/16
to Google Visualization API
data.addColumn({ 'type': 'string', 'role': 'tooltip', 'p': { 'html': true } });

then you are able to insert your html code as String directly in your array...

data.addRows([

  ['1''Title here'"Res"new Date(2016, 7, 2), new Date(2016, 10, 2), 0, 100, null'<div>e.g.</div>']

Reply all
Reply to author
Forward
0 new messages