king
2022-05-27 cc1d7095ec6df622efbdaaabe3dec78ca3599d90
X轴自定义名称长度
2个文件已修改
15 ■■■■ 已修改文件
src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/chart/antv-bar-line/index.jsx 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx
@@ -572,6 +572,15 @@
      initVal: card.max,
      required: false
    }, {
      type: 'number',
      key: 'XLimit',
      min: 2,
      label: '字符限制',
      tooltip: 'X轴最大字符限制。',
      initVal: card.XLimit || 11,
      forbid: appType === 'mob',
      required: false
    }, {
      type: 'color',
      key: 'color',
      label: '色系',
src/tabviews/custom/components/chart/antv-bar-line/index.jsx
@@ -198,12 +198,14 @@
      _config.plot.$colors = colors
    }
    let limit = _config.plot.XLimit || 11
    let xc = {label: {
      formatter: (val) => {
        if (!val || /^\s*$/.test(val)) return val
        let _val = `${val}`
        if (_val.length <= 11) return val
        return _val.substring(0, 8) + '...'
        if (_val.length <= limit) return val
        return _val.substring(0, limit) + '...'
      },
      style: { fill: _config.plot.color }
    }}