Jump to content
JChartFX Community
  • 0

jQuery Attach Event


Onofrio Comes

Question

Hello,
we are considering the possibility to switch to the HTML5 version of ChartFX - jChartFx.

In the tests which we are developing we find some difficulty to understand how to attach events using jquery.

Reading the documentation: http://www.jchartfx.com/api/search/on#Chart it is not clear which object attach events using jquery.

How do I hang on the MouseDown event?

This is an example that we can not run http://jsfiddle.net/x2U2V/6/

post-2107-13939743544254_thumb.png

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

We only attach ourselves to the jquery click event to push properties such as series, point, etc. If you are handling MouseDown you could call

 chart1.detectEvent(evt)

where evt is the event argument passed to the event handler, after this call your code can query for evt.hitType, evt.series, evt.point, etc.

Note that to invoke the method on a mousedown handler when using jQueryUI you would need something like this in your jsfiddle sample

$("div", ".ChartDiv1").on("mousedown",function doClick(evt){

                $("div", ".ChartDiv1").chart("detectEvent", evt);

if ((evt.hitType == cfx.HitType.Point) || (evt.hitType == cfx.HitType.Between))

               alert(evt.point);

            }) 

JuanC 

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
Answer this question...

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