Pre loader

Annotation is registering my click outside of the chart, is there way to disable it from registering click outside of the chart?

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


Codesandbox link:

I put the first box annotation to be from -5 to 6 and the x-axis range is from 0 to 10, so that mean some portion of the first box annotation is out of the chart. And there is a click event on the box annotation and console log whenever it is clicked on, and when I click outside of the chart box/square and align it to the box annotation, it is registering the click.

  • You must to post comments
Best Answer


For now, use this CustomAnnotation which does a seriesViewRect check first:

class CustomBox extends BoxAnnotation {
  protected checkIsClickedOnAnnotationInternal(x: number, y: number): boolean {
    // coordinate parameters have already been transformed to be relative to the seriesViewRect
    if (x < 0 || x > this.parentSurface.seriesViewRect.width) {
      return false;
    if (y < 0 || y > this.parentSurface.seriesViewRect.height) {
      return false;
    return super.checkIsClickedOnAnnotationInternal(x, y);

Updated codesandbox:

We will discuss internally whether this is a bug or whether it needs to be an option on annotations.


  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.