SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components

0 votes
631 views

For my chart, I create a TimeSpanAxisViewModel with a VisibleRangeLimit like this…

VisibleRange = new TimeSpanRange(new TimeSpan(0, 0, 0), new TimeSpan(0, 0, 30))    
VisibleRangeLimit = new TimeSpanRange(new TimeSpan(0, 0, 0), new TimeSpan(0, 0, 30))
AutoRange = AutoRange.Never

Which properly shows the chart as having 30 seconds of time. Data is added to the chart and it displays as expected.

However, once that data reaches the 30-second limit I’m trying to increase the range by 30 more seconds.

I have a timer that evaluates the elapsed time of a Stopwatch and when that Stopwatch is greater than the current limit (30 seconds) I add to the maximum limit.

Kind of like this…

// If the stopwatch is greater than current range
if (MyStopwatch.Elapsed.TotalSeconds > VisibleRangeSeconds) {

    VisibleRangeSeconds += 30;

    TimeSpan minimumTime = new TimeSpan(0);
    TimeSpan maximumTime = new TimeSpan(0, 0, VisibleRangeSeconds);

    XAxes[0].VisibleRange = new TimeSpanRange(min: minimumTime, max: maximumTime);
    XAxes[0].VisibleRangeLimit = new TimeSpanRange(min: minimumTime, max: maximumTime);

    MySciChart.ChartModifier.ParentSurface.InvalidateElement();
}

I also noticed that VisibleRangeLimit was being updated after the Stopwatch became longer but VisibleRange was staying the same. It wasn’t being updated and I’m not sure why.

What could I be missing that would make the chart grow to the new maximum time?

  • Greg Knox asked 8 months ago
  • last active 8 months ago
1 vote
792 views

If you set limit on range of axis, the pinch gesture will not work correctly.
Pinch the chart and hold for a while (about less than 1 sec), the chart will resize to the limit value you set on the axis.

You can change code of OscilloscopeFragment.java#106 in Examples to below to reproduce this problem.

final IAxis xBottomAxis = sciChartBuilder.newNumericAxis()
                    .withAutoRangeMode(AutoRange.Never)
                    .withAxisTitle("Time (ms)")
                    .withVisibleRange(new DoubleRange(2.5, 4.5))
                    .withVisibleRangeLimit(0,20)   // this will help reproduce the problem
                    .build();
0 votes
1k views

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).

  • Primoz asked 11 months ago
  • last active 11 months ago
0 votes
2k views

Hi, guys

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. 2.0.0.1511 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?

Best regards,
Sushynski Andrei

0 votes
7k views

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.

  • Andrew asked 5 years ago
  • last active 5 years ago
1 vote
6k views

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?

  • Jan Kaiser asked 5 years ago
  • last active 5 years ago
Showing 6 results
This template supports the sidebar's widgets. Add one or use Full Width layout.
SciChart WPF v6 BETA released! Note pricing/licensing changes are coming. Contact us to beat the rise!Read more
+