antvis / wx-f2

F2 的微信小程序
MIT License
1.28k stars 184 forks source link

条形图表上设置guide().text的offsetX偏移量在"第二象限"上显示有问题 #339

Open panghujiajia opened 3 years ago

panghujiajia commented 3 years ago
chart.source(data, {
    value: {
        type: 'linear',
        ticks: [-100, -50, 0, 50, 100],
    }
});

data.forEach(obj => {
    chart.guide().text({
        position: [obj.name, obj.value],
        content: obj.value,
        style: {
            textBaseline: 'bottom',
            textAlign: 'center',
        },
        offsetY: 7,
        offsetX: 15,
    });
});
value的ticks从负数开始,导致我设置的offsetX会让0点左侧的几何标记上的文字显示在几何标记的正上方
预期希望0点左侧的guide text显示在几何标记的左侧,0点右侧的guide text显示在几何标记的右侧