antvis / antvis/F2

h5 mix is not a function

Open
#1,819 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
8k
Forks
637
PR merge metrics
No merged PRs in 30d

Description

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就会报错

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue in the Taro 3.4.12 H5 environment using the import from @antv/f2/lib/index-all and the interval().adjust('stack') call shown in the report. Trace the F2 adjustment path to identify why h5 reports that mix is not a function; done means stacked adjustment renders without that error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.