Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First of all, your html is quite messy, here are a few things:</p> <ol> <li>Every <code>div</code> or almost any other html tag should reside inside the <code>body</code> tag.</li> <li>You should load the scripts inside the <code>head</code> tag or at the end of the <code>body</code> tag.</li> <li>You should wait until the DOM is ready to create the chart or do any other javascript work.</li> <li>You need <code>jQuery</code> in order to make <code>$('#container')</code> work.</li> <li><code>div</code> elements as <code>container</code> must be closed.</li> <li>You shouldn't add <code>css</code> styles to a html element directly. Instead do it in a separate file (something like <code>styles.css</code>). </li> <li>There's no need for your <code>script</code> to be inside a <code>div</code>, you could get rid of it.</li> </ol> <p>Here is a code that should do what you want:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="http://code.highcharts.com/highcharts.js"&gt;&lt;/script&gt; &lt;script src="http://code.highcharts.com/modules/exporting.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="container" style="min-width: 300px; height: 300px; margin: 1em"&gt; &lt;/div&gt; &lt;script type="text/javascript"&gt; {% autoescape off %} $(document).ready(function(){ $('#container').highcharts({ xAxis: { categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] }, series: [{ data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4] }] }); }); {% endautoescape %} &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>For more information about html/css standards check <a href="http://google%C2%ADstyleguide.googlecode.com/svn/trunk/htmlcssguide.xml">this link</a> from google.</p> <p>Also, since you are working with django, you need to be aware of template inheritance. If the above code doesn't work, share more code and/or errors information.</p>
    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.
    1. This table or related slice is empty.
    1. VO
      singulars
      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