03-29-2016 06:07 AM
I can't find any explicit methods to get bounds of PlotArea and axes.
Please let me know of workarounds if available. Actually a post says how to get bounds of PlotArea by using RangeCursor. Is there alternative way for Axes?
The below picture shows what I did in WinForms with HitTest and GetBounds methods. I would like to draw adorners on WPF Graph.
Solved! Go to Solution.
03-29-2016 05:20 PM
The graph and its parts follow the WPF idiom of avoiding explicit bounds and positions for its parts, relying instead on the standard layout mechanism to position content based on size.
Depending on what you are trying to accomplish, different workarounds may be appropriate. Do you just want to show an outline around the different parts, or do you expect to move and reposition elements (based on the drag handles in your Windows Forms screenshot)?
03-29-2016 06:54 PM
03-30-2016 02:30 PM
I've attached a code example that showing adorners around the plot area and scales.
Note that this relies on implementation details of the current release of the WPF controls for the scale adorners, as it was more efficient than incrementally hit testing points within the graph using the GetScaleAt
method. We intentionally left many of the underlying primitive types with minimal documentation, as we have changed them in the past and may change them again in the future. Although these exact members may be removed in a later release, we do plan to provide equivalent functionality and stabilize the primitive API over time.
03-30-2016 11:39 PM
Great. Many thanks.
I updated the MeasurementStudio to its latest version and copied your code and finally I can show adorners for plotarea and axes.