king
2021-08-13 a13b2a8d6e84662275ea913850e01be9b2ff31e5
src/menu/components/chart/antv-bar/index.jsx
@@ -198,14 +198,10 @@
   */
  linerender = () => {
    const { card } = this.state
    let plot = {...card.plot} // 去除title所占空间
    const plot = card.plot
    let color = plot.color || 'rgba(0, 0, 0, 0.65)'
    let X_axis = plot.Xaxis || 'x'
    let Y_axis = plot.Yaxis || ['y']
    if (card.plot.title || card.search.length > 0) {
      plot.height = card.plot.height - 70
    }
    let data = this.getdata(X_axis, Y_axis)
@@ -239,7 +235,7 @@
      const chart = new Chart({
        container: card.uuid + 'canvas',
        autoFit: true,
        height: plot.height || 400
        height: this.wrap.offsetHeight - 25
      })
  
      chart.data(dv.rows)
@@ -423,16 +419,12 @@
   */
  customrender = (data) => {
    let card = fromJS(this.state.card).toJS()
    let plot = {...card.plot} // 去除title所占空间
    let plot = card.plot
    let color = plot.color || 'rgba(0, 0, 0, 0.65)'
    let fields = []
    let legends = []
    let transfield = {}
    let Bar_axis = []
    if (card.plot.title || card.search.length > 0) {
      plot.height = card.plot.height - 70
    }
    card.columns.forEach(col => {
      if (col.field) {
@@ -568,7 +560,7 @@
    const chart = new Chart({
      container: card.uuid + 'canvas',
      autoFit: true,
      height: plot.height || 400,
      height: this.wrap.offsetHeight - 25,
    })
    // chart.axis(plot.Xaxis, { label: { style: { fill: color } }, tickLine: {style: { stroke: color }}, line: { style: { stroke: color } } })
@@ -920,14 +912,10 @@
   */
  barrender = () => {
    const { card } = this.state
    let plot = {...card.plot}
    const plot = card.plot
    let color = plot.color || 'rgba(0, 0, 0, 0.65)'
    let X_axis = plot.Xaxis || 'x'
    let Y_axis = plot.Yaxis || ['y']
    if (card.plot.title || card.search.length > 0) {
      plot.height = card.plot.height - 70
    }
    let data = this.getdata(X_axis, Y_axis)
    
@@ -962,7 +950,7 @@
      const chart = new Chart({
        container: card.uuid + 'canvas',
        autoFit: true,
        height: plot.height || 400
        height: this.wrap.offsetHeight - 25
      })
      chart.data(dv.rows)
@@ -1362,7 +1350,7 @@
          <Icon type="tool" />
        </Popover>
        {card.plot.title || card.search.length > 0 ? <NormalHeader config={card} updateComponent={this.updateComponent}/> : null}
        <div className="canvas" id={card.uuid + 'canvas'}></div>
        <div className="canvas" id={card.uuid + 'canvas'} ref={ref => this.wrap = ref}></div>
        {appType !== 'mob' ? <ActionComponent
          type="chart"
          config={card}