Print Page | Close Window

Mouse location to graph scale

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Chart Control
Forum Description: Topics Related to Codejock Chart Control
URL: http://forum.codejock.com/forum_posts.asp?TID=21729
Printed Date: 29 April 2024 at 12:31am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Mouse location to graph scale
Posted By: BLW
Subject: Mouse location to graph scale
Date Posted: 20 June 2013 at 10:10am
Hi, I'm trying to develop a drag-drop concept with a bar chart.  We have a threshold parameter that we plot on the graph along with results.  The idea is to allow the user to "grab" the threshold and drag it to a new setting directly on the graph.
 
I have figured out most of the steps involved.  But I have not been able to locate a conversion between a mouse location on the screen and an X-Y graph scale value.  I'm using "HitTest()" to figure out which series and element is being pointed at.  But that isn't quite what I need.  I believe that I found some internal logic that might work (see specifics below), but I do not see how to get access to that information.
 
In XTPChartStackedBarSeriesStyle.cpp, function GetScreenRect() they call a function GetScreenPoint() which converts a scaled XY value to image coordinates.  From that I could compute the scale and get the drag-drop logic to work.  But this is a Style operation and that appears to be dynamically created in OnPaint() and is not available to access.
 
What I really need is a function similar to HitTest() to get the conversion back and forth between a screen location and scales series value.

Thank you,
 
Brad



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net