antvis / F2

📱📈An elegant, interactive and flexible charting library for mobile.
https://f2.antv.vision/zh
MIT License
7.89k stars 649 forks source link

h5 mix is not a function #1819

Open joneswind opened 1 year ago

joneswind commented 1 year ago

F2版本3.8.13 环境Taro 3.4.12编译的h5环境 import * as F2 from '@antv/f2/lib/index-all';

const initChart = config => { const chart: any = new F2.Chart(config); chart.clear(); chart.source(data, { [xAxis]: {tickCount: 5},

    min: 0,
    nice: true,
    tickCount: 6
  }
});
chart.legend(false);
chart.tooltip({
  showItemMarker: true,
  onShow: ev => {
    const items = ev.items;
    if (valueText.length) {
      items[0].name = valueText[0];
    }
  }
});
chart.axis(yAxis, {
  position: 'left',
  label: function label(val) {
    const textCfg: any = {};
    if (Number(val) > 10000) {
      textCfg.text = unitTenThousand(Number(val), 1);
    }

    textCfg.fill = color.length ? color?.[0] : '#000';
    textCfg.fontWeight = 400;
    return textCfg;
  },
  grid: () => {
    return {stroke: '#eee'};
  }
});
chart
  .interval()
  .position(`${xAxis}*${yAxis}`)
  .color(color)
  .size(10).adjust('stack');

chart.render();
return chart;

};

只要使用adjust就会报错

zengyue commented 1 year ago

错误信息是啥?

joneswind commented 1 year ago

Uncaught TypeError: mix is not a function at Stack.Adjust (base.js:15:1) at new Stack (stack.js:15:1) at Interval._adjustData (base.js:284:1) at Interval._processData (base.js:230:1) at Interval.init (base.js:95:1) at Interval.init (interval.js:30:1) at Chart._initGeom (chart.js:296:1) at Chart._initGeoms (chart.js:302:1) at Chart.init (chart.js:459:1) at Chart.render (chart.js:549:1)

joneswind commented 1 year ago
image
joneswind commented 1 year ago

错误信息是啥?

已更新错误信息,有确认问题吗?

dream7days commented 2 weeks ago

我也遇到这个问题了 请问有解决方案吗

joneswind commented 2 weeks ago

我也遇到这个问题了 请问有解决方案吗

没有,当时由于工期限制,改用其它图表实现了