SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components

0
0

I’m using a chart as a way to visualise a series of time-based tasks on a “timeline”, not unlike a Gantt chart (is there anything SciChart can’t be used for?!). I do this using annotations that the user can move and resize, actually custom “box” annotations that can only be dragged and resized horizontally. Image attached if interested.

When a user starts moving or resizing an annotation, I bring it to the front to ensure that it remains visible even if it ends up overlapping another annotation, using:

Panel.SetZIndex(annotation, Int.MaxValue);
For every other annotation
    Panel.SetZIndex(annotation, 0);

Finding this approach was a bit of a happy accident so I’m wary of continuing to use this technique in case it breaks in a future version. I’m assuming this code works because annotations reside in a parent container that inherits from Panel? Do you see any issues using the above or is there a “better” way to change an annotation’s Z-Index?

Version
6.5
Images
  • You must to post comments
1
0

Hello Andrew,

Thanks for your question.

Your approach is perfectly valid. Our Annotations are WPF UI elements placed on a Canvas, so this is the right way of doing that.

Best Regards,
Yuriy

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.