d3pie icon indicating copy to clipboard operation
d3pie copied to clipboard

I cannot get this to work.

Open lstasio5 opened this issue 6 years ago • 1 comments

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.

lstasio5 avatar Mar 06 '19 11:03 lstasio5

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.

Toastgeraet avatar Mar 28 '19 11:03 Toastgeraet