The Bump chart can be used to show the ranking of several series over time. It is quite similar to line charts, but instead of graphing some measure on the y-axis, it only shows the ranking of each serie at a given time.
n_bump( data = NULL, series = NULL, x = NULL, ..., width = NULL, height = NULL, element_id = NULL )
data | data set in data.frame. |
---|---|
series, x | column names of series and x value. if not provided, it will use the first column as x value, and others as series. |
... | additional arguments. |
width, height | Must be a valid CSS unit (like |
element_id | element id of widgets. |
a nivo Bump component
If you'd like to show the ranking and also graph the y-axis values, you can also you use the AreaBump visualization.
library(nivor) # generate data data <- data.frame( group = 2000:2005, "Serie 1" = c(3, 6, 2, 4, 1, 5), "Serie 2" = c(1, 4, 5, 2, 3, 6), "Serie 3" = c(2, 3, 1, 5, 6, 4), "Serie 4" = c(4, 1, 3, 6, 5, 2), "Serie 5" = c(6, 5, 4, 1, 2, 3), "Serie 6" = c(5, 2, 6, 3, 4, 1) ) # the simplest use n_bump(data) # an example of a slightly more complex setup n_bump( data, margin = list( top = 40, right = 100, bottom = 40, left = 60 ), colors = list( scheme = "spectral" ), lineWidth = 3, activeLineWidth = 6, inactiveLineWidth = 3, inactiveOpacity = 0.15, pointSize = 10, activePointSize = 16, inactivePointSize = 0, pointColor = list( theme = "background" ), pointBorderWidth = 3, activePointBorderWidth = 3, pointBorderColor = list( from = "serie.color" ), axisTop = list( tickSize = 5, tickPadding = 5, tickRotation = 0, legend = "", legendPosition = "middle", legendOffset = -36 ), axisRight = NULL, axisBottom = list( tickSize = 5, tickPadding = 5, tickRotation = 0, legend = "", legendPosition = "middle", legendOffset = 32 ), axisLeft = list( tickSize = 5, tickPadding = 5, tickRotation = 0, legend = "ranking", legendPosition = "middle", legendOffset = -40 ) )