# Add pens to easy chart through scripting

**URL:** <https://forum.inductiveautomation.com/t/add-pens-to-easy-chart-through-scripting/10740>\
**Category:** Ignition\
**Created:** [November 4, 2015, 8:55pm UTC](https://forum.inductiveautomation.com/t/add-pens-to-easy-chart-through-scripting/10740 "2015-11-04T20:55:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MoisesZV](https://avatars.discourse-cdn.com/v4/letter/m/e68b1a/32.png) [@MoisesZV](https://forum.inductiveautomation.com/u/MoisesZV)\
**Post date:** [November 4, 2015, 8:55pm UTC](https://forum.inductiveautomation.com/t/add-pens-to-easy-chart-through-scripting/10740/1 "2015-11-04T20:55:15Z")

</div>

Hi, I’m trying to add database pens from a transaction group to an Easy chart.

This is what I have:

```auto

newRow = ["Tag_1", "Tag_1", "graficos_tag", "t_stamp","DB", "Default Axis", 1, 1, "0,0,255", 1, 1, 1, 0, 1, 0," "," ",0,0,0,1," ",0]
grafico.pens = system.dataset.addRow(grafico.pens, newRow)

```

The pen seems to be added to the pen control panel, but I get an Error “You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘ORDER BY t\_stamp’ at line 1”

---

<div class="post-metadata">

**Author:** ![MoisesZV](https://avatars.discourse-cdn.com/v4/letter/m/e68b1a/32.png) [@MoisesZV](https://forum.inductiveautomation.com/u/MoisesZV)\
**Post date:** [November 5, 2015, 7:20pm UTC](https://forum.inductiveautomation.com/t/add-pens-to-easy-chart-through-scripting/10740/2 "2015-11-05T19:20:46Z")

</div>

I implemented “Click to Graph” from the extras download page and this do all what I want, I just need to change the script a little.
