Sign in to follow this  
solucionar_tasker

How to remove a Node from DragNode Chart

Recommended Posts

Hi,

 

I have a problema with my DragNode Chart. I have to remove an node, from the dataset and from the chart visualy.

 

I just try clone de object returned by .setJSONDATA(), later i try remove the index and later i try update de JSON using .setJSONDATA.

This code is called into a FC_ChartUpdated.

 

Look an example for this code:

 

function FC_ChartUpdated(chartId, dataIndex, datasetIndex){

if(remove){ //seted for other function

chartJSONData = jQuery.extend(true, {}, FusionCharts(chartId).getJSONData());

chartJSONData.dataset[datasetIndex-1].data.splice(dataIndex-1,1);

FusionCharts(chartId).setJSONData(chartJSONData);

}

}

 

This works fine if i NOT DRAG any node before this i want remove. Exemple:

If i drag the node 'A1', and remove this node. The chart works fine.

But, if i drag the node 'A2', and later i drag the node 'A1' and try remove him, the chart rendered the node 'A2' (and the others) for the wrong coordinate X and Y.

 

Exists an method of remove only one node per time?

 

Thank you

Share this post


Link to post
Share on other sites

Hi,

 

We tried to create a sample and deleted a node by clicking on it. We also dragged one node and deleted the other. We found that correct node is getting deleted and also the co-ordinates for the other nodes remains the same.  Please find an attached sample that we used for testing.

 

Could you please modify the sample according to your implementation details and attach it again, so that we can check the problem at our end?

 

Awaiting your response.

DragNodeJSON.zip

Share this post


Link to post
Share on other sites
Hi, 
 
Thanks for you answer.
 
I found the problem. :)
 
In my chart i use this parameter:
   "inThousandSeparator": "."
 
Look my example in annex.
 
For now, i don't need to use this option, so, i will withdraw of my code.

Ps: just for know, i printed my chart for you see how i use him in my system.
 
Thank you for attention,

 

DragNodeJSON.zip

post-59989-0-87375800-1392399581_thumb.png

Share this post


Link to post
Share on other sites
For testing:

 

1º Drag one node for inside of Delete area and drop the node in there.

     Result: the node will be removed.

 

2º Drag one node on the chart, then, drag other NODE for inside of Delete area.

    Result: the nodes will be changed of position.

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
Sign in to follow this