Jump to content
Software FX Community

Where is PixelToValue API? and defect in ValueToPixel


ltang
 Share

Recommended Posts

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. 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...