# Accessing plot data without using plotly\_click

**URL:** <https://community.plotly.com/t/accessing-plot-data-without-using-plotly-click/5906>\
**Category:** plotly.js\
**Created:** [September 22, 2017, 10:49am UTC](https://community.plotly.com/t/accessing-plot-data-without-using-plotly-click/5906 "2017-09-22T10:49:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmancera](https://avatars.discourse-cdn.com/v4/letter/d/ce73a5/32.png) [@dmancera](https://community.plotly.com/u/dmancera)\
**Post date:** [September 22, 2017, 10:49am UTC](https://community.plotly.com/t/accessing-plot-data-without-using-plotly-click/5906/1 "2017-09-22T10:49:55Z")

</div>

Hello,

Is possible to access plot data without use the plotly\_click event?

I want to access from an external function in order to add new data, so i need the x axis array.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![etienne](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/etienne/32/17_2.png) [@etienne](https://community.plotly.com/u/etienne)\
**Post date:** [September 22, 2017, 3:19pm UTC](https://community.plotly.com/t/accessing-plot-data-without-using-plotly-click/5906/2 "2017-09-22T15:19:01Z")

</div>

Something like:

```auto
var gd = document.getElementById('id of your graph div')

gd.data[0].x
// => returns the x array of the first trace

```

---

<div class="post-metadata">

**Author:** ![dmancera](https://avatars.discourse-cdn.com/v4/letter/d/ce73a5/32.png) [@dmancera](https://community.plotly.com/u/dmancera)\
**Post date:** [September 26, 2017, 7:59am UTC](https://community.plotly.com/t/accessing-plot-data-without-using-plotly-click/5906/3 "2017-09-26T07:59:21Z")

</div>

Hi Ettiene,

Yes and I must apologice because the way to access is at the beggining of the documentation… I ussually scroll down without look at it.

I tried to delete my post but i didnt see how.

Sorry and thanks for the response.

---

<div class="post-metadata">

**Author:** ![etienne](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/etienne/32/17_2.png) [@etienne](https://community.plotly.com/u/etienne)\
**Post date:** [September 26, 2017, 1:36pm UTC](https://community.plotly.com/t/accessing-plot-data-without-using-plotly-click/5906/4 "2017-09-26T13:36:39Z")

</div>

> [@dmancera](#):
>
> I tried to delete my post but i didnt see how.

Don’t worry about it. Thanks for using plotly.js!
