Jump to content
Software FX Community

PaintInfo and CPI_PIXELTOVALUE


User (Legacy)

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...