Jump to content
Software FX Community

cursor position of data point in xy plot


User (Legacy)
 Share

Recommended Posts

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

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

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

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

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...