Jump to content
Software FX Community

PaintInfo and CPI_PIXELTOVALUE


User (Legacy)
 Share

Recommended Posts

Hi All,

(ChartFX IE5.5)

I need to get the position of cursor as "value".

I write the following code. It works well for y but not for x.

I have used PaintInfo because PixelToValue can't be used in javascript but

the documentation says that CPI_PIXELTOVALUE is obsolete and there is no

documentation about it.

<SCRIPT LANGUAGE="JavaScript" FOR="ChartFX1" EVENT="LButtonDblClk(x, y,

nSerie, nPoint, nRes)">

var lX

var lY

var temp = ChartFX1.PaintInfo(5, CHART_ML(x, y))

lX = CHART_LOWORD(temp);

lY = CHART_HIWORD(temp);

alert(lX + " " + lY)

</SCRIPT>

Can anyone help me please?

Gianluca

Link to comment
Share on other sites

When you use PaintInfo with CPI_PIXELTOVALUE we return a double with the

value of the specified pixel in the "current" axis (default is Y axis), so

your code needs to be something like

<SCRIPT LANGUAGE="JavaScript" FOR="ChartFX1" EVENT="LButtonDblClk(x, y,

nSerie, nPoint, nRes)">

<!--

var yValue = ChartFX1.PaintInfo(5, CHART_ML(x, y))

ChartFX1.CurrentAxis = 2

var xValue = ChartFX1.PaintInfo(5, CHART_ML(x, y))

ChartFX1.CurrentAxis = 0

alert(xValue + " , " + yValue)

-->

</SCRIPT>

--

Regards,

JC

Software FX Support

"Gianluca" <gianluca.maggio@cezannesw.com> wrote in message

news:nXqjEOb3CHA.1844@webserver1.softwarefx.com...

> Hi All,

>

> (ChartFX IE5.5)

>

> I need to get the position of cursor as "value".

> I write the following code. It works well for y but not for x.

>

> I have used PaintInfo because PixelToValue can't be used in javascript but

> the documentation says that CPI_PIXELTOVALUE is obsolete and there is no

> documentation about it.

>

> <SCRIPT LANGUAGE="JavaScript" FOR="ChartFX1" EVENT="LButtonDblClk(x, y,

> nSerie, nPoint, nRes)">

> var lX

> var lY

> var temp = ChartFX1.PaintInfo(5, CHART_ML(x, y))

> lX = CHART_LOWORD(temp);

> lY = CHART_HIWORD(temp);

> alert(lX + " " + lY)

> </SCRIPT>

>

> Can anyone help me please?

>

> Gianluca

>

>

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