From f9f3fe537fadd3a5a77895d41e5e4a8862d7aa17 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 29 五月 2020 13:34:28 +0800 Subject: [PATCH] 2020-05-29 --- src/tabviews/zshare/chartcomponent/index.jsx | 40 ++++++++++++++++++++++++++++++++++++++-- 1 files changed, 38 insertions(+), 2 deletions(-) diff --git a/src/tabviews/zshare/chartcomponent/index.jsx b/src/tabviews/zshare/chartcomponent/index.jsx index 3891a05..4837e12 100644 --- a/src/tabviews/zshare/chartcomponent/index.jsx +++ b/src/tabviews/zshare/chartcomponent/index.jsx @@ -181,8 +181,8 @@ _data = [..._mdata.values()] } - if (plot.correction && plot.chartType === 'bar' && plot.enabled !== 'true' && _data.length > 0 && _data.length < plot.correction) { - if (plot.customs && plot.customs.filter(cell => cell.chartType !== 'bar').length === 0) { + if (plot.correction && plot.chartType === 'bar' && _data.length > 0 && _data.length < plot.correction) { + if (plot.enabled !== 'true' || (plot.customs && plot.customs.filter(cell => cell.chartType !== 'bar').length === 0)) { let _num = plot.correction - _data.length for (let i = 0; i < _num; i++) { let _val = Array( i + 2 ).join(' ') @@ -429,6 +429,18 @@ nice: true }) + // 鍧愭爣杞存牸寮忓寲 + chart.axis(plot.Xaxis, { + label: { + formatter: (val) => { + if (!val || /^\s*$/.test(val)) return val + let _val = `${val}` + if (_val.length <= 10) return val + return _val.substring(0, 5) + '...' + } + } + }) + if (!plot.legend || plot.legend === 'hidden') { chart.legend(false) } else { @@ -540,6 +552,18 @@ range: [0.05, 0.95] }) } + + // 鍧愭爣杞存牸寮忓寲 + chart.axis(plot.Xaxis, { + label: { + formatter: (val) => { + if (!val || /^\s*$/.test(val)) return val + let _val = `${val}` + if (_val.length <= 10) return val + return _val.substring(0, 5) + '...' + } + } + }) if (!plot.legend || plot.legend === 'hidden') { chart.legend(false) @@ -693,6 +717,18 @@ nice: true }) + // 鍧愭爣杞存牸寮忓寲 + chart.axis(plot.Xaxis, { + label: { + formatter: (val) => { + if (!val || /^\s*$/.test(val)) return val + let _val = `${val}` + if (_val.length <= 10) return val + return _val.substring(0, 5) + '...' + } + } + }) + if (!plot.legend || plot.legend === 'hidden') { chart.legend(false) } else { -- Gitblit v1.8.0