Pre loader

Tag: Cursor

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 vote
12k views

Hi,

I am trying out SciChart, and so far I am impressed about the performance and capabilities.

For my application I need to have a cursor showing the X and Y values of the current data point. The RolloverModifier seems to be a good start, but at some points i need other behaviour:

  1. I need the cursor to only move when the mouse button is down. So
    you can zoom/pan the graph, with the cursor remaining on the same
    data point.
  2. I need the cursor to move to the next/previous data
    point on a keypress (Keys.Left and Keys.Right).

The exapmle “Custom ChartModifiers – Part 2 – Custom ZoomPanModifier and Zooming on KeyPress” seems to be a good start, where the OnAttached() method of a SimpleZoomInOutModifier class, derived from ChartModifierBase, is overridden to get access to keypress events:

    public override void OnAttached()
    {
        base.OnAttached();
        var scichart = ((SciChartSurface)ParentSurface);

        var mainWindow = FindLogicalParent(scichart);

        mainWindow.PreviewKeyDown -= SciChart_PreviewKeyDown;
        mainWindow.PreviewKeyDown += SciChart_PreviewKeyDown;
    }

    private T FindLogicalParent(SciChartSurface scichart) where T:class
    {
        var parent = (FrameworkElement)scichart.Parent;
        while (parent != null)
        {
            var candidate = parent as T;
            if (candidate != null) return candidate;

            parent = (FrameworkElement)parent.Parent;
        }

        return null;
    }

But the function FindLogicalParent() gives compiler errors, and in the downloaded code for this exaple application, this method isn’t even there… the method OnAttached() in the downloaded code is:

    public override void OnAttached()
    {
        base.OnAttached();
        var scichart = ((SciChartSurface)ParentSurface);

        scichart.PreviewKeyDown -= SciChart_PreviewKeyDown;
        scichart.PreviewKeyDown += SciChart_PreviewKeyDown;
    }

But this code doesn’t work. The SciChart_PreviewKeyDown eventhandler is never called.

How to move forward?

1 vote
18k views

Hi.

I am evaluating the SciChart control – so far it looks very promising.

I have a FastHeatMapRenderableSeries that is analyzed and a FastLineRenderableSeries line is drawn through the chart.

The user needs to be able to correct the analysis, and this is done by “drawing” in the heatmap.

As far as I could tell, the ChartModifierBase gives med the necessary hooks to track the user’s mouse movements – but I would like to give some visual feedback by changing the cursor, for instance to Cursors.Pen (Cursors from the Microsoft namespace)

Is this possible? I would want to enable drawing when user presses Ctrl, the disable it when user releases Ctrl…

0 votes
9k views

hi, I wanted to display the cursor information (x, y value)on the text annotation like the following. I can only find the example of displaying as tooltip, but is it possible to show with the text annotation? Thank you!

  • may lym asked 6 years ago
  • last active 6 years ago
0 votes
9k views

Greeting, I want to do a custom cursor, something just like the image, but with candles (a candlestick chart) , and I wanna see all the info (Date, open, close, high, low). Is there any example of it?

2 votes
8k views

I’m trying to create a spectrum viewer with your library. One important feature is a cursor supporting both automatic mode and manual mode. In automatic mode, it stays at the maximum value. In manual mode, it moves with finger panning. It’s close to the SCICursorModifier with the cross lines, but it should always stay on the plot even without touch. Also it should reside on real data points instead of anywhere in between like the SCIRolloverModifier instead of the SCICursorModifier.

Could you give me some advices about how to achieve it? Thanks.

EDIT: after reading more of your documents, I believe HorizontalLineAnnotation and VerticalLineAnnotation are the way to go. I have already added them as the automatic mode cursor. For the manual mode, I still need your help to achieve either:
1) a callback function for the VerticalLineAnnotation drag event, so that I could move both lines to the corresponding data point
or
2) a custom ZoomPanModifier to allow me to distinguish one point or two points touch: one point panning to move the whole plot and two points panning to determine the new cursor location and redraw the two annotations there

EDIT2: I was able to create a custom VerticalLineAnnotation class to handle the panning event. There is one more question left. Right now in order to update the verticallineannotation and horizontallineannotation on the graph, I remove them from sciChartSurface.annotations, change x/y locations and add them back. Is there a redraw or refresh or update function to call directly?

Thanks

  • Haoran Xie asked 5 years ago
  • last active 5 years ago
0 votes
6k views

Android
App version 3.1.1.4423

I am able to sync two charts and receive events between both charts.

However, I wanted to remove the shared y-axis panning between the charts.
I was able to get this working by setting the “withReceiveHandledEvents(false)” linked to the motion event group and setting the “.withYAxisDragModifier().withReceiveHandledEvents(false)”.

However, the current problem being faced, is that, the cursor is now no longer synced between the two charts as if I had “withReceiveHandledEvents(false)” on the motion event group.

I tried using the cursor modifier group, but this did not provide a syncing cursor between the charts.

Is there a way to sync the cursor between the charts without having the y-axis panning synced as well?

0 votes
2k views

Hi guys, I got problem that cursor modifier is not display full lines on x and y axis, ( also it breaks when browser zoom changes ) is there any solution now ?

1 vote
2k views

The SciChart Legend and Cursor Tooltip (Showed only Y axis value) are not display after changing the graph layout.
I need to show the graph legend and Tooltip for all the Y axis.

The chart should also show the x axis value and y axis value on the Tooltip for more clarity.

Before changing the layout the legend was showing the five series vertically one below the other. But i need to show the five legends in horizontally (One after the another).

I have added the chart definition code. The data is added though Ajax call and code for that ajax call is not added.

I have attached the image for your reference.

I have attached the zip file with the html file.

Showing 8 results

Try SciChart Today

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

Start TrialCase Studies