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



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…

  • You must to post comments

Hi Espen,

This should be really easy. WPF itself gives a mechanism to change the cursor of a WPF UserControl, such as the SciChartSurface.

SciChartSurface.Cursor = Cursors.Pen;

For a way to do this using our ChartModifier API, you could create some code like this:

public class CursorChangeModifier : ChartModifierBase
    public override void OnModifierKeyDown(ModifierKeyArgs e)

        base.SetCursor(e.Modifier == MouseModifier.Ctrl ? Cursors.Pen : Cursors.Arrow);

sciChartSurface.ChartModifier = new ModifierGroup(new CursorChangeModifier());

That should do it, it should now change cursor to Hand when you press the CTRL key and Arrow when you release it.

Note you will need to first click on the chart to give it focus or Key events won’t fire.

As for drawing, you will need to listen to OnModifierMouseDown, OnModifierMouseUp, OnModifierMouseMove, and then change the X,Y values in a XyDataSeries / FastLineRenderableSeries pair. You can do this inside a ChartModifier to allow ‘drawing’ on the chart.

Or, or more complex shapes drawing, note that ChartModifierBase.ModifierSurface is a canvas which accepts any WPF UIElement.

For more info about our ChartModifier API please see here. For any questions, please ask!

Best regards,

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.