Missing tooltips when using multiple Calendar charts

28 views
Skip to first unread message

Tony Goodchild

unread,
Mar 14, 2019, 1:40:23 PM3/14/19
to Google Visualization API
I am using the calendar chart to visualise resourcing load and am drawing multiple calendars on a page - one for for each staff member.

I'm drawing out the charts as below:

dataTables[tkUserId] = new google.visualization.DataTable();
dataTables
[tkUserId].addColumn({ type: 'date', id: 'Date' });
dataTables
[tkUserId].addColumn({ type: 'number', id: 'Workload' });
       
for (var k in usrLoad){
 
if (usrLoad.hasOwnProperty(k)) {
   
var dd = k.substring(0, 2);
   
var mm = parseInt(k.substring(3, 5)) -1;
   
var yy = k.substring(6, 10);
   
var load = usrLoad[k];
    tkDate
= new Date(yy, mm, dd);
    dataTables
[tkUserId].addRows([[ tkDate, load ]]);
 
}

}
 
calendars
[tkUserId] = new google.visualization.Calendar(document.getElementById('res' + tkUserId));

 
var options = {
   title
: usr,
  colorAxis
: {maxValue: 100},
  toolTip
: {isHtml: true},
};
 
calendars
[tkUserId].draw(dataTables[tkUserId], options);

The charts are drawing fine, but I only get the tooltip showing the value for each day on the last chart drawn.
Is there a way to have every calendar with a functioning tooltip over each date?

I have tried using tooltip.isHtml as both true and false in case that helped but it made no difference.

thanks!


Screenshot 2019-03-14 at 17.39.18.png


Tony Goodchild

unread,
Apr 16, 2019, 10:12:18 AM4/16/19
to Google Visualization API
Hi All, just wondering if anyone had any ideas on this one? Still not managed to find a solution.

thanks!
Tony

Daniel LaLiberte

unread,
Apr 16, 2019, 11:44:30 AM4/16/19
to Google Visualization API
It appears that your two calendars will use distinct elements with globally unique ids, based on the user id.  But tooltips use an internally generated element that has its own id, and perhaps it is not a globally unique id.  If so, that might be relatively easy to fix.



--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/621ede81-47e3-4d41-b43e-834c6132f29e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Daniel LaLiberte

unread,
Apr 16, 2019, 11:45:58 AM4/16/19
to Google Visualization API
Maybe as a workaround, you could isolate one or both charts in separate iframes.  
Reply all
Reply to author
Forward
0 new messages