You can add text to create labels for the points in a scatter plot.
The goal is to display the comma-separated values for the first (x) and second (y) fields of each item in dataset.
The text nodes need x and y attributes to position it on the SVG canvas. In this challenge, the y value (which determines height) can use the same value that the circle uses for its cy attribute. The x value can be slightly larger than the cx value of the circle, so the label is visible. This will push the label to the right of the plotted point.
Обозначьте каждую точку на графике рассеяния, используя text элементы. Текст метки должен быть двумя значениями, разделенными запятой и пробелом. Например, ярлык для первой точки - «34, 78». Установите атрибут x чтобы он был на 5 единиц больше, чем значение, которое вы использовали для атрибута cx на circle . Установите атрибут y же, как это используется для значения cy на circle .