Thank you...

On Tue, May 27, 2014 at 11:54 AM, Andrew Gallant <[email protected]>wrote:

> Add it in between the lines creating the chart and drawing the chart:
>
> var chart = new
> google.visualization.ScatterChart(document.getElementById('chart_div'));
> google.visualization.events.addListener(chart, 'select', function () {
>
>     var selection = chart.getSelection();
>     // selection is an array of objects
>     // iterate over the array in case there are zero (an element was
> deselected) or multiple selections
>     for (var i = 0; i < selection.length; i++) {
>         // selection[i].row is the row index, if row is null, then the
> user clicked on the legend
>         // selection[i].column is the column index, if column is null,
> then the user clicked on a domain axis label
>
>         // do something with selected element
>     }
> });
> chart.draw(data, options);
>
>
> On Tuesday, May 27, 2014 1:39:02 AM UTC-4, Ananya Ojha wrote:
>
>> My code is :
>> google.load("visualization", "1", {packages:["corechart"]});
>> google.setOnLoadCallback(drawChart);
>> function drawChart(result) {
>>
>>         var data = new google.visualization.DataTable();
>>         data.addColumn('date', 'Date');
>>         data.addColumn('timeofday','Time');
>>         data.addColumn({type: 'string', role: 'tooltip'});
>>
>>         var jsonResult = jQuery.parseJSON(result);
>>         var resultQuery = jsonResult.length;
>>
>>             $.each(jsonResult, function(k, v) {
>>                 var d = new Date(v.timestart);
>> data.addRow([new Date(d.getFullYear(), d.getMonth(), d.getDate()),
>> [d.getHours(), d.getMinutes(), d.getSeconds(),
>> d.getMilliseconds()],v.file]);
>>             });
>>             var options = {
>>                 legend: 'none',
>>                 vAxis: {
>>                     title: "Time",
>>                     titleTextStyle: {italic: false},
>>                     format: 'HH:mm',
>>                     gridlines: {
>>                         color: 'transparent'
>>                     }
>>                 },
>>                 hAxis: {
>>                     title: "Date",
>>                     titleTextStyle: {italic: false},
>>                     gridlines: {
>>                         color: 'transparent'
>>                     }
>>                 },
>>                 explorer: {
>>                     actions: ['dragToZoom', 'rightClickToReset']
>>                 }
>>                 /*explorer: {
>>                     maxZoomOut:2,
>>                     keepInBounds: true
>>                 }*/
>>             };
>>             var chart = new google.visualization.ScatterChart(document.
>> getElementById('chart_div'));
>>             chart.draw(data, options);
>>             return resultQuery;
>> }
>>
>>
>> WHere to put the code that you have mentioned?
>>
>>
>> On Mon, May 26, 2014 at 10:42 PM, Ananya <[email protected]> wrote:
>>
>>> Thank you.. Let me try with this code..
>>>
>>>
>>> On Mon, May 26, 2014 at 9:50 PM, Andrew Gallant <[email protected]>wrote:
>>>
>>>> You need to use a "select" event handler for the chart:
>>>>
>>>> google.visualization.events.addListener(chart, 'select', function () {
>>>>     var selection = chart.getSelection();
>>>>     // selection is an array of objects
>>>>     // iterate over the array in case there are zero (an element was
>>>> deselected) or multiple selections
>>>>     for (var i = 0; i < selection.length; i++) {
>>>>         // selection[i].row is the row index, if row is null, then the
>>>> user clicked on the legend
>>>>         // selection[i].column is the column index, if column is null,
>>>> then the user clicked on a domain axis label
>>>>
>>>>         // do something with selected element
>>>>     }
>>>> });
>>>>
>>>>
>>>> On Monday, May 26, 2014 10:21:17 AM UTC-4, Ananya Ojha wrote:
>>>>>
>>>>> i am using google charts, for every data points(circles) I want to be
>>>>> able to click on that and open a light box showing some data. Can anybody
>>>>> help?
>>>>>
>>>>  --
>>>> You received this message because you are subscribed to a topic in the
>>>> Google Groups "Google Visualization API" group.
>>>> To unsubscribe from this topic, visit https://groups.google.com/d/
>>>> topic/google-visualization-api/ABVKGd0YOzg/unsubscribe.
>>>> To unsubscribe from this group and all its topics, send an email to
>>>> [email protected].
>>>> To post to this group, send email to [email protected].
>>>>
>>>> Visit this group at http://groups.google.com/
>>>> group/google-visualization-api.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>>
>>> --
>>> Warm Regards...
>>>       Ananya Ojha
>>>
>>
>>
>>
>> --
>> Warm Regards...
>>       Ananya Ojha
>>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Google Visualization API" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/google-visualization-api/ABVKGd0YOzg/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to
> [email protected].
> Visit this group at
> http://groups.google.com/group/google-visualization-api.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Warm Regards...
      Ananya Ojha

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

Reply via email to