# Annotation with extendtraces?

**URL:** <https://community.plotly.com/t/annotation-with-extendtraces/43410>\
**Category:** plotly.js\
**Created:** [August 5, 2020, 1:16pm UTC](https://community.plotly.com/t/annotation-with-extendtraces/43410 "2020-08-05T13:16:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mrfatboy](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@Mrfatboy](https://community.plotly.com/u/Mrfatboy)\
**Post date:** [August 5, 2020, 1:16pm UTC](https://community.plotly.com/t/annotation-with-extendtraces/43410/1 "2020-08-05T13:16:25Z")

</div>

I am plotting a graph using the extendtraces function. On certain data plots I would like to add an annotation. Is that possible? How?

Any suggestions on how to accomplish this?

The extendtraces function seems very limited according to the documentation.

---

<div class="post-metadata">

**Author:** ![Saratoga](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/saratoga/32/28634_2.png) [@Saratoga](https://community.plotly.com/u/Saratoga)\
**Post date:** [August 7, 2020, 1:56am UTC](https://community.plotly.com/t/annotation-with-extendtraces/43410/2 "2020-08-07T01:56:18Z")

</div>

Something like this could help you, adjust it to what you need

```auto
		var newAnnotation = {
			x: x,
			y: y,
			xref: 'x',
			yref: 'y',
			yanchor: yanchor,
			ax: 0,
			ay: ay,
			bgcolor: color,
			borderpad: 3,
			arrowcolor: color,
			font: {
				size:8,
				color: 'black'
			},
			text: textLabel
		},
		newIndex = (myPlot.layout.annotations || []).length;

		Plotly.relayout(myPlot, 'annotations[' + newIndex + ']', newAnnotation)

```

---

<div class="post-metadata">

**Author:** ![Mrfatboy](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@Mrfatboy](https://community.plotly.com/u/Mrfatboy)\
**Post date:** [August 7, 2020, 2:24am UTC](https://community.plotly.com/t/annotation-with-extendtraces/43410/3 "2020-08-07T02:24:54Z")

</div>

Thanks for replying.

I need to use extendtraces. My plot is interactive and live. It does not plot all the data at once. Extendtraces doesn’t seem to support extra info when plotting a point.

I hope I’m wrong and someone has a solution.

Any insight there?
