Struggling with accessing the selected cell from an addListener event in Google Visualization Calendar is my current challenge. By utilizing
JSON.stringify(chart.getSelection());
, I am able to successfully print out the selected cell, which appears as [{"date":1468195200000,"row":0}]
.
The issue I am facing revolves around accessing the date object within this selection. My attempt to access it using the following code snippet:
var obj = JSON.stringify(chart.getSelection());
console.log('selected value ' + obj.date);
However, it outputs as Undefined
. When I print out the obj
, it presents as [object, object]. Any advice or direction on how to properly access this date object would be greatly appreciated. Please reach out if further information is required.