add nodes to google Organizational Chart

54 views
Skip to first unread message

ahmadtamimi

unread,
Jul 11, 2011, 7:25:52 AM7/11/11
to Google Visualization API
i create organization chart page usnig google Organizational Chart.

after writing node description in a textField and selecting parent
node from drop down list, i want to add the node to the chart,and
refresh the chart again, to contain the new node.
what is the best way to this?
thank you

asgallant

unread,
Jul 11, 2011, 8:58:01 AM7/11/11
to google-visua...@googlegroups.com
Until the new dashboard controls get finalized, probably the best way to handle this is to declare the dataTable as a global.  When you want to add a new node, append a new row to the table with the new data and call your draw function again.  Something like this, maybe?

var data = new google.visualization.dataTable();
// populate the data table

function drawTable() {
     // draw the table
}

function addNode() {
     // add a new node to data
     
     drawChart();
}
Reply all
Reply to author
Forward
0 new messages