Pre loader

How to create dotted line 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
0

Hi~
How to create dotted line cursor like a dashed line curve?
Thanks.

Version
latest
Images
  • You must to post comments
0
0

Hi there

Depending on which modifier you are using, if CursorModifier then the property crosshairStrokeDashArray will give you a dotted line.

Try this:

// Create a SciChartSurface
const { sciChartSurface, wasmContext } = await SciChartSurface.create(divElementId);

// Add CursorModifier behavior
const cursorModifier = new CursorModifier({
    crosshairStroke: "#ff6600",
    crosshairStrokeThickness: 1,
    crosshairStrokeDashArray: [2, 2]
});
sciChartSurface.chartModifiers.add(cursorModifier);

If you are using the RolloverModifier then a similar property rolloverLineStrokeDashArray affects the cursor line stroke

  const rollover = new RolloverModifier();
  rollover.rolloverLineStrokeDashArray = [2,2];
  rollover.rolloverLineStroke = "SteelBlue";
  rollover.rolloverLineStrokeThickness = 2;
  sciChartSurface.chartModifiers.add(rollover);

The strokeDashArray property defines an array which is [dash-length, dot-length]. Try experimenting with [2, 2] or [10, 3] to see how it effects the line.

Let me know if this helps

Best regards
Andrew

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.