d3pie
d3pie copied to clipboard
I cannot get this to work.
Hello. I installed the files but I keep getting this error in the console:
d3pie.min.js:8 d3pie error: the first d3pie() param must be a valid DOM element (not jQuery) or a ID string.
More information about your code would be welcome.
Please instatiate your pie like this:
<div id="myDivId">
var containerId = "myDivId"; // note the missing **hashtag**
var configObject = {
...
}
window.pie = new d3pie(containerId, configObject);
if you are passing a jquery object, pass the dom element instead e.g.:
var jqContainer = $('#div');
var domContainer = $('#div')[0];
var domContainerClassic = document.getElementById('myDivId');
If you are using JQuery you should at the very least get familiar with what it does for you. The error message could not have been more clear in this case.