Sign in to follow this  
Pallav

Drag Node chart - Connector properties

Recommended Posts

Hi,

I'm using drag node chart and i'm creating nodes and connectors dynamically (by click on "Add Node" and "Add connectors" popup menu options).

I'm providing functionality to save the save, for that i'm getting the chart data using chart.getXMLData method.

While creating the chart again using this returned XML (using chat.setDataXML method), arrows are displayed at the both the ends (while creating i'm selected arrowAtEnd). It seems the returned XML, for connectors element, arrowAtStart and arrowAtEnd attributes are not included and hence it is displaying chart's default connector values for these two.

See below images, before and after

 a0d724d2-ccd3-441b-b397-59e1.GIF

a66f7a17-1eda-428e-be2d-0458.GIF

and here is my javascript used to redraw the chart

function test()

{

var chart = getChartFromId('seqChart');

if (chart != null)

{

var xml = chart.getXMLData();

chart.setDataXML(xml);

//chart.render("chartDiv");

}

}

Share this post


Link to post
Share on other sites

Hi,

 

 

 

In the getXML(), we primarily return the new data for the chart (new nodes/modified nodes). We do not add any cosmetic attributes as such.

Share this post


Link to post
Share on other sites

Hello,

I was trying to access the same method chart.getXMLData(), but was getting the error stating that the object doesnt support this method. Following is the code

<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>FusionCharts v3 Documentation</title>

<link rel="stylesheet" href="../Contents/Style.css" type="text/css" />

<script language="JavaScript" src="../JSClass/FusionCharts.js"></script>

</head>

<body>

<table width="98%" border="0" cellspacing="0" cellpadding="3" align="center">

  <tr>

  <td valign="top" class="text" align="center"> <div id="chartdiv" align="center">

  FusionCharts. </div>

  <script type="text/javascript">

var chart = new FusionCharts("../Charts/DragNode.swf", "ChartId", "600", "550", "0", "0");

chart.setDataURL("Data/DragNode3.xml");

chart.render("chartdiv");

</script> </td>

  </tr>

  <tr>

  <td valign="top" class="text" align="center"> </td>

  </tr>

  <tr>

  <td valign="top" class="text" align="center"><a href="Data/DragNode3.xml" target="_blank"><img src="../Contents/Images/BtnViewXML.gif" alt="View XML for the above chart" width="75" height="25" border="0" /></a></td>

  <td valign="top" class="text" align="center"><input type="button" value="click here" onclick="getXML()"/></td>

  </tr>

</table>

</body>

<script type="text/javascript">

function getXML(){

 //Get a reference to our chart

 var ourChart = getChartFromId("ChartId");

 //Get the data from chart

 var xmlRtn = ourChart.getSWFHTML();

 //Show it to user in alert box.

 alert(xmlRtn);

}

</script>

</html>

 

Please let me know incase I am missing out on something

Share this post


Link to post
Share on other sites

Hi,

 
Could you please just change the following line of your code and try again?
 
var chart = new FusionCharts("../Charts/DragNode.swf", "ChartId", "600", "550", "0", "1");

Share this post


Link to post
Share on other sites

I tried with even 1 option but it isnt working. I even put on the debug mode, where i can view the XML data and have even the set the settings as mentioned in the earlier link, but still says that the object doesnt support this method.

var chart = new FusionCharts("../Charts/DragNode.swf", "ChartId", "600", "550", "1", "1");

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