User (Legacy) Posted May 10, 2002 Report Share Posted May 10, 2002 Hi: I have multiple series in XY plot. I was wondering how can I get the cooresponding cursor information for each data point in every series without moving mouse? So I can set mouse to a specific position that is associated with a data point when user want to. For example, the cursor was required to set to the position that has the largest Y value in the series at the beginning. Thanks in advance. Danqing Link to comment Share on other sites More sharing options...
Software FX Posted May 10, 2002 Report Share Posted May 10, 2002 You can use PaintInfo with CPI_MARKERTOPIXEL to retrieve the pixel position of a marker. -- FP Software FX, Inc. Link to comment Share on other sites More sharing options...
User (Legacy) Posted May 13, 2002 Author Report Share Posted May 13, 2002 What kind of data type should I define for the vResult when I use the following method? vResult = (short) m_pChartFX->PaintInfo(CPI_MARKERTOPIXEL,(short) vData); I tried WORD type, but doesn't work. I also tried PaintInfo2 methods as follows. m_pChartFX->PaintInfo2(CPI_MARKERTOPIXEL, vData, (struct tagVARIANT *) vResult); I'm using VC++ environment. What's wrong with my code? "SoftwareFX Support" <support@softwarefx.com> wrote in message news:WV#kkjF#BHA.2736@webserver1.softwarefx.com... > You can use PaintInfo with CPI_MARKERTOPIXEL to retrieve the pixel position > of a marker. > > -- > FP > Software FX, Inc. > > Link to comment Share on other sites More sharing options...
Software FX Posted May 13, 2002 Report Share Posted May 13, 2002 From the help file: CPI_MARKERTOPIXEL Description Transform the correspondent nSerie-nPoint to coordinates relative to the chart window. Setting LOWORD = nSerie HIWORD = nPoint Return Value Setting nSerie to -1 will obtain center of that marker. LOWORD = X HIWORD =Y In other words, your VARIANT needs to contain a 32-Bit integer in which the LOWORD is the series index and the HIWORD is the Point Index. The return value is another variant that also contains a 32-Bit integer containing the X-Coordinate in the LOWORD and the Y-Coordinate in the HIWORD. -- FP Software FX, Inc. Link to comment Share on other sites More sharing options...
User (Legacy) Posted May 13, 2002 Author Report Share Posted May 13, 2002 Still not working with the following code. It caused crashed of my program. void Test(int SeriesIndex, int nPoints) { DWORD vData,vResult; vData= MAKELONG(SeriesIndex, nPoints); vResult = (short) m_pChartFX->PaintInfo(CPI_MARKERTOPIXEL,(short) vData); } Any more suggestion? "SoftwareFX Support" <support@softwarefx.com> wrote in message news:qYyCXsq#BHA.812@webserver1.softwarefx.com... > From the help file: > > CPI_MARKERTOPIXEL > Description Transform the correspondent nSerie-nPoint to > coordinates relative to the chart window. > Setting LOWORD = nSerie HIWORD = nPoint > Return Value Setting nSerie to -1 will obtain center of that > marker. > LOWORD = X HIWORD =Y > > > In other words, your VARIANT needs to contain a 32-Bit integer in > which the LOWORD is the series index and the HIWORD is the Point Index. > > The return value is another variant that also contains a 32-Bit > integer containing the X-Coordinate in the LOWORD and the Y-Coordinate in > the HIWORD. > > > > > -- > FP > Software FX, Inc. > > Link to comment Share on other sites More sharing options...
Software FX Posted May 13, 2002 Report Share Posted May 13, 2002 Why are you casting vData to a short ? a short is a 16-Bit integer, you need a 32-Bit integer (long). -- FP Software FX, Inc. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.