# Time series chart, how do i use historical data if I require an indirect tag

**URL:** <https://forum.inductiveautomation.com/t/time-series-chart-how-do-i-use-historical-data-if-i-require-an-indirect-tag/41796>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [December 27, 2020, 5:02am UTC](https://forum.inductiveautomation.com/t/time-series-chart-how-do-i-use-historical-data-if-i-require-an-indirect-tag/41796 "2020-12-27T05:02:42Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![codersmurf](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@codersmurf](https://forum.inductiveautomation.com/u/codersmurf)\
**Post date:** [December 27, 2020, 5:02am UTC](https://forum.inductiveautomation.com/t/time-series-chart-how-do-i-use-historical-data-if-i-require-an-indirect-tag/41796/1 "2020-12-27T05:02:42Z")

</div>

I have a time series chart, I’m assuming I’m using the proper one. I’m coming from vision and was using the easy chart. When I try to use the tag history on the data binding I can only do a direct tag, no possible way for that, or an expression. I’m not opposed to the expression, but not sure what I need to put in here. I will have 5 different pens, all will have a param to the tag udt, one will also have a tag in the udt used to complete the full tag name. Any thoughts on this, the documents are extremely vague.Thx, Jake

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [December 27, 2020, 8:33am UTC](https://forum.inductiveautomation.com/t/time-series-chart-how-do-i-use-historical-data-if-i-require-an-indirect-tag/41796/2 "2020-12-27T08:33:41Z")

</div>

The “equivalent” Easy Chart in Perspective is the Power Chart, but it has some extras that the Easy Chart doesn’t have, such as built-in support for adding ad-hoc tags and changing their and axes config etc.

In ~~either case~~ the XY Chart case, you need to use a Tag History binding on the _data_ object in the `series` array:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/4/c4b738e9d42da7f60e476f1125c37c696009b88b.png)  
As in the table you fill out for direct tag paths, you need to provide the same table headings when using an expression for the tag paths. Specifically, you need to provide an array of dictionaries with keys:

- path
- alias
- aggregate

See the documentation (see section at the very bottom):  
[https://docs.inductiveautomation.com/display/DOC80/Tag+History+Bindings+in+Perspective](https://docs.inductiveautomation.com/display/DOC80/Tag+History+Bindings+in+Perspective)

---

<div class="post-metadata">

**Author:** ![codersmurf](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@codersmurf](https://forum.inductiveautomation.com/u/codersmurf)\
**Post date:** [December 27, 2020, 8:57am UTC](https://forum.inductiveautomation.com/t/time-series-chart-how-do-i-use-historical-data-if-i-require-an-indirect-tag/41796/3 "2020-12-27T08:57:40Z")

</div>

Ah, that’s the ticket, I’ll try that out.Thx, jake

---

<div class="post-metadata">

**Author:** ![codersmurf](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@codersmurf](https://forum.inductiveautomation.com/u/codersmurf)\
**Post date:** [December 28, 2020, 3:40am UTC](https://forum.inductiveautomation.com/t/time-series-chart-how-do-i-use-historical-data-if-i-require-an-indirect-tag/41796/4 "2020-12-28T03:40:22Z")

</div>

So I have the chart up with no errors finally, went with power chart. It’s not showing any of the pens. It shows the range correctly, hour into the past and now. The x shows like 5 seconds of marks, y 0 - 100, but no pens. Clicking on the settings show the pens and such during runtime. Any thoughts? Thx, jake

---

<div class="post-metadata">

**Author:** ![epsmitas](https://avatars.discourse-cdn.com/v4/letter/e/4af34b/32.png) [@epsmitas](https://forum.inductiveautomation.com/u/epsmitas)\
**Post date:** [December 28, 2020, 3:56am UTC](https://forum.inductiveautomation.com/t/time-series-chart-how-do-i-use-historical-data-if-i-require-an-indirect-tag/41796/5 "2020-12-28T03:56:10Z")

</div>

There is a short video on Indirect Bindings & Power Charts. Not sure if it applies to your application.

[https://www.inductiveuniversity.com/videos/power-chart---indirection/8.1](https://www.inductiveuniversity.com/videos/power-chart---indirection/8.1)

---

<div class="post-metadata">

**Author:** ![codersmurf](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@codersmurf](https://forum.inductiveautomation.com/u/codersmurf)\
**Post date:** [December 28, 2020, 4:59am UTC](https://forum.inductiveautomation.com/t/time-series-chart-how-do-i-use-historical-data-if-i-require-an-indirect-tag/41796/6 "2020-12-28T04:59:45Z")

</div>

so I’m using tag(’[scada]’ + {views.params.Unit} + “/SuctionPressure”), is that something that would work?T?hx, Jake

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [December 28, 2020, 7:16am UTC](https://forum.inductiveautomation.com/t/time-series-chart-how-do-i-use-historical-data-if-i-require-an-indirect-tag/41796/7 "2020-12-28T07:16:20Z")

</div>

I’m not sure where you’re “using” the `tag(...)` function, but this function will _read the value_ of the tag and returns a QualifiedValue object. You’ll need to hand it the tag path as a string

---

<div class="post-metadata">

**Author:** ![codersmurf](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@codersmurf](https://forum.inductiveautomation.com/u/codersmurf)\
**Post date:** [December 28, 2020, 7:20am UTC](https://forum.inductiveautomation.com/t/time-series-chart-how-do-i-use-historical-data-if-i-require-an-indirect-tag/41796/8 "2020-12-28T07:20:57Z")

</div>

I’ve tried a few things:

[scada]303-10316/SuctionPressure  
[default]303-10316/SuctionPressure  
[~]303-10316/SuctionPressure  
histprov:scada:/drv:default:/tag:303-10316/SuctionPressure  
bunch of different hisprov stuff, everything throws errors, histprov always errors at first colon, seems if I didn’t have to use indirect tags everything would straight forward like vision, just not sure what the expression is looking for. Also, if I use just a tag name it says it needs to be an array.Thx, Jake

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [December 28, 2020, 7:26am UTC](https://forum.inductiveautomation.com/t/time-series-chart-how-do-i-use-historical-data-if-i-require-an-indirect-tag/41796/9 "2020-12-28T07:26:09Z")

</div>

Where are you putting this into?  
For the Power chart, it should go into the prop:  
`props.pens[x].data.source`  
and should be in the format:  
`histprov:<INSERT>:/drv:<INSERT>:default:/tag:<Tag path>`

The easiest way is to add a tag using the inbuilt tool (in runtime) and then modify the config of it

---

<div class="post-metadata">

**Author:** ![codersmurf](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@codersmurf](https://forum.inductiveautomation.com/u/codersmurf)\
**Post date:** [December 28, 2020, 7:29am UTC](https://forum.inductiveautomation.com/t/time-series-chart-how-do-i-use-historical-data-if-i-require-an-indirect-tag/41796/10 "2020-12-28T07:29:05Z")

</div>

That’s where I have my historical binding, what should the driver be? Maybe that’s where my failure is. Found a video for ignition-trainer, but not sure what that it. It’s a mysql db, but that video had it after histprov:.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [December 28, 2020, 7:30am UTC](https://forum.inductiveautomation.com/t/time-series-chart-how-do-i-use-historical-data-if-i-require-an-indirect-tag/41796/11 "2020-12-28T07:30:01Z")

</div>

Use the in-built tool to add a single tag and edit that.  
`histprov` should be the name of your SQL connection  
`drv` should be a combination of your gateway name and … something else, usually ‘default’ e.g. `gateway-name:default`

---

<div class="post-metadata">

**Author:** ![codersmurf](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@codersmurf](https://forum.inductiveautomation.com/u/codersmurf)\
**Post date:** [December 28, 2020, 7:33am UTC](https://forum.inductiveautomation.com/t/time-series-chart-how-do-i-use-historical-data-if-i-require-an-indirect-tag/41796/12 "2020-12-28T07:33:25Z")

</div>

What type of tag, the query tag doesn’t give me a path. I know the provider is scada. The group I think is Default Historical I believe.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [December 28, 2020, 7:34am UTC](https://forum.inductiveautomation.com/t/time-series-chart-how-do-i-use-historical-data-if-i-require-an-indirect-tag/41796/13 "2020-12-28T07:34:52Z")

</div>

Does this help? You don’t need a historical tag binding on the power chart

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

---

<div class="post-metadata">

**Author:** ![codersmurf](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@codersmurf](https://forum.inductiveautomation.com/u/codersmurf)\
**Post date:** [December 28, 2020, 7:42am UTC](https://forum.inductiveautomation.com/t/time-series-chart-how-do-i-use-historical-data-if-i-require-an-indirect-tag/41796/14 "2020-12-28T07:42:58Z")

</div>

In quotes it says the historical binding tags must ref an array, without the quotes it says the : after histprov is no good.

‘histprov:MySQL:/drv:scada:default:/tag:303-10316/SuctionPressure’

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [December 28, 2020, 7:48am UTC](https://forum.inductiveautomation.com/t/time-series-chart-how-do-i-use-historical-data-if-i-require-an-indirect-tag/41796/15 "2020-12-28T07:48:08Z")

</div>

can you add a screenshot similar to mine of what you’ve got?

---

<div class="post-metadata">

**Author:** ![codersmurf](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@codersmurf](https://forum.inductiveautomation.com/u/codersmurf)\
**Post date:** [December 28, 2020, 7:56am UTC](https://forum.inductiveautomation.com/t/time-series-chart-how-do-i-use-historical-data-if-i-require-an-indirect-tag/41796/16 "2020-12-28T07:56:25Z")

</div>

![ignition5](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/0/c0ad71ded569aa2e70cba344a571692dcc3aeb2a.jpeg) I think i see the issue, I don’t have the db tag historian, just the tag historian, it’s never caused an issue before. Here’s a screenshot

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [December 28, 2020, 7:58am UTC](https://forum.inductiveautomation.com/t/time-series-chart-how-do-i-use-historical-data-if-i-require-an-indirect-tag/41796/17 "2020-12-28T07:58:50Z")

</div>

You’re binding the source (string datatype) to the result of a tag history binding (an array of objects datatype). Have a look at my screenshot again. You need to bind the tag path made up of the format I mentioned above **as a string** to the source, not a tag history array.

---

<div class="post-metadata">

**Author:** ![codersmurf](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@codersmurf](https://forum.inductiveautomation.com/u/codersmurf)\
**Post date:** [December 28, 2020, 8:10am UTC](https://forum.inductiveautomation.com/t/time-series-chart-how-do-i-use-historical-data-if-i-require-an-indirect-tag/41796/18 "2020-12-28T08:10:58Z")

</div>

Still getting no data when it’s just an expression. When I use the direct tag the history comes through like a champ, so it’s there and working just fine, they just need to add the indirect tag support, it seems like, that vision had in easy chart.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [December 28, 2020, 8:12am UTC](https://forum.inductiveautomation.com/t/time-series-chart-how-do-i-use-historical-data-if-i-require-an-indirect-tag/41796/19 "2020-12-28T08:12:58Z")

</div>

Did you try as I suggested and add a tag using the in-built tool?

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

---

<div class="post-metadata">

**Author:** ![codersmurf](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@codersmurf](https://forum.inductiveautomation.com/u/codersmurf)\
**Post date:** [December 28, 2020, 8:14am UTC](https://forum.inductiveautomation.com/t/time-series-chart-how-do-i-use-historical-data-if-i-require-an-indirect-tag/41796/20 "2020-12-28T08:14:48Z")

</div>

Since the db is local and I only use the tag historian I’m unable to add tags to the db in such a fashion.

[Next page](https://forum.inductiveautomation.com/t/time-series-chart-how-do-i-use-historical-data-if-i-require-an-indirect-tag/41796.md?page=2)
