Pre loader

Resize of window causes y-axis labels to clip


I created a very simple project with a single grid and one element which is the scichart. Everything renders normally when the program first starts. If I make the window smaller vertically by dragging, everything continues to render correctly, but when I increase the height of the window by dragging, the vertical axis value label (4000.00) gets clipped if I go about 50 pixels more than the original window height specified.

Note: the clipping is all at once, if I go one pixel too far, the labels clip as shown. If I make the window one pixel smaller, they appear normally again.

What can I do?

Label Clipped

  • You must to post comments

Thanks for sending over a code sample Joseph. We investigated briefly and yes, we saw the clipping issue you talked about, but no we don’t know why its happening. All the usual culprits (setting ClipToBounds) turned up empty.

And then I found this Why do my panels clip all the way around the panel when made smaller than the explicit size

Turns out that WPF returns a clip geometry when a control is resized smaller than a certain threshold. There is a blog post on it here called Clip To Bounds Maybe.

The solution apparently is to modify the return value of GetLayoutClip() for all derived controls of FrameworkElement to this:

// For any FrameworkElement, e.g. Panel, Grid ... 
protected override Geometry GetLayoutClip(Size layoutSlotSize)
    return ClipToBounds ? base.GetLayoutClip(layoutSlotSize) : null;

This is a big task for us to do throughout Scichart as you can understand, so I’d ask, how serious is this issue? 🙂

Best regards,

  • Joseph Zarycki
    I don't think it is that serious, plus we have a work-around. It is great to know this though :) Thank you!
  • 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