Custom Tick Default zoom range

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
symbolick
Posts: 52
Joined: Thu May 16, 2013 8:24 pm

Custom Tick Default zoom range

Post by symbolick » Wed Nov 29, 2023 11:09 pm

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

ArctionKestutis
Posts: 555
Joined: Mon Mar 14, 2016 9:22 am

Re: Custom Tick Default zoom range

Post by ArctionKestutis » Thu Nov 30, 2023 11:10 am

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.

symbolick
Posts: 52
Joined: Thu May 16, 2013 8:24 pm

Re: Custom Tick Default zoom range

Post by symbolick » Thu Nov 30, 2023 6:37 pm

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?
Attachments
arctionImage1.png
arctionImage1.png (108.32 KiB) Viewed 22524 times

ArctionKestutis
Posts: 555
Joined: Mon Mar 14, 2016 9:22 am

Re: Custom Tick Default zoom range

Post by ArctionKestutis » Fri Dec 01, 2023 12:08 pm

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.

symbolick
Posts: 52
Joined: Thu May 16, 2013 8:24 pm

Re: Custom Tick Default zoom range

Post by symbolick » Mon Dec 04, 2023 11:53 pm

Thank you, the setrange method is what I was looking for.

Post Reply