akhalik Report post Posted May 12, 2011 Hi, I am in evaluation process of Power Charts, currently I am on Drag Node and following are my queries; 1. How to retain the positions of nodes while I update the the dataset in JavaScript at runtime by updating. Eg. a) Drag Node chart is rendered Using mouse nodes are dragged here and there. c) On click of a node update the data set to add/delete the nodes Problem is that position of the nodes resets after step C, means effects of user's manual actions on chart disappear. 2. When I add a node with duplicate id a new node is generated, is there any way that only one node is added with same node Id. 3. How to add my own items to context menu and call JavaScript function from that? OR Can we disable context menu and implement the JavaScript function on right click of node. But in this case I should be able to Control (print, drag mode and link mode) by JavaScript. Looking for suggestions. Solution to these issues will decide if we can use this library. Thanks, A. Khalik Share this post Link to post Share on other sites
FusionCharts Support Report post Posted May 12, 2011 Hi, 1. How to retain the positions of nodes while I update the the dataset in JavaScript at runtime by updating.Eg. a ) Drag Node chart is rendered b ) Using mouse nodes are dragged here and there. c ) On click of a node update the data set to add/delete the nodes Problem is that position of the nodes resets after step C, means effects of user's manual actions on chart disappear. You can access the XML as per the interactive changes done manually through getXMLData() API. Please read http://www.fusioncharts.com/powercharts/docs/Contents/Dragnode/JSRead.html 2. When I add a node with duplicate id a new node is generated, is there any way that only one node is added with same node Id. I am afraid not as of now. 3. How to add my own items to context menu and call JavaScript function from that?OR Can we disable context menu and implement the JavaScript function on right click of node. But in this case I should be able to Control (print, drag mode and link mode) by JavaScript. You can add only one context menu item which is called about menu item. Please use these attribute to configure this: showAboutMenuItem='1' aboutMenuItemLabel='Context Menu Item' aboutMenuItemLink='javascript:yourfunction()' You can not disable context menu completely. Share this post Link to post Share on other sites
akhalik Report post Posted May 12, 2011 Thanks for replying, 1. Instead of getXMLData() I am using getJSONData(). Is there any difference? refer to following code snippet; /*do user ineraction call following javascript function */ var charRef = FusionCharts("myChartId"); // get chart var curJson = charRef.getJSONData(); // get latest json (I expect it should have effect of ineraction) // get the data array var curData = curJson.dataset[0].data; // add new node curData.push(eval("("+node json string+")"); curJson.dataset[0].data= curData; /* following to add connector*/ var connectors= curJson.connectors[0].connector connectors.push(eval("("+ connector json string +")"); curJson.connectors[0].connector = connectors; // set modified json back myChart.setJSONData(curJson); but interactive changes disappear. 2. any thought on using json or xml processing we can achieve elimination of duplicate nodes? 3. In context menu only one item that you mentioned will appear on every point of chart and same action will be called every time. I want to pass nodeid, and name to a java script function to be called from context menu on which clicks user right button. I hope my questions are more clear now. Thanks, A. Khalik Share this post Link to post Share on other sites
akhalik Report post Posted May 13, 2011 Could anyone reply on above doubts please. Thanks in advance Share this post Link to post Share on other sites