This is a migrated thread and some comments may be shown as answers.

How to observe changes to PanOffset and Zoom?

2 Answers 48 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
coldacid
Top achievements
Rank 1
coldacid asked on 26 Jun 2012, 02:37 AM
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 Answers, 1 is accepted

Sort by
0
coldacid
Top achievements
Rank 1
answered on 26 Jun 2012, 05:26 AM
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.
0
coldacid
Top achievements
Rank 1
answered on 26 Jun 2012, 07:31 AM
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.
Tags
Chart
Asked by
coldacid
Top achievements
Rank 1
Answers by
coldacid
Top achievements
Rank 1
Share this question
or