Reputation: 45
I am using flot for a website that I am programming, and I'd like to get a threshold on my data in the line graph but it doesn't seem to be looking. Here is what it ends up looking like:
https://i.sstatic.net/gdhrn.png
I've looked on here for solutions but none of them seemed to work for me. I'm not sure why it is separating the data at this threshold rather than just coloring it differently. I tried removing certain parts of the code but nothing seemed to work. Any suggestions appreciated. Thank you!
EDIT: created jsfiddle of my problem http://jsfiddle.net/catbunny38/cyWrL/
please help
Upvotes: 2
Views: 345
Reputation: 17550
The problem here is the combination of the categories and threshold plugins. Maybe one of the authors will see this question and fix it.
For now you can fix it by removing the categories plugin and do the categories yourself (see this updated fiddle).
Change the data to something like this (easy when you prepare it with serverside code, I changed a few data points manually):
var durationList = [
[1, 48.02335029999415],
[2, 90.60945035338402],
[3, 90.89755993498696],
...
[14, 125.0502553939157],
[15, 7.444523153305053],
[16, 0.14131634639369117]
];
var tickList = [
[1, "1315"],
[2, "1336"],
[3, "1337"],
...
[14, "5406"],
[15, "7407"],
[16, "7410"]
];
And for the flot options:
xaxis: {
tickLength: 0,
ticks: tickList,
axisLabel: 'FW Release',
rotateTicks: 90
},
Upvotes: 3