Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AxisLabel missing {value} placeholder docs #291

Closed
cristianofromagio opened this issue Nov 11, 2023 · 1 comment
Closed

AxisLabel missing {value} placeholder docs #291

cristianofromagio opened this issue Nov 11, 2023 · 1 comment

Comments

@cristianofromagio
Copy link

Context

I was trying to suffix a string to the XAxis entries, so tried to use the formatter field on the Axis Label, in which none of the docs placeholders worked (it rendered the placeholder as a text).

image

Docs

I tried to find the Axis Label formatter placeholders values in the Configuration docs:

Description for LabelStyle.formatter on the docs:

标签内容字符串模版格式器。支持用 \n 换行。 模板变量有: {.}:圆点标记。 {a}:系列名。 {a}:系列名。 {b}:类目值或数据名。 {c}:数据值。 {d}:百分比。 {e}:数据名。 {f}:数据和。 示例:“{b}:{c}”

Translated to english (it is also missing the placeholder values on the english docs file):

Tag content string template formatter. Line breaks with \n are supported. Template variables are: {.}: dot mark. {a}: Series name. {a}: Series name. {b}: Category value or data name. {c}: data value. {d}: Percentage. {e}: data name. {f}: data sum. Example: "{b}:{c}"

Solution

While searching the other formatter fields, the Legend.formatter mentioned the {value} placeholder while also mentioning the template placeholders on Tooltip.itemFormatter (another related issue #290).

I tried using the {value} placeholder and it worked!

image

I also found this information while searching the FAQ files, but the english FAQ does not have the AxisLabel formatter description, which is present in the chinese FAQ.

From chinese FAQ file:

如何让Y轴显示多位小数
答:设置Axis下的AxisLabel中的formatter{value:f1}{value:f2}1.5.0及以上版本通过numericFormatter设置。

Translated to english (it is missing the formatter segment on the english FAQ file):

How to make the Y axis display multiple decimal places
Answer: Set the formatter in AxisLabel under Axis to {value:f1} or {value:f2}. Versions 1.5.0 and above are set via numericFormatter.

Suggestion

It would be nice to have the template placeholders for the AxisLabel formatter mentioned in the FAQ also documented in the Configuration docs (namely the {value} placeholder) where applicable.

@monitor1394
Copy link
Collaborator

Very detailed description, thanks for feedback, we will improve the documentation as soon as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants