Your #sparkline
element is not loaded yet. Try this:
$(document).ready(function(){
$("#sparkline").sparkline([5,6,7,2,0,4,2,4], {
type: 'bar',
height: '300',
barWidth: 20,
barSpacing: 10,
barColor: '#615c5a',
nullColor: '#3366cc '});
});
Read this: http://api.jquery.com/ready/
Note that not all browsers likes this syntax: <div id ="sparkline" />
. Use this instead: <div id ="sparkline" ></div>
.
Update
I see you also forgot to include sparkline
js file. You need to download it from here and after that to upload it to your server and to include it like you have included jQuery js file:
<script src="//ajax.aspnetcdn.com/ajax/jQuery/jquery-1.10.1.min.js"></script>
<script src="jquery.sparkline.js"></script>