Highcharts have a rich API which allows you to have control of the entire chart, from title, subtitle to axis ticks, labels, annotations. We’ll review the main functions with simple examples.
If this is clear, we can continue.
Now, let’s create a simple chart:
library(highcharter) data("citytemp") hc <- highchart() %>% hc_xAxis(categories = citytemp$month) %>% hc_add_series( name = "Tokyo", data = citytemp$tokyo ) %>% hc_add_series( name = "London", data = citytemp$london ) %>% hc_add_series( name = "Other city", data = (citytemp$tokyo + citytemp$london)/2 ) hc
hc_chart you can define general chart options.
Now change type to column and add 3d effect.
Usually is desirable get control or modify the behavior of the axis:
A good feature is
plotBand which you can use in both axis. For example:
hc %>% hc_xAxis( plotLines = list( list( label = list(text = "This is a plotLine"), color = "#FF0000", width = 2, value = 4, # the zIndex is used to put the label text over the grid lines zIndex = 1 ) ) ) %>% hc_yAxis( plotBands = list( list( from = 20, to = 50, color = hex_to_rgba("red", 0.1), label = list(text = "This is a plotBand"), # the zIndex is used to put the label text over the grid lines zIndex = 1 ) ) )