king
2020-08-03 769725931ef28d1a86b0fdd89cf5a44faf7bec27
src/tabviews/zshare/chartcomponent/index.jsx
@@ -431,10 +431,15 @@
    let _data = []
    let _valfield = 'value'
    let _typefield = 'key'
    let ispercent = false
    if (plot.datatype === 'statistics') {
      _valfield = plot.InfoValue
      _typefield = plot.InfoType
      if (percentFields.length > 0) {
        ispercent = true
      }
      _data = this.getStaticData()
    } else {
@@ -490,7 +495,8 @@
      })
    }
    chart.scale(_valfield, {
      nice: true
      nice: true,
      range: [0, 0.93]
    })
    // 坐标轴格式化
@@ -540,7 +546,7 @@
      .tooltip(`${plot.Xaxis}*${_valfield}*${_typefield}`, (name, value, type) => {
        return {
          name: type,
          value: percentFields.includes(type) ? value + '%' : value
          value: percentFields.includes(type) || ispercent ? value + '%' : value
        }
      })
@@ -746,10 +752,15 @@
    let _data = []
    let _valfield = 'value'
    let _typefield = 'key'
    let ispercent = false
    if (plot.datatype === 'statistics') {
      _valfield = plot.InfoValue
      _typefield = plot.InfoType
      if (percentFields.length > 0) {
        ispercent = true
      }
      _data = this.getStaticData()
    } else {
@@ -804,7 +815,8 @@
    chart.data(_data)
    chart.scale(_valfield, {
      nice: true
      nice: true,
      range: [0, 0.93]
    })
    // 坐标轴格式化
@@ -862,7 +874,7 @@
        .tooltip(`${plot.Xaxis}*${_valfield}*${_typefield}`, (name, value, type) => {
          return {
            name: type,
            value: percentFields.includes(type) ? value + '%' : value
            value: percentFields.includes(type) || ispercent ? value + '%' : value
          }
        })
@@ -879,7 +891,7 @@
        .tooltip(`${plot.Xaxis}*${_valfield}*${_typefield}`, (name, value, type) => {
          return {
            name: type,
            value: percentFields.includes(type) ? value + '%' : value
            value: percentFields.includes(type) || ispercent ? value + '%' : value
          }
        })