Adding Color Axis options to highchart objects

Share:

Description

Function to set the axis color to highcharts objects.

Usage

1

Arguments

hc

A highchart htmlwidget object.

...

Arguments are defined in http://api.highcharts.com/highmaps#colorAxis.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
nyears <- 5

df <- expand.grid(seq(12) - 1, seq(nyears) - 1)
df$value <- abs(seq(nrow(df)) + 10 * rnorm(nrow(df))) + 10
df$value <- round(df$value, 2)
ds <- list_parse2(df)


hc <- highchart() %>% 
  hc_chart(type = "heatmap") %>% 
  hc_title(text = "Simulated values by years and months") %>% 
  hc_xAxis(categories = month.abb) %>% 
  hc_yAxis(categories = 2016 - nyears + seq(nyears)) %>% 
  hc_add_series(name = "value", data = ds)

hc_colorAxis(hc, minColor = "#FFFFFF", maxColor = "#434348")

hc_colorAxis(hc, minColor = "#FFFFFF", maxColor = "#434348",
             type = "logarithmic") 


require("viridisLite")

n <- 4
stops <- data.frame(q = 0:n/n,
                    c = substring(viridis(n + 1), 0, 7),
                    stringsAsFactors = FALSE)
stops <- list_parse2(stops)

hc_colorAxis(hc, stops = stops, max = 75) 

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.