Pre loader

Setting a minimum cursor step.

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

0
0

Is it possible to set a minimal step of which cursor(crosshair) will move? For example HG Copper futures has minimum tick of 0.0005. I was trying to LabelProviderBase. I made FormatLabel and FormatCursorLabel rounded to 0.0005. But cursor still can be stay on many positions between 2.9995 and 3.0000 for example, though it shows nearest label.
I want to send orders from the chart and I want cursor to have ablte to stop only exactly at 2.9995 or 3.0000 or any other number which 0.0005 multiple. How can I achieve that?

Please see screenshot. Cursor stays at 2.9997 though it shows 2.9995 because of my label format. Price can be 2.9995 or 3.0000 only. I don’t want for cursor to have ability staying between them.

P.s. I also noticed that If I add cursor to chart and move it aggressivle, CPU usage is grows extensively. Maybe setting of steps it can move will reduce cpu usage. Because by default it moves from point a to point b accross thousends positions.

Images
  • You must to post comments
0
0

It’s still not possible to do this, but we do have a nice set of tutorials on creating custom modifiers over at SCICHART FAQ > CHARTMODIFIERS (ZOOMING, PANNING)

Of particular interest is Custom ChartModifiers – Part 1 – Creating a Custom Rollover Modifier

You might also want to try overriding CursorModifier.OnModifierMouseMove and using our Convert Pixel to Data Coordinates API to snap the e.MousePoint to a certain resolution before passing to the base class.

e.g.

public class CursorModifierEx: CursorModifier
{
    public override void OnModifierMouseMove(ModifierMouseArgs e)
    {
        // calculate new point here
        e.MousePoint = // assign new point depending on your Snaps to algorithm
        // use base.XAxis, base.YAxis and Coordinate Calculation API 
        // to calculate snap increments                           

        base.OnModifierMouseMove(e);
    }
 }
  • 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