Pre loader

zoom into graph and to the front (right)

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

1
0

Hi,
I’ve only really just got started with Scichart.
I’ve created a realtime ticking chart using candlesticks.
Its based on the examples.

The problem I have is that if I add 200 points to the graph, the graph is zoomed out so that all 200 points are on screen and visible.
I want to zoom in a bit and position the visible area to the latest points. To the front (right). The user can then scroll left to see previous points.

I’ve tried a couple things like…

        IRange visibleRange = surface.getXAxes().get(0).getVisibleRange();
    visibleRange.setMax(20.09);



    IRange foo = surface.getXAxes().get(0).getMaximumRange();
    visibleRange.setMinMaxDouble(foo.getMaxAsDouble(), foo.getMaxAsDouble());

The set max works, but I cant figure out how to position the view to the latest points (the very right)

Can someone help?

Thanks
Aidan

Version
3
  • You must to post comments
1
0

Hi Aidan,

Thanks for your question.

I would suggest to use getDataRange() method instead of getMaximumRange() to determine the value of the last point on the specified axis because unlike MaximumRange DataRange doesn’t apply GrowBy value if it is set.

So I think the code should look like this:

    final double amountOfDataYouWantToSee = 10;
    final double max = axis.getDataRange().getMaxAsDouble();
    axis.getVisibleRange().setMinMaxDouble(max - amountOfDataYouWantToSee, max);

Hope it helps!

Best regards,
Yura

  • Aidan Mack
    Thanks Yura, Based on your reply’s and the work I have done with SciChart so far I think we will purchase a licence soon. Regards Aidan
  • You must to post comments
0
0

HI,
Did someone answer this?
I had an email to say they had, but when I’ve logged into the forum to read it I can not see any message.

Thanks
Aidan

  • You must to post comments
Showing 2 results
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