# Pass In Parameters/Data to the Report Chart Script

**URL:** <https://forum.inductiveautomation.com/t/pass-in-parameters-data-to-the-report-chart-script/11432>\
**Category:** Ignition\
**Created:** [March 29, 2016, 10:19pm UTC](https://forum.inductiveautomation.com/t/pass-in-parameters-data-to-the-report-chart-script/11432 "2016-03-29T22:19:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![WillMT10](https://avatars.discourse-cdn.com/v4/letter/w/7feea3/32.png) [@WillMT10](https://forum.inductiveautomation.com/u/WillMT10)\
**Post date:** [March 29, 2016, 10:19pm UTC](https://forum.inductiveautomation.com/t/pass-in-parameters-data-to-the-report-chart-script/11432/1 "2016-03-29T22:19:06Z")

</div>

I’m trying to do some “funky” things with the charts in a report to get them exactly how I was requested to make them. This requires that I fine tune the Range Axis on a chart when it loads. I’m trying to update the range axis inside the script using “range\_axis.setLowerBound()” and “range\_axis.setUpperBound()”, but the values I need for these to functions are coming from a SQL query. I can get the functions to work with constants, but I can’t figure out a way to pass in a parameter, dataset, or SQL query. Is it possible to pass anything into the Chart Script besides the “chart”?

Any pointers would be greatly appreciated.

Thanks,  
-Will

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [March 30, 2016, 3:13pm UTC](https://forum.inductiveautomation.com/t/pass-in-parameters-data-to-the-report-chart-script/11432/2 "2016-03-30T15:13:48Z")

</div>

You can’t add any other parameters, but you do have access to any Gateway scoped scripting functions, which means you can access tags and do sql queries in the script, and you have access to the chart’s data through the [JFreeChart API](http://www.jfree.org/jfreechart/api/javadoc/).

---

<div class="post-metadata">

**Author:** ![WillMT10](https://avatars.discourse-cdn.com/v4/letter/w/7feea3/32.png) [@WillMT10](https://forum.inductiveautomation.com/u/WillMT10)\
**Post date:** [March 30, 2016, 4:41pm UTC](https://forum.inductiveautomation.com/t/pass-in-parameters-data-to-the-report-chart-script/11432/3 "2016-03-30T16:41:48Z")

</div>

Thanks Kathy! I was trying to use a SQL query and couldn’t get it to work, so I figured that it wasn’t allowed in the Chart Scripts. But then I realized I had a typo in the query… 😊 … Sorry about that!

Not sure if this is already on the path forward, but adding a feature to be able to pass in other parameters to the Chart Scripts would be super helpful. The SQL query will do the trick for now though.

Thanks again,  
-Will

---

<div class="post-metadata">

**Author:** ![WillMT10](https://avatars.discourse-cdn.com/v4/letter/w/7feea3/32.png) [@WillMT10](https://forum.inductiveautomation.com/u/WillMT10)\
**Post date:** [August 2, 2019, 2:14pm UTC](https://forum.inductiveautomation.com/t/pass-in-parameters-data-to-the-report-chart-script/11432/4 "2019-08-02T14:14:57Z")

</div>

Apologies for digging up such an old topic, but I just wanted to check if this is still not possible? I thought I remember reading somewhere that parameters were being made accessible in the chart scripts but can’t find where I saw that (…or if I just dreamt it). I’m trying to setup dynamic pen names in the chart. I could do it through a tag but I’d like to avoid it if I can, since there will be many of these reports sending out in a short time and I don’t want to accidentally over write the tag before the prior report finishes executing (end up with two reports having the same pen names).

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 2, 2019, 3:23pm UTC](https://forum.inductiveautomation.com/t/pass-in-parameters-data-to-the-report-chart-script/11432/5 "2019-08-02T15:23:06Z")

</div>

`configureChart` scripts in reporting do have access to other data keys on the report, yes - as of 7.9.7. Just use the same `data['key']` syntax you would in a script datasource.
