# Bar Chart not displaying all values in data table

**URL:** <https://forum.inductiveautomation.com/t/bar-chart-not-displaying-all-values-in-data-table/76691>\
**Category:** Ignition\
**Tags:** ignition81, vision\
**Created:** [July 21, 2023, 4:55am UTC](https://forum.inductiveautomation.com/t/bar-chart-not-displaying-all-values-in-data-table/76691 "2023-07-21T04:55:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brennan\_Joles](https://avatars.discourse-cdn.com/v4/letter/b/d2c977/32.png) [@Brennan\_Joles](https://forum.inductiveautomation.com/u/Brennan_Joles)\
**Post date:** [July 21, 2023, 4:55am UTC](https://forum.inductiveautomation.com/t/bar-chart-not-displaying-all-values-in-data-table/76691/1 "2023-07-21T04:55:07Z")

</div>

I always have issues with bar charts on vision and getting them to setup properly as the coding behind them is so over complicated. I have the following data table from a named query I would like to display all the values. For some reason any repeat values from the table number column will only display one of them. Any ideas on how I can display all of them as individual bars?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/7/178b3b91676dcaff8d6727ffe399d1dbfec305b2.png)

Here is the query:

```auto
SELECT TOP 10
TableNum,
schedOverTimemins
FROM Tables_Data_East_V2
WHERE t_stamp BETWEEN (:StartDate) AND (:EndDate)
ORDER BY schedOverTimemins DESC

```

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [July 21, 2023, 9:23am UTC](https://forum.inductiveautomation.com/t/bar-chart-not-displaying-all-values-in-data-table/76691/2 "2023-07-21T09:23:15Z")

</div>

> [@Brennan\_Joles](#):
>
> For some reason any repeat values from the table number column will only display one of them.

Column names must be unique. I would add a rank to the table name. The method may differ depending on the database you're using.

```plaintext
TableNum | schedOverTimemins
1-11 | 275
2-15 | 205
3-9 | 185
4-8 | 163
5-10 | 153
6-15 | 145
7-7 | 144
8-9 | 143
9-8 | 130
10-15 | 129

```

---

<div class="post-metadata">

**Author:** ![Brennan\_Joles](https://avatars.discourse-cdn.com/v4/letter/b/d2c977/32.png) [@Brennan\_Joles](https://forum.inductiveautomation.com/u/Brennan_Joles)\
**Post date:** [July 21, 2023, 9:43am UTC](https://forum.inductiveautomation.com/t/bar-chart-not-displaying-all-values-in-data-table/76691/3 "2023-07-21T09:43:53Z")

</div>

This data is being pulled from a large SQL table that automatically is being filled by transaction groups and other queries are also referencing so I do not have the ability to add a rank to every input for table numbers in the SQL table. Maybe this can be done in the named query? The bar chart will also need to auto update when a new number enters the top 10. Is there is no way to just simply display the data table exactly as is? (I guess this is why I avoid bar charts in ignition at all costs)

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [July 21, 2023, 9:58am UTC](https://forum.inductiveautomation.com/t/bar-chart-not-displaying-all-values-in-data-table/76691/4 "2023-07-21T09:58:26Z")

</div>

The rank would be part of the named query.

Alternatively:

- Add a custom property called rawData
- Bind rawData to the named query
- add a propertyChanged script

```python
if event.propertyName == 'rawData':
	rawData = event.source.rawData
	
	headers = list(rawData.getColumnNames())
	data = []
	
	for i in range(rawData.getRowCount()):
		data.append(['{}-{}'.format(i+1, rawData.getValueAt(i,0)), rawData.getValueAt(i,1)])
	
	event.source.data = system.dataset.toDataSet(headers, data)

```

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

---

<div class="post-metadata">

**Author:** ![Brennan\_Joles](https://avatars.discourse-cdn.com/v4/letter/b/d2c977/32.png) [@Brennan\_Joles](https://forum.inductiveautomation.com/u/Brennan_Joles)\
**Post date:** [July 21, 2023, 10:22am UTC](https://forum.inductiveautomation.com/t/bar-chart-not-displaying-all-values-in-data-table/76691/5 "2023-07-21T10:22:12Z")

</div>

Thank you very much the custom property worked. I always forget about those.
