Raphael Boukara
Raphael Boukara

Reputation: 388

sign "+" before positive values on axis

I am trying to format data on value axes google chart:

=> sign "+" before positives values => sign "-" before negatives values

ex: -2 -1 0 +1 +2 ...

Maybe with options format? Any ideas?

Upvotes: 0

Views: 36

Answers (1)

asgallant
asgallant

Reputation: 26340

Use the vAxis.format option. The format option takes an ICU number pattern, which separates out positive and negative formats with a semicolon, so you could have, as an example:

vAxis: {
    format: '+#;-#'
}

which would format 3 as "+3" and -7 as "-7".

Upvotes: 1

Related Questions