What problem does this feature solve?
我想要拿到每一个分组柱状图的最高点的中心点, 打算拿graphic实现 现在拿不到每一组最高点的x,y的坐标像素点 想要加标签
What does the proposed API look like?
option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: [
{
"type": "category",
"position": "bottom",
"data": [
"Alipay+",
"",
""
],
"axisLabel": {
"color": "#ffffff",
"fontSize": 12,
"lineHeight": 16
}
},
{
"type": "category",
"position": "bottom",
"data": [
"",
"WF",
""
],
"axisLabel": {
"color": "#ffffff",
"fontSize": 12,
"lineHeight": 16
}
},
{
"type": "category",
"position": "bottom",
"data": [
"",
"",
"HK Biz"
],
"axisLabel": {
"color": "#ffffff",
"fontSize": 12,
"lineHeight": 16
}
}
],
yAxis: [
{
type: 'value'
}
],
series:[
{
"name": "USD",
"type": "bar",
"barWidth": 22,
"xAxisIndex": 0,
"data": [
1000000000015.99
]
},
{
"name": "USD",
"type": "bar",
"barWidth": 22,
"xAxisIndex": 1,
"data": [
"",
999999999999.99
]
},
{
"name": "USD",
"type": "bar",
"barWidth": 22,
"xAxisIndex": 2,
"data": [
"",
"",
999999999999.99
]
},
{
"name": "EUR",
"type": "bar",
"barWidth": 22,
"xAxisIndex": 0,
"data": [
1080699999999.91
]
},
{
"name": "CNY",
"type": "bar",
"barWidth": 22,
"xAxisIndex": 1,
"data": [
"",
1408400000000
]
},
{
"name": "CNY",
"type": "bar",
"barWidth": 22,
"xAxisIndex": 2,
"data": [
"",
"",
1408400000000
]
},
{
"name": "Others(US $)",
"type": "bar",
"barWidth": 22,
"xAxisIndex": 1,
"data": [
"",
2115000000000
]
}
]
};
3条答案
按热度按时间imzjd6km1#
尝试了convertToPixel方法 拿不到返回为NaN
xzlaal3s2#
拿中心像素点 放标签
ccrfmcuu3#
I tried this and can get the pixels position correctly: