revert: 移除所有hires缩放 回到原始分辨率
This commit is contained in:
@@ -273,17 +273,11 @@
|
|||||||
try {
|
try {
|
||||||
_chartInstances[id] = { cpu: null, mem: null, net: null };
|
_chartInstances[id] = { cpu: null, mem: null, net: null };
|
||||||
if (typeof MiniChart !== 'undefined') {
|
if (typeof MiniChart !== 'undefined') {
|
||||||
var _hires = function(mc){ var fn=mc.resize||mc.applyResize; if(!fn)return; var orig=fn.bind(mc); var wrap=function(){ orig(); mc.canvas.width*=4; mc.ctx.scale(4,1); mc.draw(); }; if(mc.resize)mc.resize=wrap; else mc.applyResize=wrap; wrap(); };
|
_chartInstances[id].cpu = new MiniChart(id+'-cpu', '#7aa2f7'); _chartInstances[id].mem = new MiniChart(id+'-mem', '#9ece6a'); _hires(_chartInstances[id].mem);
|
||||||
_chartInstances[id].cpu = new MiniChart(id+'-cpu', '#7aa2f7'); _hires(_chartInstances[id].cpu);
|
|
||||||
_chartInstances[id].mem = new MiniChart(id+'-mem', '#9ece6a'); _hires(_chartInstances[id].mem);
|
|
||||||
}
|
}
|
||||||
if (typeof DualLineChart !== 'undefined') {
|
if (typeof DualLineChart !== 'undefined') {
|
||||||
_chartInstances[id].net = new DualLineChart(id+'-net', '#bb9af7', '#c0a8f0');
|
_chartInstances[id].net = new DualLineChart(id+'-net', '#bb9af7', '#c0a8f0');
|
||||||
(function(dlc){
|
|
||||||
var orig = dlc.applyResize.bind(dlc);
|
|
||||||
dlc.applyResize = function(){ orig(); dlc.canvas.width *= 4; dlc.ctx.scale(4,1); dlc.draw(); };
|
|
||||||
dlc.applyResize();
|
|
||||||
})(_chartInstances[id].net);
|
|
||||||
}
|
}
|
||||||
} catch(e) {}
|
} catch(e) {}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user