score:2
Accepted answer
would first convert your data frame to long. then you can group_by
category and use list_parse2
to make lists by category.
for this plot, i made sure month
was numeric on x-axis. i renamed category
to name
so it would show up in legend and labels. and added connectnulls
in case you wanted to connect points across missing values (na
).
library(highcharter)
library(tidyverse)
reprexdf2 <- reprexdf %>%
pivot_longer(cols = -category, names_to = "month", values_to = "value", names_pattern = "month(\\d)$") %>%
group_by(category) %>%
do(data = list_parse2(data.frame(as.numeric(.$month), .$value))) %>%
ungroup() %>%
rename(name = category)
highchart() %>%
hc_plotoptions(series = list(connectnulls = true), line = list(marker = list(enabled = false)))%>%
hc_add_series_list(reprexdf2)
Source: stackoverflow.com
Related Query
- How could you supply multiple series to a line chart in R shiny using highcharter package and without hardcoding the series?
- Plot Highchart multiple series line chart using JSON data
- How do you position the x-axis labels along the line y=0 using Highcharts?
- How to use for loop array to add series dynamically for line chart
- How to render a vertical line when the mouse cursor is on the chart using highcharts?
- highcharts change chart type using dropdown for multiple series
- How to set column width for columnRange chart with multiple series
- How to proceed reactive function of dataset in Shiny - line chart R
- Adding multiple series to the spline chart using dotnet high charts in asp.net mvc3
- Basic Highcharts Multiple Series Chart Using JSON
- Highcharts: how do I add full data to multiple series in a chart
- how to render multiple line charts - highcharts on same page using highcharts react wrapper - highcharts-react-offical
- How to add a vertical plot line in multiple line series and show the tooltip on Plot line in highchart
- Highchart Line chart – data series with multiple axis - 2nd series placed in the middle of X axis
- How to plot line chart with series data in highcharts?
- How can I prepare a Group Stacked Bar Chart in Highcharts using multiple and different types of data?
- Highcharts : using same div to load a chart multiple times with different series data
- highchart's line chart with constant series not plotting when using linear gradient colour
- How to draw line plus bar chart using highcharts/d3.js or any other chart library?
- How to have multiple highcharts with different series data in vuejs without repeating code
- How to put multiple HighChart in a page having different series value in different chart
- How to change the series color and mark after I draw the line chart in highcharts?Does it has databound event?
- High charts Issue with stock bar chart multiple line series
- Highcharts Highstock How to Plot OHLC and Line Charts from One Set of Embedded CSV Data Using Series Map Tools?
- How to implement similar line chart using the Highcharts library?
- Line and column combo chart with multiple columns for each category, how to position line marker for each category on a specific column?
- How to pass date range filter to line chart using highcharts?
- Highcharts Line Chart Drill down into multiple series
- How to stand out a vertical plotted line in a dense series using highchart?
- Using highcharter to return multiple data with Shiny
More Query from same tag
- TypeError: Highcharts[h] is not a function
- Highcharts - Dynamic + Multiple charts not rendering
- How to customize which items appear in the built-in StockTools toolbar?
- Tooltip for line segments instead of points in highcharts
- change button image
- How to flag a value in a series in highcharts, and follow it, even if the position in the series change?
- FillPattern after drillDown to countries on Highchart-react
- Integrating Highcharts into Angular-gridster
- Imported font and Highcharts JS export
- Labeling for Highchart Funnel Visualization
- Making a HighChart container draggble
- High chart on click event listening
- highcharts legend marker and series marker with different size
- Highcharts not rotating to vertical in angular
- Navigator line is different than series line
- Highchart - Tooltip prevents click
- highcharts-ng addpoint each second
- Remove the border around the pie chart in high charts
- Highcharts: Set programmatically the crosshair on the first xAxis item
- Highcharts: trying to update series
- Highcharts with external CSV $.get - No xAxis date
- Highstock/Highchart substep maximum?
- How to align multiple charts with different data
- Chart Is not displaying Created Using HighCahrts and Google Analytics
- Navigation arrows for Stock Tools
- Heat Map With Red Color Range For Negative Values And Green Color Range For Positive Values
- Make flag visible when the the plot is clicked to show
- Click a point on a highcharts graph from outside of the chart
- I want to update my series dynamically on highcharts with a click & also bring it to the original way by clicking on an other button (#previous)
- Add dataLabel to Area chart in Highcharts.js