score:1
Accepted answer
You can preprocess your data and calculate the middle points. A null point doesn't have a marker and it's not possible to show a tooltip for it.
const data = [...];
const processedData = data.map((dataEl, index) => {
if (!dataEl) {
return {
y: (data[index - 1] + data[index + 1]) / 2,
isCalculatedValue: true,
marker: {
fillColor: 'red',
radius: 1
}
}
}
return dataEl;
});
By using tooltip.formatter
function, you can show the previous point value in a tooltip.
tooltip: {
formatter: function(tooltip) {
let point = this.point;
if (point.isCalculatedValue) {
point = this.series.points[point.index - 1];
}
return "<span style='font-size: 10px'>" + point.category + "</span><br/>" +
"<span style='color:" + point.series.color +
"'>●</span> Line series: <b>" + point.y + "</b><br/>";
}
}
Live demo: https://jsfiddle.net/BlackLabel/nrmgaw6q/
API Reference: https://api.highcharts.com/highcharts/tooltip.formatter
Source: stackoverflow.com
Related Articles
- HighChart - show tooltips for null on hover
- Show tooltips of piechart when hover outside of the chart on a button
- Is it possible to show the chart if the value of array bracket is null or empty in the HighChart
- Backgroud Bell Curve and show tooltips in Highchart charts
- Highchart - show / hide an y-Axis without hiding the series
- Disable marker hover in only one marker of highchart
- Having trouble just getting the Highchart to show
- Highchart show string on x-axis
- Show N/A in datalabels, when value is null - Highcharts
- HighCharts - Show tooltip on column where value is 0 or null
- highchart export button not show
- HighCharts area graph - show tooltip only on hover of marker
- Show Highchart series horizontally below each other
- Highcharts - Show tooltip onClick instead of hover
- Show Fraction values in highchart
- Why won't the legend in my highchart show values?
- Highchart tooltip show nearest point
- How show all tooltips split in graph with many series
- Is there a way to get superscripts to show up in highchart exports
- Highchart / Highstock stack column chart show one series's tooltip at a time
- Show multiple Tooltips in highcharts on overlapping points
- how to pass datalabels along with data to show it in tooltip in highchart
- highcharts dataLabels support RTL with enable hover it for show tooltip
- Highchart stack labels don't show up in IE 8
- How to make interactive highchart tooltips
- how to show cross hair in highchart always by default
- how to show cross hair in highchart always by default
- How to make two charts using highchart show up in the same line side by side using div
- Highcharts: Show tooltip on legend hover
- Column Chart Show datalabel for null values - Highcharts
- How can I open a high chart in a modal window when the chart is clicked on?
- Highcharts with Public Google Spreadsheet does not work
- Highcharts - series color on shadow
- Highcharts Area chart gradient fill
- Using Highcharts with mysql for Page Visits
- Highcharts problems showing last values and close values
- Highcharts error "cannot read property of undefined"
- Highcharts multiple data on single point in series
- Specific case of Timeline chart
- Highcharts - options dump.json
- Generate/export table+graph in highcharts in PDF format
- highcharts - need to auto scroll on x-axis on every 5 seconds with hide scroll bar
- R - leaflet - highcharter tooltip (label)
- Angular 4 - Create Heat Chart
- remove extra space/margin after navigator highstocks
- Unable to set gape in Gauge Highchart
- HighChart Skipping the first point : Highcharts, Javascript
- Is there a way to copy the contents of a HighCharts tooltip to the clipboard?
- use highmaps in .vue file
- Creating a grid-like column graph in Highcharts