shawnc

Get x and y position of node after it's been moved

Recommended Posts

I move a node from a type: "dragnode" FusionCharts (Javascript).

I need to know the x and y position the node has been moved to in order to save that position into my database.

I run this code to get pos of my nodes:
    
       //Get a reference to our chart
       var ourChart = FusionCharts("testNodeChart");

      //Get the data from chart
      var jsonRtn = ourChart.getJSONData();

      //Show it to user in alert box.
      alert(JSON.stringify(jsonRtn));


Result:
pos of x and y shows for my node:  x = 1200, y = 1200


Then, I move the node and run the above code again.
Same results…. pos of x and y shows for my node:  x = 1200, y = 1200

 

-----------

I also tried:

ourChart.getNodeAttribute("21").x

But I get error:  TypeError: ourChart.getNodeAttribute is not a function

-----------

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now