Pre loader

How to change ChartModifier

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 developing a candle stick chart, with modifier newModifierGroupWithDefaultModifiers
What i want to do is
1. when user click the chart, the modifier will be changed to CursorModifier,
2. xy axis label should not disappeared when user release their finger

How could i do that?

Thank you

  • You must to post comments

Hi Tommy,

Thanks for writing to us.

Well nothing of this is available out of the box but you can create custom modifiers to provided desired behavior.

  1. You can create a separate modifier which listens to touch event and when click occurs it enables CursorModifier:

    class ActivateCursorModifier extends GestureModifierBase {
    private final CursorModifier cursorModifier;
    ActivateCursorModifier(CursorModifier cursorModifier) {
        this.cursorModifier = cursorModifier;
        // intercept handled touch events
        // disable modifier
    public boolean onSingleTapUp(MotionEvent e) {
        // enable modifier after click
        return true;
  2. You can customize CursorModifier to prevent hiding it’s tooltips and override its onTouchDown() which shows tooltips and onTouchUp() which hides tooltips:

    class CustomCursorModifier extends CursorModifier {
    private boolean isFirstTouch = true;
    protected boolean onTouchDown(ModifierTouchEventArgs args) {
        // place tooltip on first touch only and ignore other touch down events because tooltip should remain on screen
        if(isFirstTouch) {
            isFirstTouch = false;
            return super.onTouchDown(args);
        } else
        return true;
    protected boolean onTouchUp(ModifierTouchEventArgs args) {
        // ignore touch up event
        return false;

Is this suitable for your needs?

Hope it will help you.

Best regards,

  • You must to post comments

Thanks! Your code is really helpful
May I ask how to modify the axis label of the cursor? I cannot find any public interface to change it

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.