# I can't get my XY chart working with database

**URL:** <https://forum.inductiveautomation.com/t/i-cant-get-my-xy-chart-working-with-database/86082>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [February 21, 2024, 6:56am UTC](https://forum.inductiveautomation.com/t/i-cant-get-my-xy-chart-working-with-database/86082 "2024-02-21T06:56:00Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matjaz\_Furlan](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@Matjaz\_Furlan](https://forum.inductiveautomation.com/u/Matjaz_Furlan)\
**Post date:** [February 21, 2024, 6:56am UTC](https://forum.inductiveautomation.com/t/i-cant-get-my-xy-chart-working-with-database/86082/1 "2024-02-21T06:56:00Z")

</div>

Hi all,  
i put binding in dataSources:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/1/515d192c800f6ad5d08acf30f8650c509e44b16b.png)  
i put name of axis like in query....  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/d/1d17f36473bb3950cbc3a246a0110242e3b2c4fe.png)  
But i get message on chart No series properly configured...  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/9/09214a46aa332e83de591819fd9e2781cd6f4c3e.png)

UPDATED: i finally solved...  
But still how to convert from line to column? If i Choose render: column. There is empty chart.

Regards

---

<div class="post-metadata">

**Author:** ![Matjaz\_Furlan](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@Matjaz\_Furlan](https://forum.inductiveautomation.com/u/Matjaz_Furlan)\
**Post date:** [February 21, 2024, 8:07am UTC](https://forum.inductiveautomation.com/t/i-cant-get-my-xy-chart-working-with-database/86082/2 "2024-02-21T08:07:48Z")

</div>

If render is line, chart is ok:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/c/0c47a6408ff0189a5ba41726d75854f1bd92ac10.png)  
if i put render column i get:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/3/132fed496a7b8b5503e53fe671384a7edcba06f6.png)

---

<div class="post-metadata">

**Author:** ![Matjaz\_Furlan](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@Matjaz\_Furlan](https://forum.inductiveautomation.com/u/Matjaz_Furlan)\
**Post date:** [February 21, 2024, 12:42pm UTC](https://forum.inductiveautomation.com/t/i-cant-get-my-xy-chart-working-with-database/86082/3 "2024-02-21T12:42:22Z")

</div>

One by one and with help i get results...  
how are transformation works... I have bar chart right now... And also in query string. I would like to color selected bar where in query is string "MASTER"

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/5/8515a2b149aae68164ce81da4720d25e86153f34.png)

---

<div class="post-metadata">

**Author:** ![hw79](https://avatars.discourse-cdn.com/v4/letter/h/838e76/32.png) [@hw79](https://forum.inductiveautomation.com/u/hw79)\
**Post date:** [February 21, 2024, 3:40pm UTC](https://forum.inductiveautomation.com/t/i-cant-get-my-xy-chart-working-with-database/86082/4 "2024-02-21T15:40:22Z")

</div>

> [@Matjaz\_Furlan](#):
>
> I would like to color selected bar where in query is string "MASTER"

I'm not exactly sure what you're asking here.

What do you want your chart to look like?

---

<div class="post-metadata">

**Author:** ![Matjaz\_Furlan](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@Matjaz\_Furlan](https://forum.inductiveautomation.com/u/Matjaz_Furlan)\
**Post date:** [February 21, 2024, 8:30pm UTC](https://forum.inductiveautomation.com/t/i-cant-get-my-xy-chart-working-with-database/86082/5 "2024-02-21T20:30:08Z")

</div>

i want to color bar in chart if Part\_Type is ETALON in yellow and magenta if KALIBER for example...  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/7/1715c06dcb6699289b076caf635a87914edbe1dd.png)

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/1/214e996805f1e411166f30ad859711751d50ad3d.png)  
Hope it is understandable...

---

<div class="post-metadata">

**Author:** ![hw79](https://avatars.discourse-cdn.com/v4/letter/h/838e76/32.png) [@hw79](https://forum.inductiveautomation.com/u/hw79)\
**Post date:** [February 21, 2024, 8:54pm UTC](https://forum.inductiveautomation.com/t/i-cant-get-my-xy-chart-working-with-database/86082/6 "2024-02-21T20:54:02Z")

</div>

I would make each type a separate series, give it a higher `zIndex` (so it appears on top of the other series), then change the `#.column.appearance` props to the colors you wanted.

---

<div class="post-metadata">

**Author:** ![Matjaz\_Furlan](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@Matjaz\_Furlan](https://forum.inductiveautomation.com/u/Matjaz_Furlan)\
**Post date:** [February 22, 2024, 7:25am UTC](https://forum.inductiveautomation.com/t/i-cant-get-my-xy-chart-working-with-database/86082/7 "2024-02-22T07:25:28Z")

</div>

with different dataset or the same?

---

<div class="post-metadata">

**Author:** ![Matjaz\_Furlan](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@Matjaz\_Furlan](https://forum.inductiveautomation.com/u/Matjaz_Furlan)\
**Post date:** [February 22, 2024, 7:32am UTC](https://forum.inductiveautomation.com/t/i-cant-get-my-xy-chart-working-with-database/86082/8 "2024-02-22T07:32:49Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/3/43109adc9d726cda4385d19e27925fa4c3e40071.png)  
this is what i get

---

<div class="post-metadata">

**Author:** ![hw79](https://avatars.discourse-cdn.com/v4/letter/h/838e76/32.png) [@hw79](https://forum.inductiveautomation.com/u/hw79)\
**Post date:** [February 22, 2024, 1:07pm UTC](https://forum.inductiveautomation.com/t/i-cant-get-my-xy-chart-working-with-database/86082/9 "2024-02-22T13:07:30Z")

</div>

how is your chart configured? you can use the preformatted text option when you paste your props so it displays correctly.

---

<div class="post-metadata">

**Author:** ![Matjaz\_Furlan](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@Matjaz\_Furlan](https://forum.inductiveautomation.com/u/Matjaz_Furlan)\
**Post date:** [February 22, 2024, 1:27pm UTC](https://forum.inductiveautomation.com/t/i-cant-get-my-xy-chart-working-with-database/86082/10 "2024-02-22T13:27:36Z")

</div>

file is to long so i am sending JSON file  
[chart.json](https://forum.inductiveautomation.com/uploads/short-url/xBBNWtCki8sUnzK5mGWOQPzOShy.json) (43.6 KB)

---

<div class="post-metadata">

**Author:** ![hw79](https://avatars.discourse-cdn.com/v4/letter/h/838e76/32.png) [@hw79](https://forum.inductiveautomation.com/u/hw79)\
**Post date:** [February 22, 2024, 1:52pm UTC](https://forum.inductiveautomation.com/t/i-cant-get-my-xy-chart-working-with-database/86082/11 "2024-02-22T13:52:55Z")

</div>

That's why you paste it as preformatted text so it gets a scroll bar...

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [February 22, 2024, 1:56pm UTC](https://forum.inductiveautomation.com/t/i-cant-get-my-xy-chart-working-with-database/86082/12 "2024-02-22T13:56:58Z")

</div>

@hw79, I've found there's a limit to the post length and some of the charts' JSON exceeds that. Splitting it into two posts is messy.

---

<div class="post-metadata">

**Author:** ![hw79](https://avatars.discourse-cdn.com/v4/letter/h/838e76/32.png) [@hw79](https://forum.inductiveautomation.com/u/hw79)\
**Post date:** [February 22, 2024, 2:04pm UTC](https://forum.inductiveautomation.com/t/i-cant-get-my-xy-chart-working-with-database/86082/13 "2024-02-22T14:04:27Z")

</div>

good to know, thanks!

---

<div class="post-metadata">

**Author:** ![hw79](https://avatars.discourse-cdn.com/v4/letter/h/838e76/32.png) [@hw79](https://forum.inductiveautomation.com/u/hw79)\
**Post date:** [February 22, 2024, 2:06pm UTC](https://forum.inductiveautomation.com/t/i-cant-get-my-xy-chart-working-with-database/86082/14 "2024-02-22T14:06:18Z")

</div>

> [@Matjaz\_Furlan](#):
>
> JSON file

I noticed you don't have anything in dataSources, is it a binding?

---

<div class="post-metadata">

**Author:** ![Matjaz\_Furlan](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@Matjaz\_Furlan](https://forum.inductiveautomation.com/u/Matjaz_Furlan)\
**Post date:** [February 22, 2024, 2:19pm UTC](https://forum.inductiveautomation.com/t/i-cant-get-my-xy-chart-working-with-database/86082/15 "2024-02-22T14:19:55Z")

</div>

Yes from DB query...

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

---

<div class="post-metadata">

**Author:** ![hw79](https://avatars.discourse-cdn.com/v4/letter/h/838e76/32.png) [@hw79](https://forum.inductiveautomation.com/u/hw79)\
**Post date:** [February 23, 2024, 3:35pm UTC](https://forum.inductiveautomation.com/t/i-cant-get-my-xy-chart-working-with-database/86082/16 "2024-02-23T15:35:37Z")

</div>

My typical process is to bring in the dataset as a custom prop then on the binding of the dataSources prop transform it into an array of JSON objects like the [documentation](https://www.docs.inductiveautomation.com/docs/8.1/appendix/components/perspective-components/perspective-chart-palette/perspective-xy-chart) shows.

edit: Ignore this, I might be giving you some bad advice. Let me figure it out then I'll reach out to you.

---

<div class="post-metadata">

**Author:** ![Matjaz\_Furlan](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@Matjaz\_Furlan](https://forum.inductiveautomation.com/u/Matjaz_Furlan)\
**Post date:** [February 23, 2024, 5:08pm UTC](https://forum.inductiveautomation.com/t/i-cant-get-my-xy-chart-working-with-database/86082/17 "2024-02-23T17:08:44Z")

</div>

I dont understand… do you have some example maybe… tnx for helping

---

<div class="post-metadata">

**Author:** ![hw79](https://avatars.discourse-cdn.com/v4/letter/h/838e76/32.png) [@hw79](https://forum.inductiveautomation.com/u/hw79)\
**Post date:** [February 26, 2024, 5:51pm UTC](https://forum.inductiveautomation.com/t/i-cant-get-my-xy-chart-working-with-database/86082/19 "2024-02-26T17:51:30Z")

</div>

I'm sorry but I've spent 2 days trying to get this to work and I just can't get it. Unfortunately, this is why I'm forced to use Apex Charts in my project because the XY chart component doesn't do columns how I need them to.

I apologize for keeping you waiting.

---

<div class="post-metadata">

**Author:** ![hw79](https://avatars.discourse-cdn.com/v4/letter/h/838e76/32.png) [@hw79](https://forum.inductiveautomation.com/u/hw79)\
**Post date:** [February 26, 2024, 10:18pm UTC](https://forum.inductiveautomation.com/t/i-cant-get-my-xy-chart-working-with-database/86082/20 "2024-02-26T22:18:59Z")

</div>

Okay, I apologize again, it was bothering me, so I took another stab at it.

Is this the result you're looking for?

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

---

<div class="post-metadata">

**Author:** ![Matjaz\_Furlan](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@Matjaz\_Furlan](https://forum.inductiveautomation.com/u/Matjaz_Furlan)\
**Post date:** [February 27, 2024, 6:41am UTC](https://forum.inductiveautomation.com/t/i-cant-get-my-xy-chart-working-with-database/86082/21 "2024-02-27T06:41:24Z")

</div>

YES this is it 🙂

[Next page](https://forum.inductiveautomation.com/t/i-cant-get-my-xy-chart-working-with-database/86082.md?page=2)
