my-f2
my-f2 copied to clipboard
淘宝真机tooltips折叠,pie图pieLabel 报错
IDE效果

真机效果

js代码
Page({
data: {},
// 折线图函数
onInitLineChart (F2, config) {
const chart = new F2.Chart(config);
const data = [
{ value: 63.4, city: 'New York', date: '2011-10-01' },
{ value: 62.7, city: 'Alaska', date: '2011-10-01' },
{ value: 72.2, city: 'Austin', date: '2011-10-01' },
{ value: 58, city: 'New York', date: '2011-10-02' },
{ value: 59.9, city: 'Alaska', date: '2011-10-02' },
{ value: 67.7, city: 'Austin', date: '2011-10-02' },
{ value: 53.3, city: 'New York', date: '2011-10-03' },
{ value: 59.1, city: 'Alaska', date: '2011-10-03' },
{ value: 69.4, city: 'Austin', date: '2011-10-03' },
];
chart.source(data, {
date: {
range: [0, 1],
type: 'timeCat',
mask: 'MM-DD'
},
value: {
max: 300,
tickCount: 4
}
});
chart.area().position('date*value').color('city').adjust('stack');
chart.line().position('date*value').color('city').adjust('stack');
chart.render();
// 注意:需要把chart return 出来
return chart;
},
// 环形图函数
onInitPieChart (F2, config) {
const chart = new F2.Chart(config);
const data = [{
amount: 20,
ratio: 0.1,
memo: '学习',
const: 'const'
}, {
amount: 100,
ratio: 0.5,
memo: '睡觉',
const: 'const'
}, {
amount: 10,
ratio: 0.05,
memo: '吃饭',
const: 'const'
}, {
amount: 30,
ratio: 0.15,
memo: '讲礼貌',
const: 'const'
}, {
amount: 10,
ratio: 0.05,
memo: '其他',
const: 'const'
}, {
amount: 20,
ratio: 0.1,
memo: '运动',
const: 'const'
}, {
amount: 10,
ratio: 0.05,
memo: '暂无备注',
const: 'const'
}];
chart.source(data);
chart.coord('polar', {
transposed: true,
innerRadius: 0.7,
radius: 1
});
chart.axis(false);
chart.legend({
position: 'bottom',
align: 'center'
});
chart.tooltip(false);
chart.pieLabel({
sidePadding: 75,
label1: function label1 (data) {
return {
text: 'hello',
fill: '#808080'
};
},
label2: function label2 (data) {
return {
fill: '#000000',
text: '$2',
fontWeight: 500,
fontSize: 10
};
}
});
chart.interval()
.position('const*ratio')
.color('memo', ['#1890FF', '#13C2C2', '#2FC25B', '#FACC14', '#F04864', '#8543E0', '#3436C7', '#223273'])
.adjust('stack');
chart.render();
// 注意:需要把chart return 出来
return chart;
}
});
axml代码
<view>
<view>INDEX</view>
<view>Line</view>
<f2 onInit="onInitLineChart"></f2>
<view>Pie</view>
<f2 onInit="onInitPieChart"></f2>
</view>
版本: "@antv/my-f2": "2.0.0"
- tooltips 折叠的问题是手淘容器的问题,已经反馈过去在修复了
- pieLabe 默认没有加载进来,需要使用场景自行引用
const PieLabel = require('@antv/f2/lib/plugin/pie-label');
F2.Chart.plugins.register([ PieLabel ]);
tooltips 折叠的问题是手淘容器的问题,已经反馈过去在修复了
请问这个有具体的修复时间和计划吗?大概什么时候能够完成?