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
Custom Tick Default zoom range
Moderator: Queue Moderators
-
- Posts: 555
- Joined: Mon Mar 14, 2016 9:22 am
Re: Custom Tick Default zoom range
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.
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
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?
Which method's could I use to get the axis range in pixels and set the default viewxy range?
- Attachments
-
- arctionImage1.png (108.32 KiB) Viewed 23479 times
-
- Posts: 555
- Joined: Mon Mar 14, 2016 9:22 am
Re: Custom Tick Default zoom range
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.
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
Thank you, the setrange method is what I was looking for.