Moved legend place in term-plot-top

This commit is contained in:
Mokaddem 2016-08-23 10:16:33 +02:00
parent 697812dbff
commit 32dfd2b181

View file

@ -293,17 +293,22 @@ var graph_options = {
tickColor: "#f9f9f9", tickColor: "#f9f9f9",
borderWidth: 0 borderWidth: 0
}, },
legend: { show: true,
noColumns: 0,
position: "nw"
},
xaxis: { xaxis: {
mode: "time", mode: "time",
timeformat: "%m/%d", timeformat: "%m/%d",
minTickSize: [1, "day"] minTickSize: [1, "day"]
}, },
yaxis: { yaxis: {
//transform: function (v) { return v < 1 ? v : Math.log(v); }
autoscaleMargin: 0.1, autoscaleMargin: 0.1,
}, },
tooltip: true, tooltip: true,
tooltipOpts: { tooltipOpts: {
content: "%s (%x.1 is %y.4)", content: " %s (%x.1 is %y.4) ",
shifts: { shifts: {
x: -60, x: -60,
y: 25 y: 25
@ -323,7 +328,6 @@ var plot_month;
var promises = []; // Used to know when everything has been received var promises = []; // Used to know when everything has been received
promises.push($.getJSON("{{ url_for('terms_plot_top_data') }}", { set: set_today, num_day: 5 }, function(data, status){ promises.push($.getJSON("{{ url_for('terms_plot_top_data') }}", { set: set_today, num_day: 5 }, function(data, status){
console.log(data);
data.sort(function(a, b){return b[2]-a[2];}); data.sort(function(a, b){return b[2]-a[2];});
// Sort data // Sort data
var table_today = $("#table-today") var table_today = $("#table-today")
@ -335,7 +339,6 @@ promises.push($.getJSON("{{ url_for('terms_plot_top_data') }}", { set: set_today
curr_data.push([data[i][1][j][0]*1000, data[i][1][j][1]]); curr_data.push([data[i][1][j][0]*1000, data[i][1][j][1]]);
} }
to_plot.push({ data: curr_data, label: data[i][0]}); to_plot.push({ data: curr_data, label: data[i][0]});
console.log(to_plot);
if ( i < (data.length/2)) if ( i < (data.length/2))
table_today.append("<tr><td>"+data[i][0]+"</td><td>"+data[i][2]+"</td><td>"+addbuttons(data[i][0])+"</td><td>"+addcheckbox("today", data[i][0])+"</td></tr>") table_today.append("<tr><td>"+data[i][0]+"</td><td>"+data[i][2]+"</td><td>"+addbuttons(data[i][0])+"</td><td>"+addcheckbox("today", data[i][0])+"</td></tr>")
else else