Skip to content

Commit

Permalink
descriptions2
Browse files Browse the repository at this point in the history
  • Loading branch information
mbourdo committed Jun 28, 2024
1 parent fa4d727 commit 7cf27ec
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ google.charts.load('current', {'packages':['treemap']});
google.charts.setOnLoadCallback(drawChart);

const itemDescriptions = {
'MassHealth': 'Description for Item 1',
'Item2': 'Description for Item 2',
'Item3': 'Description for Item 3',
'MassHealth': 'Description for Healthcare services',
'TAFDC': 'Description for Education services',
'Transportation': 'Description for Transportation services',
// Add more items and descriptions as needed
};

Expand All @@ -24,6 +24,7 @@ function drawChart() {
var selection = chart.getSelection();
if (selection.length > 0) {
var item = data.getValue(selection[0].row, 0);
console.log('Selected item:', item); // Debug log
var description = itemDescriptions[item] || 'No description available for ' + item;
document.getElementById('info').innerText = description;
chart.setSelection([]); // Clear the selection to prevent zooming
Expand Down

0 comments on commit 7cf27ec

Please sign in to comment.