R
R
rinatoptimus2015-11-25 16:25:31
JavaScript
rinatoptimus, 2015-11-25 16:25:31

Why is chart not displayed in d3.js?

There is a JSON file from which a table is generated on the page, and under it a pie chart is generated from the same file.
Everything worked until I applied require.js.
Now, when reloading the page, either the file responsible for the hover effect does not work, or it works, but the pie chart is not displayed.
Plunker displays only a table, pie chart is not displayed for some reason:
plnkr.co/edit/l8zFmbryYNwR01thEVFD?p=preview

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Zuev, 2015-11-25
@rinatoptimus

The define method has the following syntax:
moduleName - module name (optional parameter)
dependencies - array of dependencies (with other modules)
callback - module body where dependencies are passed
Now apply to your code

define('tr-color-switcher', function () {
  $('div').on('mouseover', 'tr', function(){
      $( this ).addClass( "yellow-row" );
  });

Where to get $?
plnkr.co/edit/tbm1ggJgUoLBHtTKMAn7?p=preview

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question