udo
udo

Reputation: 5210

amcharts4 - how to escape square bracket character ("[")

I would like to have Spread Value [EUR] as my title axis text so I tried with

valueAxis.title.text = "Spread Value \[EUR\]";

because

valueAxis.title.text = "Spread Value [EUR]";

results in Spread Value.

Any suggestions how to fix?

Note: I could fix it with Spread Value (EUR) but I would like to use square brackets.

Upvotes: 1

Views: 564

Answers (1)

Samuel Philipp
Samuel Philipp

Reputation: 11050

You can use valueAxis.title.html instead of valueAxis.title.text:

valueAxis.title.html = "Spread Value [EUR]";

Here is an example code pen.

Alternatively you can use double [[]] with valueAxis.title.text:

valueAxis.title.text = "Spread Value [[EUR]]";

Upvotes: 2

Related Questions