# Vision Ad Hoc Trend

**URL:** <https://forum.inductiveautomation.com/t/vision-ad-hoc-trend/98327>\
**Category:** Ignition Exchange\
**Tags:** vision\
**Created:** [November 7, 2024, 9:19am UTC](https://forum.inductiveautomation.com/t/vision-ad-hoc-trend/98327 "2024-11-07T09:19:48Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![e.cutino](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@e.cutino](https://forum.inductiveautomation.com/u/e.cutino)\
**Post date:** [November 7, 2024, 9:19am UTC](https://forum.inductiveautomation.com/t/vision-ad-hoc-trend/98327/1 "2024-11-07T09:19:48Z")

</div>

Hi,

I'm using Ad Hoc Trend with Sql Server 2019 (Ign 8.1.44, Ad Hoc 1.0.3).

I got this chart:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/0/90f4d4f5681ff6f859dfbf5e8fa45de93f631a68.png)

I saved the chart (both public and as user) and, re-loading, I got this chart:

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

Basically in the re-loaded: the "Weight" is changed to 10 (from 1) and Axes are indicated as "Automatic" but indeed are not using full-scale.

Any idea? Thx.

---

<div class="post-metadata">

**Author:** ![Benjamin\_Furlani](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/benjamin_furlani/32/66084_2.png) [@Benjamin\_Furlani](https://forum.inductiveautomation.com/u/Benjamin_Furlani)\
**Post date:** [November 7, 2024, 2:28pm UTC](https://forum.inductiveautomation.com/t/vision-ad-hoc-trend/98327/2 "2024-11-07T14:28:07Z")

</div>

Did you save it in the client side of Vision, or did you have it open in the designer and change the settings?

---

<div class="post-metadata">

**Author:** ![e.cutino](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@e.cutino](https://forum.inductiveautomation.com/u/e.cutino)\
**Post date:** [November 7, 2024, 2:40pm UTC](https://forum.inductiveautomation.com/t/vision-ad-hoc-trend/98327/3 "2024-11-07T14:40:16Z")

</div>

Client side, via Vision Luncher

---

<div class="post-metadata">

**Author:** ![Benjamin\_Furlani](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/benjamin_furlani/32/66084_2.png) [@Benjamin\_Furlani](https://forum.inductiveautomation.com/u/Benjamin_Furlani)\
**Post date:** [November 7, 2024, 2:45pm UTC](https://forum.inductiveautomation.com/t/vision-ad-hoc-trend/98327/4 "2024-11-07T14:45:37Z")

</div>

In order to persist changes for all sessions you have to update the chart settings in the designer by selecting the run button or updating the properties in the property editor panel

---

<div class="post-metadata">

**Author:** ![e.cutino](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@e.cutino](https://forum.inductiveautomation.com/u/e.cutino)\
**Post date:** [November 7, 2024, 2:53pm UTC](https://forum.inductiveautomation.com/t/vision-ad-hoc-trend/98327/5 "2024-11-07T14:53:37Z")

</div>

So sorry, not clear to me: I don't want to change the dimension/column of the Pen table or similar. The chart should/must be saved at run time, as viewed by the operator. If the operator chooses "weight = 1" and then saves the chart, when the chart is loaded/retrived it has to be same.  
Or, sorry again, not clear what you meant.

---

<div class="post-metadata">

**Author:** ![Benjamin\_Furlani](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/benjamin_furlani/32/66084_2.png) [@Benjamin\_Furlani](https://forum.inductiveautomation.com/u/Benjamin_Furlani)\
**Post date:** [November 7, 2024, 2:54pm UTC](https://forum.inductiveautomation.com/t/vision-ad-hoc-trend/98327/6 "2024-11-07T14:54:46Z")

</div>

So just to be clear you want the settings to persist per operator even when they exit and reload the application?

---

<div class="post-metadata">

**Author:** ![e.cutino](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@e.cutino](https://forum.inductiveautomation.com/u/e.cutino)\
**Post date:** [November 7, 2024, 2:59pm UTC](https://forum.inductiveautomation.com/t/vision-ad-hoc-trend/98327/7 "2024-11-07T14:59:26Z")

</div>

It is not matter of exiting.

1. Chart is ok, the operator saves the chart, via button at top-right (axes automatic, pen weight = 1) --\> See Image 1
2. Upon "loaded", in the same session, the chart has different scale (despite axes being automatic) and different pen weight (weight = 10) -\> See image 2

---

<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:** [November 7, 2024, 3:27pm UTC](https://forum.inductiveautomation.com/t/vision-ad-hoc-trend/98327/8 "2024-11-07T15:27:17Z")

</div>

> [@Benjamin\_Furlani](#):
>
> settings to persist per operator even when they exit and reload the application?

This is a key feature of the Ad Hoc Trends exchange project, and uses the database to persist the setup.

---

<div class="post-metadata">

**Author:** ![e.cutino](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@e.cutino](https://forum.inductiveautomation.com/u/e.cutino)\
**Post date:** [November 7, 2024, 3:29pm UTC](https://forum.inductiveautomation.com/t/vision-ad-hoc-trend/98327/9 "2024-11-07T15:29:06Z")

</div>

Sorry, not clear. The issue is on the same chart, as per the 2 images above. The operator saves the chart with a scale/pen weight and then when reloaded is different. Or, sorry again, not understood

---

<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:** [November 7, 2024, 3:31pm UTC](https://forum.inductiveautomation.com/t/vision-ad-hoc-trend/98327/10 "2024-11-07T15:31:59Z")

</div>

> [@e.cutino](#):
>
> Sorry, not clear.

I was replying to Benjamin. He's trying to help you, but is stuck on the persistence functionality. I'm not sure where your problem is, as I don't use that tool now-a-days.

You will probably need to study the database content to see where it is going wrong.

---

<div class="post-metadata">

**Author:** ![e.cutino](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@e.cutino](https://forum.inductiveautomation.com/u/e.cutino)\
**Post date:** [November 7, 2024, 4:21pm UTC](https://forum.inductiveautomation.com/t/vision-ad-hoc-trend/98327/11 "2024-11-07T16:21:41Z")

</div>

I did and it seems ok. All the parameters are correctly loaded from the DB.

It is very strange: despite being in axes "Automatic", the trend component seems to ignore that bit/information and it is re-scaling (after the load) as in Image 2 above (beyond the "Weight" issue - not yet investigated).

I would prefer to avoid any change, in order to avoid impact with future release/update. It is a major aspect, I suspect to have something wrong/misconfigured at my end

---

<div class="post-metadata">

**Author:** ![Benjamin\_Furlani](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/benjamin_furlani/32/66084_2.png) [@Benjamin\_Furlani](https://forum.inductiveautomation.com/u/Benjamin_Furlani)\
**Post date:** [November 7, 2024, 4:46pm UTC](https://forum.inductiveautomation.com/t/vision-ad-hoc-trend/98327/12 "2024-11-07T16:46:21Z")

</div>

Ah, I was unaware that was part of it. Thank you for the clarification.

---

<div class="post-metadata">

**Author:** ![zxcslo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zxcslo/32/61610_2.png) [@zxcslo](https://forum.inductiveautomation.com/u/zxcslo)\
**Post date:** [November 8, 2024, 10:12am UTC](https://forum.inductiveautomation.com/t/vision-ad-hoc-trend/98327/13 "2024-11-08T10:12:51Z")

</div>

> [@e.cutino](#):
>
> I suspect to have something wrong/misconfigured at my end

No, you're not.  
The problem is with Ad Hoc Trend template, how it handles decimal delimiters (I've been there)...  
I'll bet that you're have comma for decimals...?

When you save the chart, the value for weight is saved as "1.0" (not "1,0"). But when you load the saved chart, the weight is read as "10" because you have set the language (in Vision or designer preview) which has comma as decimal delimiter.

It was long time ago when I was dealing with this, but I think that I change something in the "save chart" code...

EDIT: I think I found it:  
In the "Save Graph" button code there's this line:

```python
tagPensStr = system.dataset.toCSV(dataset=chart.tagPens, forExport=True)

```

I added 'localized=True':

```python
tagPensStr = system.dataset.toCSV(dataset=chart.tagPens, forExport=True, localized=True)

```

Help for this function: [system.dataset.toCSV](https://docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-dataset/system-dataset-toCSV#syntax)

---

<div class="post-metadata">

**Author:** ![e.cutino](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@e.cutino](https://forum.inductiveautomation.com/u/e.cutino)\
**Post date:** [November 11, 2024, 7:33am UTC](https://forum.inductiveautomation.com/t/vision-ad-hoc-trend/98327/14 "2024-11-11T07:33:54Z")

</div>

Thx. It works for the "weight". Indeed the not for the scale, that remains as in Image 2 above. Any solution for that?

UPDATE: sorted out. The same issue is on the following statement, regarding axes. It is sorted out addeing "localized = True" in both the statement inside the "Save Graph" button.

So it becomes:

Row 20:

> tagPensStr = system.dataset.toCSV(dataset=chart.tagPens, forExport=True, localized=True)

Row 21:

> axesStr = system.dataset.toCSV(dataset=chart.axes, forExport=True, localized=True)
