datastorm-open / rAmCharts

API for Amcharts
48 stars 17 forks source link

stockChart calculated value format #63

Closed jwang-lilly closed 6 years ago

jwang-lilly commented 8 years ago

Hi, Could someone please advise how the calculated values displayed in legend or balloon text can be rounded to certain decimal places.

Thanks much.

bthieurmel commented 6 years ago

This is one simple way using precision.

data(data_gbar)

am <- amBarplot(x = "year", y = c("income", "expenses"), 
                data = data_gbar, zoom = TRUE,
                legend = TRUE, export = TRUE)

am@otherProperties$precision <- 0
am

am@otherProperties$precision <- 2
am

For other way, please refer to API.