Description Usage Arguments Details Value Author(s)
timeseries_json
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | timeseries_json(
df,
x,
dataname = "data",
backgroundColor = c("#D22630", "#00A9CE", "#43B02A", "#F2A900"),
hoverBackgroundColor = c("#D22630", "#00A9CE", "#43B02A", "#F2A900"),
borderColor = NULL,
type = c("bar"),
pointRadius = NA,
lineTension = NA,
fill = FALSE,
hidden = FALSE,
series_label = NULL,
yAxisID = NULL
)
|
df |
A dataframe with one column that has a date and the remaining columns will be plotted in the final graph |
x |
The name of the column in the df that has dates. This will be the x-axis of the graph |
dataname |
The name of the data in the .js. This object name will be called in the html. |
backgroundColor |
The background hex colour of the bars or line. |
hoverBackgroundColor |
The hex colour that the series changes to when you hover over with the mouse. |
borderColor |
The hex border colour of the series |
type |
The type of series, either "line" or "bar" |
pointRadius |
The radius of the points in a line series |
lineTension |
The besier tension of the line series. Set to 0 if you want no smoothing effect. |
fill |
The fill below the line. Set to TRUE if you want to fill the area under the curve. |
hidden |
When the plot is first loaded, should the series be hidden or visible. You can afterwards click on the graph series to unhide it or hide it. So this is just the default state and it TRUE or FALSE |
series_label |
The string name of the series for the legend |
yAxisID |
The ID of the yaxis. Used if you have multiple y axes. |
Convert a dataframe with temporal counts into a json object that can be written to a file that will be read by a timeseries graph in chart.js.
A character vector
Thomas Rosendal
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.