What problem does this feature solve?
想要实现的功能:点击柱状图的柱子,获取该柱子中点的横向像素坐标。现想结合一个类目宽度以及barGap,barCategoryGap,柱子的索引等信息获取柱子中点的横向像素坐标。如果有多个类目的情况下,可以通过两个类目中点横向像素坐标相减得到一个类目的宽度,但是如果只有一个类目的情况下,无法取得。现有如下问题:
- 设置了grid. containLabel = true之后如何获取柱状图一个类目的宽度
- 即 示例 中tooltip一个阴影的宽度 如何获取
What does the proposed API look like?
设置了grid. containLabel = true之后如何获取柱状图一个类目的宽度
2条答案
按热度按时间sr4lhrrt1#
@wyzhang0401 It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗
TRANSLATED
TITLE
The grid. containLabel = true How to get the width of a class of histograms
BODY
What problem does this feature solve?
The desired function: Click on a column of the histogram to obtain the horizontal pixel coordinates of the midpoint of the column. Now I want to combine a category width, barGap, barCategoryGap, column index and other information to obtain the horizontal pixel coordinates of the column midpoint. If there are multiple categories, the width of a category can be obtained by subtracting the horizontal pixel coordinates of the midpoints of the two categories, but if there is only one category, it cannot be obtained. The following problems exist:
What does the proposed API look like?
How to get the width of a category of the histogram after setting grid.containLabel = true
n3h0vuf22#
目前好像做不到这点,而且我也想不出一个简单的方式功能提供这一信息