ltang Posted March 14, 2008 Report Share Posted March 14, 2008 Based on the observation that AxisX and AxisY are of the same class and PixelValue works for Y but not X, I found out that it seems the Coordinate Translation in the API did notoffset Axis's Drawing Area. AxisX is as default drawn at the bottom and with respect to the ABSOLUTE Coordinate, the offset is Zero in the Coordinate Translation calculation of Y. However the bug shows up on AxisX.PixelToValue because AxisY, as default, drawn on the left, which means the offset is NOT zero.By setting YAxis's visibility to hidden (therefore Offset is zero), I can get AxisX.PixelToValue return expected value. Quote Link to comment Share on other sites More sharing options...
JuanC Posted March 17, 2008 Report Share Posted March 17, 2008 Both PixelToValue and ValueToPixel handle coordinates relative to the plot area and not the chart, i.e. 0 is the top-left corner of the plot area and not the chart. This is because these methods are typically used to paint additional elements in the plot area. I am guessing you are handling the chart's MouseMove event so you have "chart-based" coordinates. We have a method called HitTest that expects a point and returns information about it, e.g. if the point is over a marker it will return the Series and PointIndex along with the business object associated to this marker. We have added a couple of member to the HitTestResults structure to let you know if the point in question is inside a plot area and its relative position. Note that in a multi-pane chart there are several plot areas. Regards, JuanC Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.