Dynamic Y axis range from the datasource on the XY Charg

Sometimes, I get this clipping effect that I want to eliminate.

My thought is that I want to set the range as 0 and then {max(stops)} + 3,000 somehow.

My datasource is a query binding.

I have had bad luck with self referencing bindings of properties before.
So I wondered what the best way might be.

I can't set constants in the range because sometimes this query shows totals of many machines and sometimes just for one machine.

Hi Zachary,

By default, the XY chart should auto range. It is possible that other properties on your view could be affecting how your XY chart looks. I would need to see your view as a whole before making conclusions. You can always reach out to support and have us take a closer look with you that way.

If you want to use your own scaling instead, you can always bind your Y axis' max property to your data source and use a script transform to detect the max value in that dataset. From there you would just add 3000 to that value.

Here is an example of the script I used to test this:

1 Like


That is so obvious now that you have shown me it.
Thanks so much.

A bit more pythonic....

return  max(value, key=lambda x:x['process_temp']) + 3000
1 Like

The lambda confuses me. I had to relearn it multiple times. I think I need to start using lambda more to retain it.
I think lambda is a kind of shorthand to look at all args.

I read lambda is like an anonymous function.
Receives x, returns x['process_temp'] from the value in this example.

This helped me too.

I am getting an object is not iterrable error.

My datasource is bound to a query.
I found in the manual in the datasets section, a way to get the value I needed.

this=data.getColumnAsList( data.getColumnIndex('Stops'))
return max(this)+3000