# Trouble Downloading time series chart data

**URL:** <https://forum.inductiveautomation.com/t/trouble-downloading-time-series-chart-data/102889>\
**Category:** Ignition\
**Tags:** ignition81, scripting, perspective\
**Created:** [February 26, 2025, 9:46am UTC](https://forum.inductiveautomation.com/t/trouble-downloading-time-series-chart-data/102889 "2025-02-26T09:46:43Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![daniel4](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@daniel4](https://forum.inductiveautomation.com/u/daniel4)\
**Post date:** [February 26, 2025, 9:46am UTC](https://forum.inductiveautomation.com/t/trouble-downloading-time-series-chart-data/102889/1 "2025-02-26T09:46:43Z")

</div>

```python
def runAction(self, event):
	
	dataset = self.getSibling("TimeSeriesChart").props.series[0].data
	system.perspective.print(dataset)

```

this just prints "Dataset [111R ⅹ 2C]"

I can't seam to be able to get the actual data. I've tried dataset[0] just to see if the print method is dumb and not recognizing it as an array. but that didn't work. I'm missing something here. Maybe a function or something that makes the data available.

Any help would be great. The end goal is to be able to export the data by downloading in browser.

```python
data = system.dataset.toCSV(dataset, localized)
	
system.perspective.download("Data.csv", data)

```

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 26, 2025, 12:48pm UTC](https://forum.inductiveautomation.com/t/trouble-downloading-time-series-chart-data/102889/2 "2025-02-26T12:48:25Z")

</div>

When you print anything in java or jython or python, there's an implicit "stringification" performed on any object, because printing is fundamentally about printing _ **strings** _.

Objects control their own stringification, and the default for most complex objects in the java world is to make a simple summary. Which is what dataset objects do. That means, if you want to print the content, you have to iterate through the rows, and iterate through the columns, to build your own string.

That said, have you tried the last two lines of code you supplied?

---

<div class="post-metadata">

**Author:** ![daniel4](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@daniel4](https://forum.inductiveautomation.com/u/daniel4)\
**Post date:** [April 3, 2025, 3:53pm UTC](https://forum.inductiveautomation.com/t/trouble-downloading-time-series-chart-data/102889/3 "2025-04-03T15:53:25Z")

</div>

This was a rabbit hole I wasn't expecting 🙂

Turns out you have to be explicit when passing a dataset to the toCSV() function. That was the error which was pretty annoying to find.

And I learned that Dataset is not python standard or it would have printed just fine. No idea why you would use python and then cram into it a non standard datatype. Fortunately you can just iterate through the Dataset and make a simple C style array.. Then make a CSV string when you are done with it.

Here is the doc for DATASET  
[DATASET DOC](https://www.docs.inductiveautomation.com/docs/7.9/scripting/python-scripting/variables-datatypes-and-objects/datasets)

Here is working code if anyone has had trouble with exporting a single series from TimeSeriesChart.. If you need more then one series it gets a bit more complicated depending on how you want to download it.

```python
	chartdata = self.getSibling("TimeSeriesChart").props.series[0].data
	
	#Example of how to pring a single value from dataset
	system.perspective.print(chartdata.getValueAt(1,1))
	
	CSVstring = system.dataset.toCSV(dataset = chartdata)
	
	#Example of how to print to the browser console
	system.perspective.print(CSVstring)
	
	system.perspective.download("Data.csv", CSVstring)
		
	

```

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 3, 2025, 3:57pm UTC](https://forum.inductiveautomation.com/t/trouble-downloading-time-series-chart-data/102889/4 "2025-04-03T15:57:45Z")

</div>

> [@daniel4](#):
>
> use python and then cram into it a non standard datatype

Ignition uses Python-the-language not Python-the-C-implementation.

Ignition uses Jython-the-java-implementation, so naturally works with java types, because they **are** standard for jython. Ignition is written in java. 🤷‍♂️

The definitive details on the Dataset type are **here** :

> **[Dataset](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.47/com/inductiveautomation/ignition/common/Dataset.html)**
>
> declaration: package: com.inductiveautomation.ignition.common, interface: Dataset

---

<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:** [April 3, 2025, 4:29pm UTC](https://forum.inductiveautomation.com/t/trouble-downloading-time-series-chart-data/102889/5 "2025-04-03T16:29:56Z")

</div>

Also, Dataset is a _way_ richer type than anything in the Python stdlib.  
It's not equivalent to a list of lists (because you've got column names and types, plus optional quality information) and it's not equivalent to a list of dictionaries (because you get O(1) access, \[1\], to any given row/column index).

For what it's worth, the tension between "this is awkward to use from Python/Jython" and "this is the underlying Java interface" can be papered over somewhat in 8.1 and prior using `system.dataset.toPyDataSet`. In 8.3, you won't have to do this manually, any dataset you encounter from scripting will automatically _appear_ to be a PyDataset.

* * *

1. generally

---

<div class="post-metadata">

**Author:** ![Leor\_Fishman](https://avatars.discourse-cdn.com/v4/letter/l/e19adc/32.png) [@Leor\_Fishman](https://forum.inductiveautomation.com/u/Leor_Fishman)\
**Post date:** [April 3, 2025, 4:54pm UTC](https://forum.inductiveautomation.com/t/trouble-downloading-time-series-chart-data/102889/6 "2025-04-03T16:54:41Z")

</div>

is it the same approx interface as Pandas?

---

<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:** [April 3, 2025, 4:58pm UTC](https://forum.inductiveautomation.com/t/trouble-downloading-time-series-chart-data/102889/7 "2025-04-03T16:58:51Z")

</div>

I've never used pandas, but I'll say no. The behavior of PyDatasets is essentially unchanged; the only difference is that you no longer have to manually wrap to get all the ergonomic benefits.

---

<div class="post-metadata">

**Author:** ![Leor\_Fishman](https://avatars.discourse-cdn.com/v4/letter/l/e19adc/32.png) [@Leor\_Fishman](https://forum.inductiveautomation.com/u/Leor_Fishman)\
**Post date:** [April 3, 2025, 6:45pm UTC](https://forum.inductiveautomation.com/t/trouble-downloading-time-series-chart-data/102889/8 "2025-04-03T18:45:14Z")

</div>

[Dataset introduction — pyDataset 0.16.3 documentation](https://pydataset.readthedocs.io/en/latest/example.html) is this the pydataset library?  
Or is it something internal to ignition

---

<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:** [April 3, 2025, 6:48pm UTC](https://forum.inductiveautomation.com/t/trouble-downloading-time-series-chart-data/102889/9 "2025-04-03T18:48:54Z")

</div>

Specific to Ignition.  
It's a Java class that implements the right Java interfaces so that Jython knows to expose it directly, rather than doing auto-wrapping.

In 8.1:

> **[DatasetUtilities.PyDataSet](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.47/com/inductiveautomation/ignition/common/script/builtin/DatasetUtilities.PyDataSet.html)**
>
> declaration: package: com.inductiveautomation.ignition.common.script.builtin, class: DatasetUtilities, class: PyDataSet

In 8.3:

> **[PyDataset](https://files.inductiveautomation.com/sdk/javadoc/earlyaccess/ignition83/8.3.0-SNAPSHOT/com/inductiveautomation/ignition/common/script/builtin/PyDataset.html)**
>
> declaration: package: com.inductiveautomation.ignition.common.script.builtin, class: PyDataset

Note the explicit dunder method declarations in the Javadoc and that the base class is `PyObject`.
