first commit
This commit is contained in:
8
src/utils/dataUtil.js
Normal file
8
src/utils/dataUtil.js
Normal file
@@ -0,0 +1,8 @@
|
||||
/* Echarts图表尺寸自适应 */
|
||||
export const fitChartSize = (size, width = 3840) => {
|
||||
let clientWidth =
|
||||
window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth
|
||||
if (!clientWidth) return size
|
||||
let scale = clientWidth / width
|
||||
return Number((size * scale).toFixed(3))
|
||||
}
|
||||
Reference in New Issue
Block a user