F2
F2 copied to clipboard
h5 mix is not a function
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}, [yAxis]: { 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就会报错