Jump to content
Software FX Community

Call pixelToValue in javascript code


Recommended Posts

Hi,

I'm creating a SCATTER graph, that displays at the same time two series:

- the first one shows a static series with one-two thousand points

- the second one shows a line series with few points (max 10),

As two series must have the same point number (is it true ???), I hidden the

most points of second serie.

At the moment, the graph works fine; but I received a new requirements: add

new points runtime (client side) to extend

the line series. We support IE 5.0+ only.

Now the questions are:

1. Can I add new points at runtime using javascript (client side) ?

2. I need to detect (using user coordinate, not pixel) where the user click

to add a new point. The PixelToValue() method does not work in javascript

(all parameter are ByValue in javascript). How can I solve the problem ?

Does another compatible method exist ?

Thank for your patience.

Maurizio Romano

Embedded Software Development Engineer

Microsoft Certified Professional

C

Link to post
Share on other sites
  • 1 month later...

I have the same quesiton in regards to javascript, and byVal variables.  Any

thoughts how to get arround this limitation?

Maurizio, did anyone ever answer your question?

T. Phalp

"Maurizio" <maurizio.romano@cezannesw.com> wrote in message

news:5xRFAQ8jCHA.940@webserver1.softwarefx.com...

> Hi,

> I'm creating a SCATTER graph, that displays at the same time two series:

> - the first one shows a static series with one-two thousand points

> - the second one shows a line series with few points (max 10),

> As two series must have the same point number (is it true ???), I hidden

the

> most points of second serie.

> At the moment, the graph works fine; but I received a new requirements:

add

> new points runtime (client side) to extend

> the line series. We support IE 5.0+ only.

> Now the questions are:

>

> 1. Can I add new points at runtime using javascript (client side) ?

> 2. I need to detect (using user coordinate, not pixel) where the user

click

> to add a new point. The PixelToValue() method does not work in javascript

> (all parameter are ByValue in javascript). How can I solve the problem ?

> Does another compatible method exist ?

>

> Thank for your patience.

>

> Maurizio Romano

>

> Embedded Software Development Engineer

>

> Microsoft Certified Professional

>

> C

Link to post
Share on other sites

Instead of PixelToValue (or PixelToMarker) you will need to use the

PaintInfo method as follows (vbscript)

// CHART_ML creates a long (32bits) value based in two short (16bits) values

Function CHART_ML (wLow, wHi)

CHART_ML = CLng(&H10000 * wHi) + wLow

End Function

// CHART_HIWORD returns the high (16bits) short from a long (32bits) value

Function CHART_HIWORD (l)

CHART_HIWORD = CInt((l And &HFFFF0000) / &H10000)

End Function

// CHART_LOWORD returns the low (16bits) short from a long (32bits) value

Function CHART_LOWORD (l)

l2 = l And &HFFFF&

If (l2 > 32767) Then

l2 = l2 - 65536

End If

CHART_LOWORD = CInt(l2)

End Function

sub Chart_LButtonDown(x, y, nRes)

// Currentaxis property allows you to get the X-Axis value

// 5 indicates CPI_PixelToValue

Chart.currentaxis = 2

xValue = Chart.PaintInfo(5, CHART_ML(x, y))

// Currentaxis property allows you to get the Y-Axis value

// 5 indicates CPI_PixelToValue

Chart.currentaxis = 0

yValue = Chart.PaintInfo(5, CHART_ML(x, y))

MsgBox(CStr(xValue)+","+CStr(yValue))

// 2 indicates CPI_PixelToMarker

nMarker = Chart.PaintInfo(2, CHART_ML(x, y))

MsgBox(CStr(CHART_LOWORD(nMarker))+","+CStr(CHART_HIWORD(nMarker)))

end sub

--

Regards,

JC

Software FX Support

"Maurizio" <maurizio.romano@cezannesw.com> wrote in message

news:5xRFAQ8jCHA.940@webserver1.softwarefx.com...

> Hi,

> I'm creating a SCATTER graph, that displays at the same time two series:

> - the first one shows a static series with one-two thousand points

> - the second one shows a line series with few points (max 10),

> As two series must have the same point number (is it true ???), I hidden

the

> most points of second serie.

> At the moment, the graph works fine; but I received a new requirements:

add

> new points runtime (client side) to extend

> the line series. We support IE 5.0+ only.

> Now the questions are:

>

> 1. Can I add new points at runtime using javascript (client side) ?

> 2. I need to detect (using user coordinate, not pixel) where the user

click

> to add a new point. The PixelToValue() method does not work in javascript

> (all parameter are ByValue in javascript). How can I solve the problem ?

> Does another compatible method exist ?

>

> Thank for your patience.

>

> Maurizio Romano

>

> Embedded Software Development Engineer

>

> Microsoft Certified Professional

>

> C

Link to post
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.

Loading...
×
×
  • Create New...