How to observe changes to PanOffset and Zoom?

3 posts, 0 answers
  1. coldacid
    coldacid avatar
    9 posts
    Member since:
    Apr 2012

    Posted 25 Jun 2012 Link to this post

    I noticed there are no events on RadChart for when the PanOffset and Zoom properties change. However, I need to be able to observe these properties in order to know what points are visible, and customize one of my chart axes based on that. (Think semantic zoom.)

    What would be the best way to be notified of changes to these properties?
  2. coldacid
    coldacid avatar
    9 posts
    Member since:
    Apr 2012

    Posted 26 Jun 2012 Link to this post

    I figured it out. I used the AttachedDependencyProperty class by Clifford Nelson to catch changes to RadChartBase.Zoom. Then in the event handler, I used FindFirstLastVisiblePoints from this thread to determine the range of points. From there it was simple to set the appropriate axis settings to have the level of detail I wanted.
  3. DevCraft banner
  4. coldacid
    coldacid avatar
    9 posts
    Member since:
    Apr 2012

    Posted 26 Jun 2012 Link to this post

    Okay, that didn't work as planned. What I really need to do is convert the value of Zoom.Width into a TimeSpan, so I know how best to change my axis. Converting PanOffset to a DateTime would be good, too.
Back to Top