# Bar chart not displaying output from DB

**URL:** <https://forum.inductiveautomation.com/t/bar-chart-not-displaying-output-from-db/32825>\
**Category:** Ignition\
**Created:** [March 5, 2020, 10:02am UTC](https://forum.inductiveautomation.com/t/bar-chart-not-displaying-output-from-db/32825 "2020-03-05T10:02:19Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![szcz](https://avatars.discourse-cdn.com/v4/letter/s/ec9cab/32.png) [@szcz](https://forum.inductiveautomation.com/u/szcz)\
**Post date:** [March 5, 2020, 10:02am UTC](https://forum.inductiveautomation.com/t/bar-chart-not-displaying-output-from-db/32825/1 "2020-03-05T10:02:19Z")

</div>

Hello all,

I am experiencing difficulties when trying to display result from SQL query from database (result of the query is on image below. I would like to display these values in bar-chart (1st column should be category (i.e. label for X axis) and 2nd-last column should be value) - it means for one category, three bars would be displayed. I thought this is gonna be no-brainer (15 seconds to configure the bar chart), but I am failing to see what am I doing wrong (I had to hide values in column projectnumber).

Behavior of the bar char is as follows:

1. I enter the SQL query to the data atribute
2. click OK
3. data atribute does not change at all - like I haven’t changed anything.

![obrazek](https://us1.discourse-cdn.com/inductiveautomation/original/2X/a/a45465ead97997d2b96e23a64aa3bbcc35b10296.png)

Please advise. Thank you in advance.

Take care,  
SZ

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 5, 2020, 11:53am UTC](https://forum.inductiveautomation.com/t/bar-chart-not-displaying-output-from-db/32825/2 "2020-03-05T11:53:21Z")

</div>

> [@szcz](#):
>
> I enter the SQL query to the data atribute

Show your binding configuration for this.

---

<div class="post-metadata">

**Author:** ![szcz](https://avatars.discourse-cdn.com/v4/letter/s/ec9cab/32.png) [@szcz](https://forum.inductiveautomation.com/u/szcz)\
**Post date:** [March 5, 2020, 12:27pm UTC](https://forum.inductiveautomation.com/t/bar-chart-not-displaying-output-from-db/32825/3 "2020-03-05T12:27:44Z")

</div>

Hello, I have this:

 ![obrazek](https://us1.discourse-cdn.com/inductiveautomation/original/2X/f/fe497e368f5b7e39edfb5e4d2055d21dea917351.png)

After clicking OK, I don’t get any error, the bart chart sticks with the default preview (energy statistics that you see when you drag&drop the chart from toolbox on the window).

In SQL Management studio, the query runs under 1 second returning data almost immediately.

Thank you in advance for any hints, take care.  
SZ

---

<div class="post-metadata">

**Author:** ![szcz](https://avatars.discourse-cdn.com/v4/letter/s/ec9cab/32.png) [@szcz](https://forum.inductiveautomation.com/u/szcz)\
**Post date:** [March 5, 2020, 12:29pm UTC](https://forum.inductiveautomation.com/t/bar-chart-not-displaying-output-from-db/32825/4 "2020-03-05T12:29:14Z")

</div>

Actually the more complete picture looks as follows:

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

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 5, 2020, 1:00pm UTC](https://forum.inductiveautomation.com/t/bar-chart-not-displaying-output-from-db/32825/5 "2020-03-05T13:00:06Z")

</div>

Without seeing the query itself, I can’t see any reason for the behavior described. If you can’t show it here, you might want to open a support ticket.

---

<div class="post-metadata">

**Author:** ![szcz](https://avatars.discourse-cdn.com/v4/letter/s/ec9cab/32.png) [@szcz](https://forum.inductiveautomation.com/u/szcz)\
**Post date:** [March 5, 2020, 1:03pm UTC](https://forum.inductiveautomation.com/t/bar-chart-not-displaying-output-from-db/32825/6 "2020-03-05T13:03:12Z")

</div>

Sorry, I can’t post the query here - maybe I could be tracked to certain company and it wouldn’t be cool if this query could be related to certain company… the query itself is presumably OK without any errors, it runs in SMSS flawlessly.

I will open the ticket than.

Thank you for the effort anyway.  
SZ

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 5, 2020, 1:03pm UTC](https://forum.inductiveautomation.com/t/bar-chart-not-displaying-output-from-db/32825/7 "2020-03-05T13:03:16Z")

</div>

> [@szcz](#):
>
> In SQL Management studio, the query runs under 1 second returning data almost immediately.

Some syntax legal in a DB's native tool may not be valid in a JDBC driver. Try running your query in the Ignition Designer's Query Browser.

---

<div class="post-metadata">

**Author:** ![szcz](https://avatars.discourse-cdn.com/v4/letter/s/ec9cab/32.png) [@szcz](https://forum.inductiveautomation.com/u/szcz)\
**Post date:** [March 5, 2020, 1:06pm UTC](https://forum.inductiveautomation.com/t/bar-chart-not-displaying-output-from-db/32825/8 "2020-03-05T13:06:11Z")

</div>

It is legal in Ignition as well, that’s why I find it sooo odd:  
 ![obrazek](https://us1.discourse-cdn.com/inductiveautomation/original/2X/3/35295f7a5cd80e63229e437b6161f0c1a9d6e935.png)

In case Ignition DB Browser would return error, I would be perfectly OK with that.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 5, 2020, 1:08pm UTC](https://forum.inductiveautomation.com/t/bar-chart-not-displaying-output-from-db/32825/9 "2020-03-05T13:08:03Z")

</div>

Hmm. Odd indeed. Does anything show up in the designer’s console when you edit the binding? Some kinds of errors only show there, not in a popup.

---

<div class="post-metadata">

**Author:** ![szcz](https://avatars.discourse-cdn.com/v4/letter/s/ec9cab/32.png) [@szcz](https://forum.inductiveautomation.com/u/szcz)\
**Post date:** [March 5, 2020, 1:19pm UTC](https://forum.inductiveautomation.com/t/bar-chart-not-displaying-output-from-db/32825/10 "2020-03-05T13:19:03Z")

</div>

You are awesome !!! The console was full of warnings saying that values in the first rows (and presumably also in the other rows) has to be number (whereas some of the numbers were NULL instead).

I changed NULLs to 0 with COALESCE and we have data:

 ![obrazek](https://us1.discourse-cdn.com/inductiveautomation/original/2X/c/c9a7a77d3eeacc354ea62f570c530d8828420231.png)

Thank you very much, help much appreciated!
