SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components
I have stock charts and want to prevent the user to go beyond the Min/Max datetimes (left, right). I tried applying setVisibleRangeLimitMode() to XAxis but it has no effect:
private final DoubleRange sharedXRange = new DoubleRange(); //sharedXRange.setMinMax(0d, response.body().getData().size()-1d); // not helping ... final CategoryDateAxis xAxis = sciChartBuilder.newCategoryDateAxis() .withVisibility(isMainPane ? View.VISIBLE : View.GONE) .withVisibleRange(sharedXRange) .withGrowBy(0.1d, 0.1d) .build(); xAxis.setMinimalZoomConstrain(10d); // minimum 10 points xAxis.setVisibleRangeLimitMode(RangeClipMode.MinMax); // not working //xAxis.setVisibleRangeLimit(new DoubleRange(-5d,5d)); ...
I am thinking that maybe I should set Min and Max to sharedXRange, but couldn’t find in the docs what value to put into (tried with index, and Date without luck).
My axis is SCICategoryDateTimeAxis type. And using SCIZoomPanModifier (SCIClipMode_ClipAtExtents) to scroll chart
I’m using setVisibleRangeLimit: method to clip the axis during ZoomExtents
Until v. 18.104.22.1681 it’s work like a charm. But now something had have broken. And it’s doesn’t allow me to scroll chart at right way. It show me all of the data range on chart or only left side.
So can you fix it?
We were recently asked on priority support tickets ‘How do I ZoomExtents a SciChartSurface to a specific range, e.g. VisibleRangeLimit, when double clicking on the chart’.
For the benefit of our user-base our solution is below.
I made an example based on the “Vertically Stacked Axes” from SciChart Examples. The main difference is that I can add DataSeries / YAxes on the fly.
The problem is that when I set VisibleRange and VisibleRangeLimit it does not crop the trace (as you can see on the Tan traces that are drawn on the whole surface).
Is there any way to crop the traces to VisibleRange of corresponding Axis?