var display = $('<div id="chartContainer" style="height: 300px; width: 100%;" onload="data();">'); // Here I have an onload event to trigger the data() function once the pieChart selector is clicked. It should then display the data stored in the data() function
console.log(newState); // to the screen inside the chartContainer div.
newState.css({
'top': e.pageY,
'left': e.pageX
});
newState.append(display);
$('#designTab').append(newState); // newState is appended to #designTab
i++;
/*jsPlumb.draggable(newState, {
containment: 'parent'
});*/
$(newState).draggable({
containment: 'parent'
});
newState.click(function(e) {
//jsPlumb.detachAllConnections($(this));
$(this).remove();
e.stopPropagation();
i--;
});
});
});
// The javascript for the data function which is held on the page where the graph will be generated once the newState variable creates the div and appends it to the #designTab. Hope this helps to help you understand and make sense of it so I can move forward on this one.