Reputation: 310
<script type="text/javascript">
$(function () {
var plot = $.plot($("#content"), [{
color: '#6B6B84',
label: 'normal one',
data: [
[
[10, 0],
[13, 5]
]
]
}, {
color: '23641E',
label: 'modified',
data:
}], {
xaxis: {
mode: "time",
timeformat: "%d/%m/%y"
},
grid: {
hoverable: true,
autoHighlight: true
}
});
});
</script>
The above code is showing "Uncaught Reference Error: Unexpected Token }" in Chrome. I have defined a div element with id=content. The above code is to draw graph using "Flot". Would greatly appreciate you guyz help here! I am using django here.
Upvotes: 0
Views: 245
Reputation: 28554
I've reformatted your code to make it easier to read. You can now see the second data:
element has no value, which is the source of your error.
$(function() {
var plot = $.plot($("#content"), [
{
color:'#6B6B84',
label:'normal one',
data: [
[[10, 0], [13, 5]]
]
},
{
color:'23641E',
label: 'modified',
data:
}
],
{
xaxis: {
mode:"time",
timeformat: "%d/%m/%y"
},
grid: {
hoverable: true,
autoHighlight: true
}
}
);
});
Upvotes: 3