veena Posted July 20, 2010 Report Share Posted July 20, 2010 How to find the position of a point (pixel possition in graph) in java, if x and y values are given ? I need to attach images using annotation. For that top and left positions need to be given. These images should be at the end of Gannt bar according to the X values. So its left position is dynamic. Please help me in finding this. Thanks in advance. Quote Link to comment Share on other sites More sharing options...
RandyJ Posted July 30, 2010 Report Share Posted July 30, 2010 Hi, You can use the valueToPixel method. This method convert a logical chart value to its position in pixels for a selected axis. chart1.getAxisX().valueToPixel(double dValue) When positioning annotation objects in the chart area, you may want to convert a particular position in the chart area given in axis units to screen coordinates (pixels). Therefore, this method is particularly useful for this purpose. Regards, Randy Jimenez 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.