Pre loader

BoxAnnotation selected, expands past the chart area

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


When I’m using a BoxAnnotation, and it is selected, I can see that the borders are shown expanding past the chart area, on top of the axes.
Ideally they would have the same behaviour as the normal stroke, and keep constrained to the chart area.

Codepen showing the issue:

Am I missing some configuration to make this work?


  • Andrew Burnett-Thompson
    Hi João, sounds like you want to be able to clip the Annotation to bounds when selected? Honestly – I think that the current behaviour in the codepen *looks* correct – many users would want to know the extent of the annotation they are selecting, dragging. The adorner layer is also on a different layer and uses SVG not our rendering context to draw the geometry. Nevertheless, we will try a few things and get back to you
  • João Velasques
    Yeah it might be useful to know that… Nevertheless my use case dictates that it shouldn’t extend past the chart area. I do have a workaround though, I extended the BoxAnnotation, and I’m basically not drawing the adorner layer, and am instead drawing a second Rect, when the annotation is selected. Unsure what a good solution to support both cases would be here, but I’ll await more information! Thanks!
  • You must to post comments


This can be worked around with some customisation of the BoxAnnotation. I’m shifting the adorners onto the main svg layer which is sized to the seriesViewRect, and then dealing with all the implications of that.

The same approach should work for other types of annotation.

We’re still not convinced this should be the standard, or even a built in option, but I am going to put this pen in a task to think about it further at some point.

The bottom border still showing on the x axis when dragged is something else which will take a bit more investigation.


  • David Burleigh
    The bottom border issue is because we draw the box differently for strokeThickness > 3 such that it clamps the bottom. Set strokeThickness <= 3 and it will behave fine. I'm hoping to deal with the underlying issue fairly soon, which will unify the drawing and solve this for all thicknesses. That will probably come in the next big release which we are hoping will be before the end of the year.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

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

Start TrialCase Studies