# Select area only by x coordinate using plotly.js

**URL:** <https://community.plotly.com/t/select-area-only-by-x-coordinate-using-plotly-js/4803>\
**Category:** plotly.js\
**Created:** [July 6, 2017, 2:51pm UTC](https://community.plotly.com/t/select-area-only-by-x-coordinate-using-plotly-js/4803 "2017-07-06T14:51:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![aliaksei.maniuk](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@aliaksei.maniuk](https://community.plotly.com/u/aliaksei.maniuk)\
**Post date:** [July 6, 2017, 2:51pm UTC](https://community.plotly.com/t/select-area-only-by-x-coordinate-using-plotly-js/4803/1 "2017-07-06T14:51:19Z")

</div>

I need to select the area on the chart, see example [https://jsfiddle.net/aliakseimaniuk/k556wna9/](https://jsfiddle.net/aliakseimaniuk/k556wna9/). Select works perfectly, but I want to do a light modification. I want to select only using X coordinate. It means when users try to select area it should be selected with all values at Y coordinate, regardless of the cursor position. Like on the image below  
 ![](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/4/4009ad35a30d83efeb8b294271357ba3c5677be1.JPG)

Is it possible to do that way, if yes, please provide some hints how to do that? Thank you 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:** [July 6, 2017, 3:42pm UTC](https://community.plotly.com/t/select-area-only-by-x-coordinate-using-plotly-js/4803/2 "2017-07-06T15:42:42Z")

</div>

Not at the moment, unfortunately.

---

<div class="post-metadata">

**Author:** ![aliaksei.maniuk](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@aliaksei.maniuk](https://community.plotly.com/u/aliaksei.maniuk)\
**Post date:** [July 6, 2017, 5:09pm UTC](https://community.plotly.com/t/select-area-only-by-x-coordinate-using-plotly-js/4803/3 "2017-07-06T17:09:32Z")

</div>

@etienne Thank you for the response. Do you know if there are some plans to add such functionality?

---

<div class="post-metadata">

**Author:** ![dashuser2](https://avatars.discourse-cdn.com/v4/letter/d/c67d28/32.png) [@dashuser2](https://community.plotly.com/u/dashuser2)\
**Post date:** [February 19, 2020, 3:15pm UTC](https://community.plotly.com/t/select-area-only-by-x-coordinate-using-plotly-js/4803/4 "2020-02-19T15:15:08Z")

</div>

Hi, is this possible now?

---

<div class="post-metadata">

**Author:** ![dashuser2](https://avatars.discourse-cdn.com/v4/letter/d/c67d28/32.png) [@dashuser2](https://community.plotly.com/u/dashuser2)\
**Post date:** [February 21, 2020, 9:11am UTC](https://community.plotly.com/t/select-area-only-by-x-coordinate-using-plotly-js/4803/5 "2020-02-21T09:11:19Z")

</div>

I have ended up using `selectdirection='h'` to achieve what I wanted.
