Google-sheets – How to label points in a scatter plot

google sheetsgoogle-sheets-charts

I've tried using the built-in scatter plot chart and the Google scatter plot gadget. I haven't been able to figure out how to get either one to allow me to label the points in the chart. I have data like the following:

| Name1 | 36 | 1 | 
| Name2 | 22 | 3 |
| Name3 | 21 | 6 |
| Name4 |  4 | 2 |
| Name5 |  8 | 2 |

How do I label the point at (8,2) on the scatter plot as Name5, and so on?

Best Answer

Using a cell_object instead of just a value worked for me

var data = google.visualization.arrayToDataTable([
          [ {v: 36, f: 'Name1 - 36'}, 1],
          [ {v: 22, f: 'Name2 - 22'}, 3],
          [ {v: 21, f: 'Name3 - 21'}, 6],
          [ {v: 4, f: 'Name4 - 4'}, 2],
          [ {v: 8, f: 'Name5 - 8'}, 2]
        ]);