I have been working diligently on constructing a timeline for our team's Project Roadmap.
Everything is set up quite nicely: I've successfully embedded the Timeline into our Google Site and it seems to be functioning well with all the components added thus far.
My next objective is to incorporate a link on the RowLabel that will redirect me to another page within the Google Site. While I've come across some solutions for adding a listener and linking to a specific row item, my focus lies in attaching the link directly to the RowLabel itself, rather than the BarLabel.
For reference, here's an example of the current timeline implemented on the Google Site: https://sites.google.com/view/timeline-testing/home
What I aim to achieve is depicted in this Timeline Concept image: Timeline Concept
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load("current", {packages:["timeline"]});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var container = document.getElementById('roadmap');
var chart = new google.visualization.Timeline(container);
var dataTable = new google.visualization.DataTable();
dataTable.addColumn({ type: 'string', id: 'Category' });
dataTable.addColumn({ type: 'string', id: 'Project' });
dataTable.addColumn({ type: 'string', role: 'tooltip', 'p': {'html': true} });
dataTable.addColumn({ type: 'string', id: 'style', role: 'style' });
dataTable.addColumn({ type: 'date', id: 'Start' });
dataTable.addColumn({ type: 'date', id: 'End' });
dataTable.addRows([
[ 'Category 1', 'Project 1',
'<p style="padding:5px"><b>Overall Project:</b> Program X <br><b>Description:</b> Test
description for Project 1 <hr> <b> Start:</b> 2020/4/1 <br> <b> End:</b> 2020/8/15</p>',
'#2B8000', new Date(2020, 3, 13), new Date(2020, 6, 13)],
[ 'Category 1', 'Project 2',
'<p style="padding:5px"><b>Overall Project:</b> Program X <br><b>Description:</b> Test
description for Project 2 <hr> <b>Start:</b> 2020/4/1 <br> <b>End:</b> 2020/8/15</p>',
'#2B8000', new Date(2020, 4, 22), new Date(2020, 6, 24)],
// Additional rows...
]);
// More code for customization options and functionalities
}
</script>
// Some additional styling rules
// div containing roadmap visualization
<div id="roadmap" style="height: 100%;"></div>
I am currently trying to configure the selector to detect when a RowLabel is clicked. There's uncertainty regarding where to store the link information within the DataTable. Should it be stored as another Data Column? The attempts at adding an extra Data Column like this have resulted in errors: dataTable.addColumn({ type: 'string', id: 'link' });
// Further elaboration on data structure...Any guidance or assistance on this matter would be greatly appreciated!
Thank you,
UPDATE
Here is the status of the code: Styling of the rowLabel works fine, but the click event does not trigger on the Google Site Embed. To view the test on Google Site, visit this link: https://sites.google.com/view/timeline-testing/home
// Latest code snippet showcasing enhancements and modifications // Implementation of needed functionality and event handling