Merge commit '0fa11e0e673b3b37a8fbfb49e1de0f6842f3838e'

This commit is contained in:
Michal Čihař 2012-08-22 13:28:45 +02:00
commit 7ea30f9b6b

View File

@ -1086,6 +1086,27 @@ $(function() {
$.extend(true, settings, chartObj.settings);
}
var settings1 = {
axes: {
xaxis: {
renderer: $.jqplot.DateAxisRenderer,
tickOptions: {
formatString: '%H:%M:%S'
}
},
yaxis: {
autoscale:true,
label: PMA_messages['strTotalCount'],
labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
}
},
seriesDefaults: {
rendererOptions: {
smooth: true
}
}
};
if ($('#' + settings.chart.renderTo).length == 0) {
var numCharts = $('table#chartGrid .monitorChart').length;
@ -1096,7 +1117,8 @@ $(function() {
$('table#chartGrid tr:last').append('<td><div class="ui-state-default monitorChart" id="' + settings.chart.renderTo + '"></div></td>');
}
chartObj.chart = PMA_createChart(settings);
//chartObj.chart = PMA_createChart(settings);
chartObj.chart = $.jqplot(settings.chart.renderTo, [[0,0]], settings1);
chartObj.numPoints = 0;
if (initialize != true) {
@ -1230,8 +1252,7 @@ $(function() {
runtime.xmax += diff;
}
elem.chart.xAxis[0].setExtremes(runtime.xmin, runtime.xmax, false);
//elem.chart.xAxis[0].setExtremes(runtime.xmin, runtime.xmax, false);
/* Calculate y value */
// If transform function given, use it
@ -1262,19 +1283,25 @@ $(function() {
// Set y value, if defined
if (value != undefined) {
elem.chart.series[j].addPoint(
/*elem.chart.series[j].addPoint(
{ x: chartData.x, y: value },
false,
elem.numPoints >= runtime.gridMaxPoints
);
);*/
elem.chart.series[0].data.push([chartData.x, value]);
}
}
// update chart options
var interval = (((runtime.xmax - runtime.xmin)/runtime.gridMaxPoints) / 1000);
elem.chart['axes']['xaxis']['max'] = runtime.xmax;
elem.chart['axes']['xaxis']['min'] = runtime.xmin;
elem.chart['axes']['xaxis']['tickInterval'] = interval + " seconds";
i++;
runtime.charts[orderKey].numPoints++;
if (runtime.redrawCharts) {
elem.chart.redraw();
elem.chart.replot();
}
});