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
645
Highlighting without Zooming
posted

What I'd like to be able to do with the xamDataChart is highlight a section within the currently visible region of the chart and NOT zoom to that region automatically.

The goal is to allow the user to highlight a section and create, say, a vertical infostrip using the coordinates of the data.

 

For instance, the chart shows an scatterlineseries of sales over time.  I'd like the user to be able to highlight an area where the series dips down or spikes or is flat for a time and then create an infostrip with an explanation (e.g., Spike in sales due to reason X).

 

It doesn't seem like I have the ability to just highlight via the mouse click and drag without zooming. 

Any ideas how to accomplish this?

 

Thanks,

Matt

Parents
  • 645
    Suggested Answer
    posted

    I think the solution is to attach a Behavior to the XamDataChart and then handle the PreviewMouseLeftButtonDown, MouseMove and MouseLeftButtonUp events.

    Along with that, there's got to be some sort of "indicator" that I'm wanting to draw the region rather than zoom.

    I can check for a Keyboard.Modifier such as the Ctrl key being pressed on the PreviewMouseLeftButtonDown event and then switch into "draw a region" mode if that's pressed.

    Then to draw the region I can grab the geometry during the three events and make a Path object that is drawn in some highlighting color.

     

    Not sure how to create an InfoStrip on the fly though.  All the examples look like they are static things.

     

Reply Children