Hi all, I'm looking for some ideas with my AngularJS application which currently uses flot charts.
I wanted to add the flot.time plugin to the project but have been unsuccessful with the aforementioned error message produced in console.
If I use mode: categories instead of time, the chart draws fine but obviously the timestamps aren't formatted, so the chart looks a bit ugly. Hence I went looking for a plugin precisely like flot.time.
Having carefully stepped through instructions and still coming up with the error, I'm hoping someone here might be able to help me.
<script language="javascript" type="text/javascript" src="scripts/jquery.js"></script>
<script language="javascript" type="text/javascript" src="scripts/jquery.flot.js"></script>
<script language="javascript" type="text/javascript" src="scripts/jquery.flot.time.js"> </script>
<script src="bower_components/angular-flot/angular-flot.js"></script>
Included in my index.html I have something that looks like this.
In my controller javascript, I set up the graph with time as the mode for the x axis like so:
$scope.options = {
series: {
lines: {
show: true,
lineWidth: 2,
fill: true,
fillColor: {
colors: [{
opacity: 0.0
}, {
opacity: 0.2
}]
}
},
points: {
radius: 5,
show: true
},
shadowSize: 2
},
grid: {
color: "#fff",
hoverable: true,
clickable: true,
tickColor: "#f0f0f0",
borderWidth: 0
},
colors: ["#5dcff3"],
xaxis: {
//mode: "categories",
mode: "time",
tickDecimals: 0
},
yaxis: {
ticks: 5,
tickDecimals: 0
},
tooltip: true,
tooltipOpts: {
content: "%x.1 is %y.4",
defaultTheme: false,
shifts: {
x: 0,
y: 20
}
}
};
$scope.graphLoading = false;
}
But I'm at a loose end now, hoping for any little tips, pointers, checks that could help me understand why flot.time isn't being recognized.
The full error in console is: