king
2021-04-15 772308eba58d2209e7cc108dc5567ef4ca7ee3b2
src/menu/components/chart/antv-bar/index.jsx
@@ -51,6 +51,7 @@
        width: card.width || 24,
        height: 400,
        barSize: 35,
        color: 'rgba(0, 0, 0, 0.65)',
        name: card.name
      }
@@ -195,7 +196,7 @@
  linerender = () => {
    const { card } = this.state
    let plot = {...card.plot, height: card.plot.height - 80} // 去除title所占空间
    let color = plot.color || 'rgba(0, 0, 0, 0.85)'
    let color = plot.color || 'rgba(0, 0, 0, 0.65)'
    let X_axis = plot.Xaxis || 'x'
    let Y_axis = plot.Yaxis || ['y']
@@ -236,8 +237,10 @@
  
      chart.data(dv.rows)
      chart.axis(X_axis, { label: { style: { fill: color } }, line: { style: { fill: color } } })
      chart.axis('value', { grid: { style: { fill: color } }, label: { style: { fill: color } } })
      // chart.axis(X_axis, { label: { style: { fill: color } }, tickLine: {style: { stroke: color }}, line: { style: { stroke: color } } })
      // chart.axis('value', { grid: { line: { style: { stroke: color } }}, label: { style: { fill: color } } })
      chart.axis(X_axis, { label: { style: { fill: color } } })
      chart.axis('value', { label: { style: { fill: color } } })
  
      if (plot.coordinate !== 'polar') {
        chart.scale(X_axis, {
@@ -349,7 +352,7 @@
  customrender = (data) => {
    let card = fromJS(this.state.card).toJS()
    let plot = {...card.plot, height: card.plot.height - 80} // 去除title所占空间
    let color = plot.color || 'rgba(0, 0, 0, 0.85)'
    let color = plot.color || 'rgba(0, 0, 0, 0.65)'
    let fields = []
    let legends = []
    let transfield = {}
@@ -396,7 +399,8 @@
      if (item.axis === 'true' && axisIndex < 2) {
        if (axisIndex === 0) {
          item.axis = { grid: {style: { fill: color }}, title: { style: { fill: color } }, label: {style: { fill: color }} }
          // item.axis = { grid: {line: { style: { stroke: color } }}, title: { style: { fill: color } }, label: {style: { fill: color }} }
          item.axis = { title: { style: { fill: color } }, label: {style: { fill: color }} }
          fields.unshift(item)
        } else {
          item.axis = { grid: null, title: {style: { fill: color }}, label: {style: { fill: color }} }
@@ -435,7 +439,8 @@
    chart.data(dv.rows)
    chart.axis(plot.Xaxis, { label: { style: { fill: color } }, line: { style: { fill: color } } })
    // chart.axis(plot.Xaxis, { label: { style: { fill: color } }, tickLine: {style: { stroke: color }}, line: { style: { stroke: color } } })
    chart.axis(plot.Xaxis, { label: { style: { fill: color } } })
    if (!hasBar) {
      chart.scale(plot.Xaxis, {
@@ -556,7 +561,7 @@
  barrender = () => {
    const { card } = this.state
    let plot = {...card.plot, height: card.plot.height - 80}
    let color = plot.color || 'rgba(0, 0, 0, 0.85)'
    let color = plot.color || 'rgba(0, 0, 0, 0.65)'
    let X_axis = plot.Xaxis || 'x'
    let Y_axis = plot.Yaxis || ['y']
@@ -598,8 +603,10 @@
  
      chart.data(dv.rows)
      chart.axis(X_axis, { label: { style: { fill: color } }, line: { style: { fill: color } } })
      chart.axis('value', { grid: { style: { fill: color } }, label: { style: { fill: color } } })
      // chart.axis(X_axis, { label: { style: { fill: color } }, tickLine: {style: { stroke: color }}, line: { style: { stroke: color } } })
      // chart.axis('value', { grid: { line: { style: { stroke: color } }}, label: { style: { fill: color } } })
      chart.axis(X_axis, { label: { style: { fill: color } } })
      chart.axis('value', { label: { style: { fill: color } } })
  
      chart.scale('value', {
        nice: true,