How Can I Get Selected Data On Histogram Charts??

131 views
Skip to first unread message

Dustqm Sybolls

unread,
Mar 6, 2014, 8:03:27 AM3/6/14
to google-visua...@googlegroups.com
I added listener like this;

google.visualization.events.addListener(chart, 'select', myClickHandler);

My listener function like this;

                      function myClickHandler(){
var selection = chart.getSelection();
var message = '';

 for (var i = 0; i < selection.length; i++) {
   var item = selection[i];
   var value = data.getValue(item.row, 0);
   if (item.row != null && item.column != null) {
     message += '{row:' + item.row + ',column:' + item.column + '} / Value: ' + value;
   } else if (item.row != null) {
     message += '{row:' + item.row + '}';
   } else if (item.column != null) {
     message += '{column:' + item.column + '}';
   }
 }
 if (message != '') {
 alert('You selected ' + message);
 }
}

But value is not true.. Because when I select, it gives me place on which column is on it.. But I want the row of data array..

So how can I get selected data value??

Sergey Grabkovsky

unread,
Mar 6, 2014, 11:02:44 AM3/6/14
to google-visua...@googlegroups.com
Hello, it appears you found a bug with our Histogram selection. We will be working to fix this, but unfortunately I do not have an estimate for when this will be fixed.

- Sergey


--
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 http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.

Dustqm Sybolls

unread,
Mar 7, 2014, 1:33:50 AM3/7/14
to google-visua...@googlegroups.com
Could you inform me with reply this question??

6 Mart 2014 Perşembe 18:02:44 UTC+2 tarihinde Sergey yazdı:
Hello, it appears you found a bug with our Histogram selection. We will be working to fix this, but unfortunately I do not have an estimate for when this will be fixed.

- Sergey


On Thu, Mar 6, 2014 at 8:03 AM, Dustqm Sybolls <dus...@gmail.com> wrote:
I added listener like this;

google.visualization.events.addListener(chart, 'select', myClickHandler);

My listener function like this;

                      function myClickHandler(){
var selection = chart.getSelection();
var message = '';

 for (var i = 0; i < selection.length; i++) {
   var item = selection[i];
   var value = data.getValue(item.row, 0);
   if (item.row != null && item.column != null) {
     message += '{row:' + item.row + ',column:' + item.column + '} / Value: ' + value;
   } else if (item.row != null) {
     message += '{row:' + item.row + '}';
   } else if (item.column != null) {
     message += '{column:' + item.column + '}';
   }
 }
 if (message != '') {
 alert('You selected ' + message);
 }
}

But value is not true.. Because when I select, it gives me place on which column is on it.. But I want the row of data array..

So how can I get selected data value??

--
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-visualization-api+unsub...@googlegroups.com.

Sergey Grabkovsky

unread,
Mar 7, 2014, 9:39:02 AM3/7/14
to google-visua...@googlegroups.com
I am not sure which question you are referring to. If you are referring to your original original question, "So how can I get selected data value?", then the answer is that you cannot at the moment, as there is a bug in the code and it returns the wrong selection. We are aware of this issue and will be working to fix it.

- Sergey


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 http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

Kevan Killion

unread,
May 6, 2014, 11:25:21 AM5/6/14
to google-visua...@googlegroups.com
As of May 6th, 2014 this bug seems to still be present.

- Sergey



- Sergey


To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.

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

LE Sacks

unread,
Jun 10, 2015, 3:20:29 AM6/10/15
to google-visua...@googlegroups.com
Still no action on this?

It really would be so useful to get bin values for selections...

cheers

- Sergey


To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.

Sergey Grabkovsky

unread,
Jun 10, 2015, 3:49:56 PM6/10/15
to google-visua...@googlegroups.com
Hi,

It appears to work for me in this example: http://jsfiddle.net/q91h2wj7/

Can you give me an example of where it doesn't work?

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.

--
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 http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

LE Sacks

unread,
Aug 6, 2015, 9:31:11 AM8/6/15
to Google Visualization API
My bad.
That works - but what I was looking for was to retrieve the number of entries in each bin... which is a different question.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.

--
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-visualization-api+unsub...@googlegroups.com.

Sergey Grabkovsky

unread,
Aug 6, 2015, 9:39:34 AM8/6/15
to Google Visualization API
Yeah, I don't believe we have any way of retrieving the number of entries in each bin.

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.

--
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 http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

--
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.

LE Sacks

unread,
Aug 7, 2015, 5:56:47 AM8/7/15
to Google Visualization API
Hi,
thanks for confirming that I haven't missed something!
Shame, though... I wouldn't mind being able to do that...

cheers
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.

--
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-visualization-api+unsub...@googlegroups.com.

To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

--
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-visualization-api+unsub...@googlegroups.com.

Ekta Agarwal

unread,
Sep 10, 2015, 4:08:48 AM9/10/15
to Google Visualization API
Is it possible for me to get the bin information?
Basically, the user has selected a bar in the histogram. I want information about the bar. 
The start and end for the column on the haxis would be useful information. 
Can I get that? 

Thanks, 
Ekta 

Daniel LaLiberte

unread,
Sep 10, 2015, 8:05:41 AM9/10/15
to Google Visualization API
Ekta,

Information about the bins is not available at this time.  We are planning on overhauling the Histogram chart at some point to provide much more capability, along with better integration with the rest of the charts, so we will keep this request in mind.

--
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 http://groups.google.com/group/google-visualization-api.

For more options, visit https://groups.google.com/d/optout.



--
dlaliberte@Google.com   5CC, Cambridge MA
daniel.laliberte@GMail.com 9 Juniper Ridge Road, Acton MA

Joshua Horn

unread,
Nov 10, 2015, 5:59:25 PM11/10/15
to Google Visualization API
Any update on when we might be able to get the information about what is in a selected bin on a histogram chart? It would be very helpful to me...


To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.

To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.



--
dlali...@Google.com   5CC, Cambridge MA
daniel.l...@GMail.com 9 Juniper Ridge Road, Acton MA

Drew Baden

unread,
Mar 12, 2017, 9:19:49 PM3/12/17
to Google Visualization API
I have a similar question:  I make a histogram and draw it, and it looks just fine.  Then I want to loop over all the values in the plot:  that is, I want to know for each bin now many entries in that bin.   I tired chart.getSelection() but the .length returned 0.

Any ideas?
Reply all
Reply to author
Forward
0 new messages