[Web] Replot graph immediately

This commit is contained in:
André 2018-05-26 23:07:26 +02:00
parent ff54b3ac91
commit e70c269998

View File

@ -352,7 +352,7 @@ jQuery(function($){
var total = 0; var total = 0;
$(data).map(function(){total += this[1];}) $(data).map(function(){total += this[1];})
rspamd_labels = $.makeArray($(data).map(function(){return "<h5>" + this[0] + " (" + this[1] + ") " + Math.round(this[1]/total * 100) + "%</h5>";})); rspamd_labels = $.makeArray($(data).map(function(){return "<h5>" + this[0] + " (" + this[1] + ") " + Math.round(this[1]/total * 100) + "%</h5>";}));
window.rspamd_donut = $.jqplot('rspamd_donut', [data], window.rspamd_donut = $.jqplot('rspamd_donut', [data],
{ {
seriesDefaults: { seriesDefaults: {
renderer: jQuery.jqplot.DonutRenderer, renderer: jQuery.jqplot.DonutRenderer,
@ -378,6 +378,7 @@ jQuery(function($){
} }
} }
); );
window.rspamd_donut.replot({});
} }
}); });
} }
@ -533,7 +534,6 @@ jQuery(function($){
draw_api_logs(); draw_api_logs();
draw_netfilter_logs(); draw_netfilter_logs();
draw_rspamd_history(); draw_rspamd_history();
rspamd_donut.replot({});
$(window).resize(function () { $(window).resize(function () {
var timer; var timer;
clearTimeout(timer); clearTimeout(timer);