# How to dynamically add series to Chart

**URL:** <https://forum.inductiveautomation.com/t/how-to-dynamically-add-series-to-chart/8227>\
**Category:** Ignition\
**Created:** [March 27, 2014, 8:06pm UTC](https://forum.inductiveautomation.com/t/how-to-dynamically-add-series-to-chart/8227 "2014-03-27T20:06:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rforbes](https://avatars.discourse-cdn.com/v4/letter/r/a88e57/32.png) [@rforbes](https://forum.inductiveautomation.com/u/rforbes)\
**Post date:** [March 27, 2014, 8:06pm UTC](https://forum.inductiveautomation.com/t/how-to-dynamically-add-series-to-chart/8227/1 "2014-03-27T20:06:03Z")

</div>

Hi,

I’d like to dynamically add a dataset to a Chart. I don’t see anything under Scripting in the user manual, and when I call getDataset() on the JFreeChart plot I get a com.inductiveautomation.ignition.common.BasicDatas object which is opaque to me. I’m a bit leery of replacing the plot’s dataset with a generic JFreeChart one in case some Ignition code accesses it expecting a BasicDatas…Any suggestions?

Thanks,

Rob

---

<div class="post-metadata">

**Author:** ![diat150](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@diat150](https://forum.inductiveautomation.com/u/diat150)\
**Post date:** [March 28, 2014, 1:20am UTC](https://forum.inductiveautomation.com/t/how-to-dynamically-add-series-to-chart/8227/2 "2014-03-28T01:20:24Z")

</div>

what i have done is create all of the datasets that the chart uses as custom properties then bind the charts datasets to those. I then use scripting to create the datasets for the pens, axes, and subplots.
