# Delete selected datapoint on chart from dataset

**URL:** <https://forum.inductiveautomation.com/t/delete-selected-datapoint-on-chart-from-dataset/950>\
**Category:** Archived Topics\
**Created:** [January 16, 2009, 11:40pm UTC](https://forum.inductiveautomation.com/t/delete-selected-datapoint-on-chart-from-dataset/950 "2009-01-16T23:40:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://forum.inductiveautomation.com/u/Jonathan)\
**Post date:** [January 16, 2009, 11:40pm UTC](https://forum.inductiveautomation.com/t/delete-selected-datapoint-on-chart-from-dataset/950/1 "2009-01-16T23:40:44Z")

</div>

Is there a way to tell which data point on a chart is selected in order to delete it from the charts dataset? I would like to be able to exclude a point on the graph. It would be ideal have the point deleted when right clicked.

I have looked at the property selectedData on the chart, but the four items it returns are not unique.

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [January 17, 2009, 12:03am UTC](https://forum.inductiveautomation.com/t/delete-selected-datapoint-on-chart-from-dataset/950/2 "2009-01-17T00:03:24Z")

</div>

selectedData is what should be used for this. Why are they not unique?

---

<div class="post-metadata">

**Author:** ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://forum.inductiveautomation.com/u/Jonathan)\
**Post date:** [January 17, 2009, 12:10am UTC](https://forum.inductiveautomation.com/t/delete-selected-datapoint-on-chart-from-dataset/950/3 "2009-01-17T00:10:30Z")

</div>

The dataset being graphed is from lab tests. One column is the sample label and the other is the measured value for a perticular test. some times a test will be run multiple times on the same sample and will have the same label.

Is there a way I can add a unique key to the charts dataset without it graphing the unique key?

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [January 17, 2009, 12:17am UTC](https://forum.inductiveautomation.com/t/delete-selected-datapoint-on-chart-from-dataset/950/4 "2009-01-17T00:17:23Z")

</div>

But the selectedData property has four components, including the x and y values. Shouldn’t that combination be unique? If not, isn’t it irrelevant? If the points are completely the same, just delete one of them.

---

<div class="post-metadata">

**Author:** ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://forum.inductiveautomation.com/u/Jonathan)\
**Post date:** [January 20, 2009, 6:07pm UTC](https://forum.inductiveautomation.com/t/delete-selected-datapoint-on-chart-from-dataset/950/5 "2009-01-20T18:07:46Z")

</div>

ok that seems to work just fine. Now when the datapoint is selected and removed the yellow selection dot stays even though the point is not graphed any more. What property do I need to set in order to get the yellow selection to disappear?

---

<div class="post-metadata">

**Author:** ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://forum.inductiveautomation.com/u/Jonathan)\
**Post date:** [January 20, 2009, 7:01pm UTC](https://forum.inductiveautomation.com/t/delete-selected-datapoint-on-chart-from-dataset/950/6 "2009-01-20T19:01:49Z")

</div>

Also can you make one dataset on the chart selectable and another dataset not selectable?

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [January 22, 2009, 12:05am UTC](https://forum.inductiveautomation.com/t/delete-selected-datapoint-on-chart-from-dataset/950/7 "2009-01-22T00:05:31Z")

</div>

You can call `table.clearSelection()` to remove the yellow selection. You cannot make just one dataset selectable, they all are by default.
