Add pens to easy chart through scripting

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

This is what I have:


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”

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.