score:14
Accepted answer
Firt of all, you need to add all the data instead give only the vector (the vector DON“T have all the information to the tooltip you want).
To do this you need change the data
argument using the data.frame
with the hcaes
helper function in the mapping
argument to define which variable use in every axis:
highchart() %>%
hc_add_series(data = data, mapping = hcaes(x=date, y=hours), name = "Shipments", type = "scatter", color = "#2670FF", marker = list(radius = 2), alpha = 0.5) %>%
hc_add_series(data = data, hcaes(date, avghours), name = "Rolling Mean", type = "line", color = "#FF7900") %>%
hc_yAxis(min = 0, title = list(text = "Hours")) %>%
hc_tooltip(crosshairs = TRUE)
Then you can use the tooltip
argument in every hc_add_series
to define the tooltip in each series:
highchart() %>%
hc_add_series(data = data, hcaes(date, hours), name = "Shipments", type = "scatter",
tooltip = list(pointFormat = "tooltip with 2 values {point.animal}: {point.hours}")) %>%
hc_add_series(data = data, hcaes(date, avghours), name = "Rolling Mean", type = "line",
tooltip = list(pointFormat = "Avg hour text! {point.avghours}")) %>%
hc_yAxis(min = 0, title = list(text = "Hours")) %>%
hc_tooltip(crosshairs = TRUE)
Source: stackoverflow.com
Related Query
- R Highcharter: tooltip customization
- R - leaflet - highcharter tooltip
- Formatting datetime in Highcharter tooltip
- R - leaflet - highcharter tooltip (label)
- How to edit tooltip in Highcharts C# code
- how to use highcharts tooltip formatter in python code
- Displaying datatable in highcharter tooltip
- Highcharts - Highcharter in R - Getting Tooltip values from df rather than map
- Conditionally show/hide Tooltip of Highcharter
- Highcharter format number in tooltip
- highcharter xaxis crosshair tooltip labeling all series datapoints
- Additional data to highcharter tooltip
- Strange character in the Highstock source code
- HighcharteR Tooltip
- Need tooltip in customization
- How To Show Tooltip In Sparkline Chart From Code
- Highchart tooltip customization
- highcharter convert value to percent in tooltip
- Additional tooltip information in highcharter stock
- R highcharter - adding total in tooltip
- Disable highcharts tooltip on certain lines, leave it enabled on others?
- How to use the tooltip formatter and still display chart color (like it does by default)?
- Customize tooltip and format the number to 2 decimal places of highcharts
- Highcharts tooltip overflow is hidden
- customize highcharts tooltip to show datetime
- highcharts pass multiple values to tooltip
- How to get multiple series data in tooltip highcharts?
- Disable tooltip on certain points in Highcharts
- How to display highchart series line marker symbol from tooltip formatter?
- HighCharts: Labels visible over tooltip
More Query from same tag
- Can highcharts drilldown of a chart, reflect on another chart?
- Why are there disabled buttons in HighStock Range Selector?
- Error: Template parse errors: Can't bind to 'options' since it isn't a known property of 'chart'
- Highcharts setData on pie chart not working
- Margins will not adjust to make a smaller chart?
- rendering react-highcharts with mount enzyme gives an InvalidCharacterError
- Plot Y axis data based on x axis values from a csv file : Highcharts
- High charts error #19
- Invalid argument line 80 in highcharts.js
- Highcharts 8.0.4 is missing some x-axis labels
- Getting Highcharts tooltip to return an angular directive?
- Highstock, how to offset all Y data from a serie on clicking range selector buttons
- Highcharts draggable points - prevent hidding tooltip
- Populate Highcharts X-Axis With Dates Given a From And To Date
- mongodb datetime filter and aggregation
- Highmaps UK map data
- Highcharter: Add a string variable into a tooltip
- Plotting XML/CSV Data in ASP.NET Charts (in VS2008 using VB code)
- Jquery POST not populating array
- Highcharts Weird Vertical Lines
- Set custom color for highcharts-halo in styled mode
- Using HighchartsPHP library in CakePHP
- How to change Pie full donut to half donut in Highcharts?
- Programmatically draw rect and line in Highcharts with zoom
- Divergent chart possible with Highcharts?
- Highmaps: PHP $_GET[] with JQuery Ajax: sending a value to the same page and capturing with PHP
- Highcharts area chart hide graphs with one data point
- Highcharts - accessing overlaying data points
- How to hide/disable the legend box in Highcharts.js?
- Get all points in Highcharts scatter plot?