Note that there are some explanatory texts on larger screens.

plurals
  1. POLoading 'theme' and 'exporting' module with Highcharts using Requirejs
    primarykey
    data
    text
    <p>I have tried several different configurations of my paths and shim attributes in my requirejs.config function but none seem to load my gray.js theme and the exporting.js module. Currently I have:</p> <pre><code>requirejs.config({ baseUrl: 'static/js', paths: { 'jquery' : 'jquery-1.7.2.min', 'highcharts' : ['HighCharts/highcharts', 'HighCharts/themes/gray', 'HighCharts/modules/exporting'] }, shim: { 'highcharts': { 'exports': 'Highcharts', 'deps': ['jquery'] } } }); </code></pre> <p>What am I doing wrong? I can't break gray.js and exporting.js out into their own paths and add them to the highcharts shim as deps because they rely on highcharts.</p> <p>I am thinking about making the 'highcharts' shortcut in paths point to exporting.js and make gray.js and highcharts.js deps of it, but this seems a little confusing. Like the following. Thoughts?</p> <pre><code>requirejs.config({ baseUrl: 'static/js', paths: { 'jquery' : 'jquery-1.7.2.min', 'highcharts' : 'HighCharts/modules/exporting', 'highcharts-theme': 'HighCharts/themes/gray', 'highcharts-module': 'HighCharts/highcharts' }, shim: { 'highcharts-module': { 'exports': 'Highcharts', 'deps': ['jquery'] }, 'highcharts': { 'deps': ['highcharts-module', 'highcharts-theme'] } } }); </code></pre> <h2>UPDATE:</h2> <p>My page html (abbreviated):</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html lang="en-us" &gt; &lt;head&gt; &lt;script src="/static/js/require.js" type='text/javascript'&gt;&lt;/script&gt; &lt;script src="/static/js/requirejs.config.js" type='text/javascript'&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="#myChart"&gt;&lt;/div&gt; &lt;script type="text/javascript"&gt; require(['jquery','domReady', 'highcharts'], function($, domReady, Highcharts){ domReady(function(){ //Stuff to draw Chart here }); }); &lt;/script&gt; &lt;/body&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload