Pre loader

Change X axis interval dynamically runtime

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums


I am trying to develop a realtime moving chart which reads data and plots. It has four channels. Both X and Y axis intervals are dynamic. ie, required to change the axis interval runtime so that graph plots accordingly.
I implemetd it. Y axis is ok. As it is an moving chart I need to reset the visible range so as to move the chart along X axis . Even if I change the interval of X axis, when I reset the visible it changes to old value.

Following is the code:

On Load:
double SclX=10; // no of intervals in x axis(major ticks)

sciChartSurface.XAxis.AutoTicks = false;
sciChartSurface.XAxis.AutoRange = AutoRange.Never;
sciChartSurface.XAxis.MajorDelta = 100; //Convert.ToDouble(trackFactorX[XCur, 1])
sciChartSurface.XAxis.MinorDelta = 20; //((Convert.ToDouble(trackFactorX[XCur, 1]) /SclX)*2)
XCurMin = 100; // Convert.ToDouble(trackFactorX[XCur, 1]);
XCurMax = 1000; //SclX * Convert.ToDouble(trackFactorX[XCur, 1]);
sciChartSurface.XAxis.VisibleRange = new DoubleRange(XCurMin, XCurMax );

Resetting visible range to implement moving chart

timer.Interval = TimeSpan.FromMilliseconds(1);
timer.Tick += (s, e) =>
if (i > XCurMax)
XCurMin = XCurMin + Convert.ToDouble(trackFactorX[XCur, 1]);
XCurMax = XCurMin + (SclX * Convert.ToDouble(trackFactorX[XCur, 1]));
sciChartSurface.XAxis.VisibleRange = new DoubleRange(XCurMin, XCurMax);

Changing interval from 100 to 200 (button click)

sciChartSurface.XAxis.AutoTicks = false;
sciChartSurface.XAxis.MajorDelta = 200; //Convert.ToDouble(trackFactorX[XCur, 1]);
sciChartSurface.XAxis.MinorDelta = 40; // ((Convert.ToDouble(trackFactorX[XCur, 1]) / SclX) * 2);
XCurMin = XCurMin;
XCurMax = XCurMin + (SclX * Convert.ToDouble(trackFactorX[XCur, 1]));

sciChartSurface.XAxis.VisibleRange = new DoubleRange(XCurMin, XCurMax);

Please check any thing else is required.

  • You must to post comments

I am not sure what the problem is / or fully understand the question, however you seem to be wanting to make a Strip Chart with SciChart WPF (a chart which scrolls automatically when new data arrives).

We have a KB article on how to do this here: How to Create a Scrolling Strip Chart in SciChart?

enter image description here

And also a code sample here:

Please let me know if this helps,

Best regards

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies