datastorm-open / rAmCharts

API for Amcharts
48 stars 16 forks source link

stockChart calculated value format #63

Closed JianWang2016 closed 6 years ago

JianWang2016 commented 7 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.