javascript - C3 js Cannot read property 'width' of undefined -


For the first time I am trying to set up C3 charts.

I get an example of their official website and the following HTML:

  & lt; Section class = "panel-panel-default" & gt; & Lt; Header class = "panel-title font-bold" & gt; C3 Test & lt; / Header & gt; & Lt; Section class = "panel-entity" & gt; & Lt; Div id = "chart" & gt; & Lt; / Div & gt; & Lt; / Section & gt; & Lt; / Section & gt;  

For this, I have the following javascript:

  var chart = c3.generate ({byte: '#chart', data: {column: [ ['Data1', 30, 200, 100, 400, 150, 250], ['data2', 50, 20, 10, 40, 15, 25]], axis: {data2: 'y2'}, type: { Data:: 'Format: D3 format ("$,') / 2: 'bar'}}, axis: {y: {label: {text: 'label': '', labeled '' position: 'external-medium'} / ADD}}, Y2: {show: true, label: {text: 'labels Y2', position: 'external-medium'}}}});  

However, when I run it, I get the following error:

  Unkit type error: the property 'width' of the undefined c3.min.js Can not read: 3  

Do anyone know what the problem might be?

OK I got the answer

Useful As you have to wait for the document to load or to work, the script needs to be loaded under your page.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -