Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I cannot get this to work. #170

Open
lstasio5 opened this issue Mar 6, 2019 · 1 comment
Open

I cannot get this to work. #170

lstasio5 opened this issue Mar 6, 2019 · 1 comment

Comments

@lstasio5
Copy link

lstasio5 commented Mar 6, 2019

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.

@Toastgeraet
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants