Page 1 of 1

Custom Tick Default zoom range

Posted: Wed Nov 29, 2023 11:09 pm
by symbolick
I have a case where it's requested to create custom ticks that extend above and below the data plotted on the chart by a specific formulaic amount. This results in custom ticks extending above and below the plotted data by about 25% of the plotted data's min/max. I have been testing different zoompansettings options to try and get it to initially zoom out to show the min and max custom tick but always seems to truncate the top and bottom custom tick. I have put an arbitrary amount of pixels in the marginfit parameter with some success but am not sure that will work for all screens since it's pixels and the custom ticks are created on the plotted data values. Am I missing a way to set this as the initial zoom range?

Sorry if this has already been asked I didn't scan the forum very well.

Thank you,
Aaron

Re: Custom Tick Default zoom range

Posted: Thu Nov 30, 2023 11:10 am
by ArctionKestutis
Sorry I am not completely grasping the problem. Could you include the picture Even better if you would send your (test) project by email to Support at lightningchart.com.
If you need conversion between Axis-values and screen-coordinates, then use corresponding Axis methods. Typically for those methods to work correctly, you need chart to be rendered first. _Chart.Loaded event handler is good one for initial size reading and fine adjustment before showing chart for the first time.

Hope this helps.

Re: Custom Tick Default zoom range

Posted: Thu Nov 30, 2023 6:37 pm
by symbolick
So it's loading like the first image even though there are custom ticks above and below when I pan like in the second and the third image.

Which method's could I use to get the axis range in pixels and set the default viewxy range?

Re: Custom Tick Default zoom range

Posted: Fri Dec 01, 2023 12:08 pm
by ArctionKestutis
The range of Axis you want to make visible in the Chart is controlled by Axis.Minimum and Maximum properties. It is recommended to set them at the same time with Axis.SetRange() method.

This range could be overwrite, if you have ViewXY.ZoomToFit() call in your code. So don't use such or similar, if you want manual control of Axis range.

Re: Custom Tick Default zoom range

Posted: Mon Dec 04, 2023 11:53 pm
by symbolick
Thank you, the setrange method is what I was looking for.