0

I am looking for a way to format the date and number in a tooltip.

By default, the formats in my example (see below) are:

Date: "Monday, 27 Abr, 2015" Number: 1,999.265998

Would like to change: Date: "27/04/2015, Monday" Number: 1.999,27

Is it possible to apply this format for all Highcharts objects? (similar to Highcharts.setOptions({lang}) in JSON link)

Example:

require(rCharts)
require(reshape2)

test_data <- data.frame("date0" = seq(Sys.Date()-14, Sys.Date(), by = 1),
                        "serie_1" = rnorm(15)+2000,
                        "serie_2" = rnorm(15)+2000
                        )
test_data <- melt(test_data, "date0")

test_data["date"] <-as.numeric(as.POSIXct(as.Date(test_data[["date0"]]), 
                                    origin="1970-01-01"))*1000

my.hPlot <- hPlot(x = "date", y = "value", group = 'variable', 
                  data = test_data, type = 'line')
my.hPlot$xAxis(type = "datetime")
my.hPlot$tooltip(shared = T, crosshairs = list(T, F))
my.hPlot
Andriy T.
  • 2,020
  • 12
  • 23
  • You can use `round(value,2)` to force the value to two decimals. – kristang May 08 '15 at 09:02
  • It is not only about num of digit after decimal separator, it's about separators. Additionaly I would prefer mantain an original number without rounding data, but visualize rounded number – Andriy T. May 08 '15 at 10:36
  • How about formatting dates like in similiar quesiton: http://stackoverflow.com/questions/24344794/rcharts-nplot-formating-x-axis-with-dates ? – Sebastian Bochan May 11 '15 at 11:42
  • Thank's Sebastian, I will try to check out that topics. It seems I have to create a format function myself – Andriy T. May 14 '15 at 11:38

0 Answers0