personality-insights / sunburst-chart

A visualization for IBM Watson Personality Insights service output.
https://personality-insights.github.io/sunburst-chart/
Apache License 2.0
43 stars 37 forks source link

TypeError: Cannot set property 'innerHTML' of null #17

Closed inakineitor closed 7 years ago

inakineitor commented 7 years ago

I installed all the dependencies with 'npm install' and then compiled the library with 'npm run compile'. The problem is that when I run it in my webpage, I get this error: "TypeError: Cannot set property 'innerHTML' of null". According to the console the error originates in: document.querySelector(widgetId).innerHTML = null; //Line 483

aprilwebster commented 7 years ago

@inakineitor It looks like the element referred to by widgetId can't be found. Did you specify the selector for the element that should contain the sunburst chart when you instantiate PersonalitySunburstChart? For example, if the element with id sunburstChart should contain the viz, then you'd need to specify that when you create the chart: var chart = new PersonalitySunburstChart({'selector': '#sunburstChart'});

inakineitor commented 7 years ago

Thank you, the problem was that the tutorial has not been updated and the new version uses a '#' before the selection name.