# \[Bug-702\]8.1.0-rc2 Sparkline not displaying data values

**URL:** <https://forum.inductiveautomation.com/t/bug-702-8-1-0-rc2-sparkline-not-displaying-data-values/39270>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [October 1, 2020, 3:24pm UTC](https://forum.inductiveautomation.com/t/bug-702-8-1-0-rc2-sparkline-not-displaying-data-values/39270 "2020-10-01T15:24:29Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![jon.smith](https://avatars.discourse-cdn.com/v4/letter/j/c2a13f/32.png) [@jon.smith](https://forum.inductiveautomation.com/u/jon.smith)\
**Post date:** [October 1, 2020, 3:24pm UTC](https://forum.inductiveautomation.com/t/bug-702-8-1-0-rc2-sparkline-not-displaying-data-values/39270/1 "2020-10-01T15:24:29Z")

</div>

We just upgraded from 8.0.12 to 8.1.0-rc2. Our Perspective project with Sparklines worked great prior to the upgrade. The sparkline displays machine speeds from tag history for current to 12 hours prior. Now, I get a red shade with green line and no data points on the Sparkline. The data table is 2 columns and 100 entries. Any idea why it doesn’t draw the sparkline anymore?  
 ![sparkline_fail](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/c/7c501825f6f2eae47ae3206b7a46c60ba61fad93.gif)

 ![dataset](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/b/bbc9a779a4b304f78c527df9be3db02ca8cea7da.gif)  
Anyone else seeing the same problem?

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [October 2, 2020, 5:09pm UTC](https://forum.inductiveautomation.com/t/bug-702-8-1-0-rc2-sparkline-not-displaying-data-values/39270/2 "2020-10-02T17:09:13Z")

</div>

I see that as well. I’ve opened an internal ticket to get this fixed.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [October 2, 2020, 8:54pm UTC](https://forum.inductiveautomation.com/t/bug-702-8-1-0-rc2-sparkline-not-displaying-data-values/39270/3 "2020-10-02T20:54:19Z")

</div>

Good news: We already completed and tested a fix which was merged into 8.1.0 and will be part of the stable release. You won’t see this in the nightly releases, but as I said it WILL be in 8.1.0 stable.

One thing you can do in the meantime is apply a transform to your data:

```auto
	points = []
	for i in range(0, len(value)):
		points.append({'x': i, 'y': value[i]['<your_Marquip_N_column_name>']})
	return points

```

---

<div class="post-metadata">

**Author:** ![jon.smith](https://avatars.discourse-cdn.com/v4/letter/j/c2a13f/32.png) [@jon.smith](https://forum.inductiveautomation.com/u/jon.smith)\
**Post date:** [October 7, 2020, 12:58pm UTC](https://forum.inductiveautomation.com/t/bug-702-8-1-0-rc2-sparkline-not-displaying-data-values/39270/4 "2020-10-07T12:58:37Z")

</div>

I created the transform as advised and I receive the Error\_ScriptEval.

 ![TagHistory_wScript](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/1/21df31134fc1ce165a9196d2df61afa70a4f595f.png)

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [October 7, 2020, 1:36pm UTC](https://forum.inductiveautomation.com/t/bug-702-8-1-0-rc2-sparkline-not-displaying-data-values/39270/5 "2020-10-07T13:36:04Z")

</div>

Post the code via the \</\> button so we can help edit it. 😃

However I would say that you should change

```auto
'<Marquip_Net_Sheets_Per_Hour>'

```

to

```auto
'Marquip_Net_Sheets_Per_Hour'

```

---

<div class="post-metadata">

**Author:** ![jon.smith](https://avatars.discourse-cdn.com/v4/letter/j/c2a13f/32.png) [@jon.smith](https://forum.inductiveautomation.com/u/jon.smith)\
**Post date:** [October 7, 2020, 1:40pm UTC](https://forum.inductiveautomation.com/t/bug-702-8-1-0-rc2-sparkline-not-displaying-data-values/39270/6 "2020-10-07T13:40:07Z")

</div>

```auto
def transform(self, value, quality, timestamp):
	"""
	Transform the incoming value and return a result.

	Arguments:
		self: A reference to the component this binding is configured on.
		value: The incoming value from the binding or the previous transform.
		quality: The quality code of the incoming value.
		timestamp: The timestamp of the incoming value as a java.util.Date
	"""
	points = []
	for i in range(0,len(value)):
			points.append({'x': i, 'y': value[i]['Marquip_Net_Sheets_Per_Hour']})
	return points

```

same result

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [October 7, 2020, 1:40pm UTC](https://forum.inductiveautomation.com/t/bug-702-8-1-0-rc2-sparkline-not-displaying-data-values/39270/7 "2020-10-07T13:40:49Z")

</div>

If you hover over the error what does it say?

---

<div class="post-metadata">

**Author:** ![jon.smith](https://avatars.discourse-cdn.com/v4/letter/j/c2a13f/32.png) [@jon.smith](https://forum.inductiveautomation.com/u/jon.smith)\
**Post date:** [October 7, 2020, 1:41pm UTC](https://forum.inductiveautomation.com/t/bug-702-8-1-0-rc2-sparkline-not-displaying-data-values/39270/9 "2020-10-07T13:41:57Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/d/bd707e1653e0525adcce15820c7b1617fd8aeab7.png)

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [October 7, 2020, 1:43pm UTC](https://forum.inductiveautomation.com/t/bug-702-8-1-0-rc2-sparkline-not-displaying-data-values/39270/10 "2020-10-07T13:43:04Z")

</div>

Your data format is dataset. Try changing it to JSON. There is no len() for a dataset.

---

<div class="post-metadata">

**Author:** ![jon.smith](https://avatars.discourse-cdn.com/v4/letter/j/c2a13f/32.png) [@jon.smith](https://forum.inductiveautomation.com/u/jon.smith)\
**Post date:** [October 7, 2020, 1:48pm UTC](https://forum.inductiveautomation.com/t/bug-702-8-1-0-rc2-sparkline-not-displaying-data-values/39270/11 "2020-10-07T13:48:37Z")

</div>

The dataset is from the Tag Historian. I’m not sure how to convert it to a JSON…

---

<div class="post-metadata">

**Author:** ![jon.smith](https://avatars.discourse-cdn.com/v4/letter/j/c2a13f/32.png) [@jon.smith](https://forum.inductiveautomation.com/u/jon.smith)\
**Post date:** [October 7, 2020, 1:51pm UTC](https://forum.inductiveautomation.com/t/bug-702-8-1-0-rc2-sparkline-not-displaying-data-values/39270/12 "2020-10-07T13:51:26Z")

</div>

Changing value type from DataSet to Document and making the coding change you suggested seems to work. Thank you for your help!

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/f/2f5c1d4f0a14d52e99790e95f9ace94c4ae3a1c7.png)

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [October 7, 2020, 1:58pm UTC](https://forum.inductiveautomation.com/t/bug-702-8-1-0-rc2-sparkline-not-displaying-data-values/39270/13 "2020-10-07T13:58:50Z")

</div>

Awesome!

Yeah I don’t have 8.1 yet. Should probably grab it.

The value format is handy to know about. Some controls want datasets, others JSON/DOCUMENT.

---

<div class="post-metadata">

**Author:** ![Devin](https://avatars.discourse-cdn.com/v4/letter/d/278dde/32.png) [@Devin](https://forum.inductiveautomation.com/u/Devin)\
**Post date:** [October 13, 2020, 3:11pm UTC](https://forum.inductiveautomation.com/t/bug-702-8-1-0-rc2-sparkline-not-displaying-data-values/39270/14 "2020-10-13T15:11:28Z")

</div>

Hey guys,

I’m having an issue getting this to work with some indirection I am using. I have a sparkline template that I am passing the parameters to in order to pull the tag history.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/d/3d70dac6518f39f983348815fc56c37696fbef33.png)

I tried to manipulate the script to make it pull the tag .name value, which should by default be used as the column name but it is just returning a ScriptEval error.

Any ideas?

```auto
	points = []
	tagPath = self.view.params.key[0].path + ".name" 
	tagName = system.tag.read(tagPath)
	
	for i in range(0, len(value)):
				points.append({'x': i, 'y': value[i][tagName]})
	return points

```

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/8/084d979999c077c15d0f7204335d6b6f86542ef0.png)

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [October 13, 2020, 4:38pm UTC](https://forum.inductiveautomation.com/t/bug-702-8-1-0-rc2-sparkline-not-displaying-data-values/39270/15 "2020-10-13T16:38:23Z")

</div>

> [@Devin](#):
>
> ```auto
> tagPath = self.view.params.key[0].path + ".name" 
> tagName = system.tag.read(tagPath)
> 
> ```

Don't do this. This tag read is going to loop and read that value for EVERY time the binding updates.

The reason you're getting a recursion error is because you're attempting to shoehorn in a Qualified Value instead of a simple value. The following change to your code will result in the code _working_, but you're going to have a huge performance hit in larger views if you continue to look up the tag value in the transform:

```auto
    # make sure you double-check the line indentations - your posted code has too many tabs in the for loop
    for i in range(0, len(value)):
		points.append({'x': i, 'y': value[i][tagName.value]})
	return points

```

---

<div class="post-metadata">

**Author:** ![Devin](https://avatars.discourse-cdn.com/v4/letter/d/278dde/32.png) [@Devin](https://forum.inductiveautomation.com/u/Devin)\
**Post date:** [October 13, 2020, 6:24pm UTC](https://forum.inductiveautomation.com/t/bug-702-8-1-0-rc2-sparkline-not-displaying-data-values/39270/16 "2020-10-13T18:24:16Z")

</div>

for some reason this works about 50% of the time. If i am currently displaying the page in a browser and I save the project i get some values but not all. If I navigate away from the page and go back, the components are faulted again with the same fault.

I take it there’s probably not a better work around for now in my situation?

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [October 13, 2020, 6:26pm UTC](https://forum.inductiveautomation.com/t/bug-702-8-1-0-rc2-sparkline-not-displaying-data-values/39270/17 "2020-10-13T18:26:30Z")

</div>

> [@Devin](#):
>
> this works about 50% of the time

What works for you 50% of the time?

Can you share your code as it is right now?

---

<div class="post-metadata">

**Author:** ![Devin](https://avatars.discourse-cdn.com/v4/letter/d/278dde/32.png) [@Devin](https://forum.inductiveautomation.com/u/Devin)\
**Post date:** [October 13, 2020, 6:43pm UTC](https://forum.inductiveautomation.com/t/bug-702-8-1-0-rc2-sparkline-not-displaying-data-values/39270/18 "2020-10-13T18:43:52Z")

</div>

```auto
	points = []
	tagPath = self.view.params.key[0].path + ".name" 
	tagName = system.tag.read(tagPath)
 
	for i in range(0, len(value)):
		points.append({'x': i, 'y': value[i][tagName.value]})
	return points

```

If I update project while on the page the sparklines are located I get:  
 ![screenshot.296](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/7/378cc9d412471b25330a910f6fcf7d3723cb4727.png)

If I navigate away from the page and come back I get:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/b/abb37a6907a92647b5bdf1eab050d1627888cf5d.png)

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [October 13, 2020, 7:28pm UTC](https://forum.inductiveautomation.com/t/bug-702-8-1-0-rc2-sparkline-not-displaying-data-values/39270/19 "2020-10-13T19:28:33Z")

</div>

Oh, it’s because you’re using the `params` of the View. What is the param value being specified? Are you defaulting back to a static value?

try inserting

```auto
system.perspective.print(tagName.value)

```

just before your `for` loop. Then look in the Browser console to see what values you’re actually getting during the scenario you’re describing.

1. Right-click your view in a session, and select “Inspect”.
2. In the resulting window, click the “Console” tab, and then run through your scenario.

---

<div class="post-metadata">

**Author:** ![Devin](https://avatars.discourse-cdn.com/v4/letter/d/278dde/32.png) [@Devin](https://forum.inductiveautomation.com/u/Devin)\
**Post date:** [October 13, 2020, 7:38pm UTC](https://forum.inductiveautomation.com/t/bug-702-8-1-0-rc2-sparkline-not-displaying-data-values/39270/20 "2020-10-13T19:38:00Z")

</div>

Thank you, that helped.

For some reason I had the param set up as I/O instead of just input.

Thanks!

---

<div class="post-metadata">

**Author:** ![ynejati](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ynejati/32/6093_2.png) [@ynejati](https://forum.inductiveautomation.com/u/ynejati)\
**Post date:** [October 13, 2020, 7:55pm UTC](https://forum.inductiveautomation.com/t/bug-702-8-1-0-rc2-sparkline-not-displaying-data-values/39270/21 "2020-10-13T19:55:14Z")

</div>

There was a known performance issues with the Sparkline component in RC1 and RC2. A side effect of the work we’ve been doing to improve performance overall. The issue has since been addressed in RC3, along with several other important changes. I’d highly recommend upgrading. Thank you.
