Change easy chart axis property in script

I need to change the axis property 'AutoRange' in a script on a button. Are the axes settings in the Easy Chart Customizer available in script? If so, what is the syntax?

Yes, but it's part of a dataset stored as ".axes", which can contain multiple axes. You could write to the dataset in a script, but you may have an easier time using a Cell Update binding on the Axes dataset and linking the AUTO_RANGE cell to a custom Boolean that you create on the page.

2 Likes

That worked perfectly! Thank you

1 Like

I created a memory tag "[client]UI/USERS/Sensors/ezchart_auto_range"

Under "Chart Configuration" for EZChart, I went to Axes and clicked on "Dataset Editor", copied to clipboard, and modified it (per this posting) to use my tag instead of a fixed value.

"#NAMES"
"NAME","LABEL","TYPE","LABEL_COLOR","TICK_LABEL_COLOR","TICK_MARK_COLOR","POSITION","INVERT","AUTO_RANGE","AUTO_RANGE_INCL_ZERO","AUTO_RANGE_MARGIN","LOWER_BOUND","UPPER_BOUND","AUTO_TICK_UNITS","TICK_UNIT","GRID_UNIT","NUMBER_FORMAT","LOG_LABEL_STYLE","SYMBOL_STRING","GRID_BANDS_VISIBLE","GRID_BAND_COLOR","GRID_BAND_ALTERNATE_COLOR"
"#TYPES"
"str","str","str","clr","clr","clr","I","B","B","B","D","D","D","B","D","D","str","str","str","B","clr","clr"
"#ROWS","1"
"MoirePSI","PSI","Numeric","color(0,0,0,255)","color(0,0,0,255)","color(0,0,0,255)","0","false","[client]UI/USERS/Sensors/ezchart_auto_range","false","0.05","-16.0","16.0","false","1.0","10.0","","normal","","false","color(232,234,232,128)","color(0,0,0,0)"

However, when I try to paste this back into Designer, I get following error:

ClassCastException: Error trying to coerce '[client]ui/users/sensors/ezchart_auto_range' to a number.

I tried boolean and integer types for my memory tag and {} around its reference in dataset editor, but error is always the same. I'm too tired (on daily basis) to try doing much scripting, so looking for simpler way.

I'm using Ignition v8.1.35 (b2023120517)

Could you post a screenshot or two to illustrate what you're describing, including what you're pasting back in to Designer and where? Are you looking for help implementing a Cell Update binding or something different? The quoted text makes it sound like you want a Cell Update binding but the rest of the post doesn't seem to describe that.

1 Like

It's likely I mixed these up, sorry. You asking this question made me question my terminology & after some more searching of Inductive University, I found a video on Cell Update Binding which is all I needed!

In case I ever need to do this, but with an indirect tag, then above won't work and I will need to first create a Custom Property with indirect tag, then use that Custom Property inside Cell Update Binding.

I think Forums are great, but not as a first foray into a topic; almost invariably forum is an extension or deeper dive into what's been explained generically elsewhere. I routinely forget what/how I did everything in ignition (because I modify the project so infrequently). Forums are a bad place to search for generic how-to information :slight_smile:

[ignore rest]
What had been doing & trying to explain was needlessly complicated:
In Designer, lower left Axes:
"


I click Dataset editor:
designer Axes Configuration1
Copy dataset to clipboard and modify to place tag references (I tried with {} and without):

When pasting same back in, I get error:

Thank you, makes more sense now. That's not surprising though, I don't think it's possible to do a binding within the dataset editor. Sounds like you got things working though?