Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Chart Control
  New Posts New Posts RSS Feed - Mouse location to graph scale
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Mouse location to graph scale

 Post Reply Post Reply
Author
Message
BLW View Drop Down
Groupie
Groupie


Joined: 20 June 2013
Location: Florida, USA
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote BLW Quote  Post ReplyReply Direct Link To This Post Topic: Mouse location to graph scale
    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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.