add zoom graphs xy
This commit is contained in:
parent
58370449dd
commit
3accc31372
|
@ -1546,7 +1546,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
|
||||||
shadowSize: 0.1
|
shadowSize: 0.1
|
||||||
},
|
},
|
||||||
crosshair: { mode: 'xy' },
|
crosshair: { mode: 'xy' },
|
||||||
selection: { mode: 'x', color: '#777' },
|
selection: { mode: 'xy', color: '#777' },
|
||||||
export: {
|
export: {
|
||||||
export_data: true,
|
export_data: true,
|
||||||
labels_long: labels_long,
|
labels_long: labels_long,
|
||||||
|
@ -1640,7 +1640,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
|
||||||
color: ''
|
color: ''
|
||||||
} ],
|
} ],
|
||||||
yaxis: {ticks: [], autoscaleMargin: 0.1 },
|
yaxis: {ticks: [], autoscaleMargin: 0.1 },
|
||||||
selection: {mode: 'x', color: '#777' },
|
selection: {mode: 'xy', color: '#777' },
|
||||||
legend: {show: false},
|
legend: {show: false},
|
||||||
crosshair: {mode: 'x'}
|
crosshair: {mode: 'x'}
|
||||||
});
|
});
|
||||||
|
@ -1652,6 +1652,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
|
||||||
if (menu == 0) {
|
if (menu == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
dataInSelection = ranges.xaxis.to - ranges.xaxis.from;
|
dataInSelection = ranges.xaxis.to - ranges.xaxis.from;
|
||||||
dataInPlot = plot.getData()[0].data.length;
|
dataInPlot = plot.getData()[0].data.length;
|
||||||
|
|
||||||
|
@ -1660,18 +1661,36 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
|
||||||
new_steps = parseInt(factor * steps);
|
new_steps = parseInt(factor * steps);
|
||||||
|
|
||||||
plot = $.plot($('#' + graph_id), data_base,
|
plot = $.plot($('#' + graph_id), data_base,
|
||||||
$.extend(true, {}, options, {
|
$.extend(true, {}, options, {
|
||||||
xaxis: { min: ranges.xaxis.from, max: ranges.xaxis.to},
|
yaxis: {
|
||||||
xaxes: [ {
|
min: ranges.yaxis.from,
|
||||||
tickFormatter: xFormatter,
|
max: ranges.yaxis.to
|
||||||
minTickSize: new_steps,
|
},
|
||||||
color: ''
|
yaxes: [{
|
||||||
} ],
|
tickFormatter: yFormatter,
|
||||||
legend: { show: false }
|
color: '',
|
||||||
}));
|
alignTicksWithAxis: 1,
|
||||||
|
labelWidth: 30,
|
||||||
|
position: 'left',
|
||||||
|
font: font,
|
||||||
|
reserveSpace: true,
|
||||||
|
min: ranges.yaxis.from
|
||||||
|
}],
|
||||||
|
xaxis: {
|
||||||
|
min: ranges.xaxis.from,
|
||||||
|
max: ranges.xaxis.to
|
||||||
|
},
|
||||||
|
xaxes: [ {
|
||||||
|
tickFormatter: xFormatter,
|
||||||
|
minTickSize: new_steps,
|
||||||
|
color: ''
|
||||||
|
} ],
|
||||||
|
legend: { show: false }
|
||||||
|
}));
|
||||||
|
|
||||||
if (thresholded) {
|
if (thresholded) {
|
||||||
var zoom_data_threshold = new Array ();
|
var zoom_data_threshold = new Array ();
|
||||||
|
|
||||||
var y_recal = axis_thresholded(threshold_data, plot.getAxes().yaxis.min, plot.getAxes().yaxis.max,
|
var y_recal = axis_thresholded(threshold_data, plot.getAxes().yaxis.min, plot.getAxes().yaxis.max,
|
||||||
red_threshold, extremes, red_up);
|
red_threshold, extremes, red_up);
|
||||||
plot = $.plot($('#' + graph_id), data_base,
|
plot = $.plot($('#' + graph_id), data_base,
|
||||||
|
@ -1690,7 +1709,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
|
||||||
plot.setData(zoom_data_threshold);
|
plot.setData(zoom_data_threshold);
|
||||||
plot.draw();
|
plot.draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$('#menu_cancelzoom_' + graph_id)
|
$('#menu_cancelzoom_' + graph_id)
|
||||||
.attr('src', homeurl + '/images/zoom_cross_grey.png');
|
.attr('src', homeurl + '/images/zoom_cross_grey.png');
|
||||||
|
@ -1760,7 +1779,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
|
||||||
}
|
}
|
||||||
else if (y < -1000) {
|
else if (y < -1000) {
|
||||||
how_bigger = "K";
|
how_bigger = "K";
|
||||||
y = y / 1000;
|
y = y / 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentRanges == null || (currentRanges.xaxis.from < j && j < currentRanges.xaxis.to)) {
|
if (currentRanges == null || (currentRanges.xaxis.from < j && j < currentRanges.xaxis.to)) {
|
||||||
|
|
Loading…
Reference in New Issue