Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
40
Support for selecting and highlighting chart regions
posted

We would like to adapt the xamDataChart control so that the user can highlight regions of the chart. In some kind the function is similar to the zoom / pan function, but instead of panning / zooming the selected region should be shown a little different (e.g. alpha-blended). The function should allow to select a specific region of the X-Axis, Y-Axis selection is not needed so the whole height of the plot can be used.

After looking at the source I think that re-using the zoom / pan thing would not be the best way and instead developing something new here is the better way.  My plan is:

  • Adding a path which represents the selected are
  • Registering for MouseLeftButtonDown, MouseMove and MouseLeftButtonUp which trigger the selection
  • Updating the added path upon a mouve move
  • Calling a custom event handler after the selection is finished

Now I have some questions:

  1. How do get access to the PlotAreaBorder from outside. Is the PlotAreaBackgroundContent right?
  2. How do I get the dimensions of the plot. Again: Is PlotAreaBackgroundContent right?
  3. How do I highlight the selected region afterwards. I thought about re-using the info-strips from the samples but these are in the background (meaning that the plot is in front of it). Or would I need to add a custom UI element such as a path which is used for the highlighting?

Kind regards

Parents Reply Children
No Data