14

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?

pnuts
  • 17,883
  • 5
  • 55
  • 103
digitaljoel
  • 243
  • 1
  • 2
  • 6

3 Answers3

15

Today's Google announced that now it's possible to add data labels.

For the data included in the question,

  1. Move the first column to the rightmost position.

     | A | B |  C   |
    -+---+---+------+
    1| 36|  1|Name1 |
    2| 22|  3|Name2 |
    3| 21|  6|Name3 |
    4|  4|  2|Name4 |
    5|  8|  2|Name5 |
    

    Note: Labels should be text. If the labels are numbers, dates, times, durations convert them to text. For this we could use TO_TEXT, TEXT, to add an ' as prefix or set the cell formatting to text.

  2. Then insert the chart and choose the scatter plot chart.

Example

NOTE: If you want to play with the example please make a copy instead to ask permission to edit it. To make a copy click on File > Make a copy.

Rubén - Volunteer Moderator -
  • 46,305
  • 18
  • 101
  • 297
2

Just to make the procedure to get to Ruben's chart explicit, here are the steps I took:

  • in the chart editor --> Setup go down to your series and click on the 3 dots next to your series.

  • choose add labels. By default it will take the X-axis. enter image description here

  • But it you click on the small grid icon, you can choose the range for the labels. enter image description here enter image description here

  • then you get the result enter image description here

lokxs
  • 121
  • 2
0

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]
        ]);