# Delete column from pie chart

**URL:** <https://forum.inductiveautomation.com/t/delete-column-from-pie-chart/59146>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [May 3, 2022, 7:42am UTC](https://forum.inductiveautomation.com/t/delete-column-from-pie-chart/59146 "2022-05-03T07:42:24Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![andreia\_chiurato](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@andreia\_chiurato](https://forum.inductiveautomation.com/u/andreia_chiurato)\
**Post date:** [May 3, 2022, 7:42am UTC](https://forum.inductiveautomation.com/t/delete-column-from-pie-chart/59146/1 "2022-05-03T07:42:24Z")

</div>

I’m using a Pie chart, which should read 2 historical tags. And in your dataset I’m using TagHistory to get the 2 tags.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/2/2223aa0fe5c3e1b42e11cec28a5151ba4b1bc9f2.png)

The problem is that when the application goes to runtime, it also takes the column “\_tstamp” and **overlays the other values.**  
If I cancel the dataset, it returns again when the application is started again.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/6/861fa96b3ad3e25f0793cf6910910c22c733913a.png)

Is there a way to cancel this \_tstamp column, or some property not to show in the graph?

Thanks!!

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 3, 2022, 3:30pm UTC](https://forum.inductiveautomation.com/t/delete-column-from-pie-chart/59146/2 "2022-05-03T15:30:48Z")

</div>

Move your history binding to a custom property of type dataset.  
Change the data property’s binding to an expression binding, and use the [`columnRearrange`](https://docs.inductiveautomation.com/display/DOC81/columnRearrange) function (ignore the name) to filter out the `t_stamp` column.

---

<div class="post-metadata">

**Author:** ![andreia\_chiurato](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@andreia\_chiurato](https://forum.inductiveautomation.com/u/andreia_chiurato)\
**Post date:** [May 4, 2022, 8:37am UTC](https://forum.inductiveautomation.com/t/delete-column-from-pie-chart/59146/3 "2022-05-04T08:37:10Z")

</div>

Hi PGriffith , thanks for your attemption!  
This part worked, but now it takes 4 readings and the first row, in column A, appears blank, I tried some scripts in the graphics to delete just that row, rowindex 0, but it deletes everything, or it deletes the others and this one stays. Do you have any idea? Thanks again

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/4/142b3be74c81317d4089a659917221ad887dcbec.png)

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [May 4, 2022, 8:39am UTC](https://forum.inductiveautomation.com/t/delete-column-from-pie-chart/59146/4 "2022-05-04T08:39:26Z")

</div>

We’ll need to see your scripts in order to see if you missed something in there.

---

<div class="post-metadata">

**Author:** ![andreia\_chiurato](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@andreia\_chiurato](https://forum.inductiveautomation.com/u/andreia_chiurato)\
**Post date:** [May 26, 2022, 8:39am UTC](https://forum.inductiveautomation.com/t/delete-column-from-pie-chart/59146/5 "2022-05-26T08:39:00Z")

</div>

Hi , sorry for the delay…

I did like this:  
1o. ( Custom Properties - like said @paul-griffith )

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/4/f46ee5d770a767f786c69ddfd66f46a8ed4431b1.png)

2o ( where do i get the values from the table)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/c/dcbb2191e7df82956c2b08476b8e673096530e91.png)

3o ( original DataSet)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/3/c3f5a5e79e76876624a40731cbcff3ed2a5c1cfe.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/4/04bf5e3c0ce376a53e97284f27967cd3344e9a9c.png)

4o ( to delete the first row)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/2/52983e60bc225f3c1e7b9ce0affa7d3b14bc3c6e.png)

---

<div class="post-metadata">

**Author:** ![andreia\_chiurato](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@andreia\_chiurato](https://forum.inductiveautomation.com/u/andreia_chiurato)\
**Post date:** [June 7, 2022, 12:43pm UTC](https://forum.inductiveautomation.com/t/delete-column-from-pie-chart/59146/6 "2022-06-07T12:43:47Z")

</div>

Hi how are you? Any idea for this step above? Thank you!!

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [June 7, 2022, 1:41pm UTC](https://forum.inductiveautomation.com/t/delete-column-from-pie-chart/59146/7 "2022-06-07T13:41:44Z")

</div>

1. I don’t believe you need to `import system` here.
2. Your variable, `myList` is actually a dataset. I would be careful with the naming.
3. `self.data` and `event.source.parent.getComponent('PieChart3').data` are references to the same property. I would use `self.data`
4. A dataset does not have a `selectedIndex`. I would expect the script to fail here.
5. `system.dataset.deleteRow()` takes an Integer argument for the rowIndex, you have supplied it with a List. It _ **"might"** _ be smart enough to do a conversion, but I wouldn’t count on it.
6. Your configureChart extension function is writing to the Data property, but you also have a binding on that property. So any changes you made in the configureChart function I would expect get overwritten by the binding.

You don’t need the script. You only need the bindings as @paul-griffith suggested.

The tag history binding on the `Dataset2` custom property, and the expression binding on the `Data` property.

If you do that and you’re still missing one data point, then I would make sure that nothing else is writing to the data property.

---

<div class="post-metadata">

**Author:** ![andreia\_chiurato](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@andreia\_chiurato](https://forum.inductiveautomation.com/u/andreia_chiurato)\
**Post date:** [June 9, 2022, 12:13pm UTC](https://forum.inductiveautomation.com/t/delete-column-from-pie-chart/59146/8 "2022-06-09T12:13:28Z")

</div>

Hi , you are right! I deleted the scripts , and did just the 2nd dataSet like told PGriffith. But I must change something, see below . Thanks for help.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/b/3b24e3afacd854da01a9e6974a72ce11b61a8a45.png)

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [June 9, 2022, 2:34pm UTC](https://forum.inductiveautomation.com/t/delete-column-from-pie-chart/59146/9 "2022-06-09T14:34:40Z")

</div>

I don’t think you have followed @paul-griffith’s advice closely enough. This looks as though you have a Tag History Binding on the Data property of the PieChart.

1. Create a custom property of type dataset. It can be on the Pie Chart or the Root Container, doesn’t really matter.
2. Add a Tag History Binding to the custom property with whatever settings you want.
3. Add an expression binding to the Data property of the Pie Chart using the `columnRearrange` expression function to filter out the `t_stamp` column, and populate the Pie Chart.

---

<div class="post-metadata">

**Author:** ![andreia\_chiurato](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@andreia\_chiurato](https://forum.inductiveautomation.com/u/andreia_chiurato)\
**Post date:** [June 9, 2022, 3:01pm UTC](https://forum.inductiveautomation.com/t/delete-column-from-pie-chart/59146/10 "2022-06-09T15:01:05Z")

</div>

Yes, that’s exactly what I did. and in the TAgHistory property of the DAtaset2 I configured it according to the printscreen and in the original Data of the Chart I used the ColumnRearrange,tks
