score:8
You can build your own tooltip with the use of tooltip.formatter. In your case, you need to edit header of the tooltip.
formatter: function (tooltip) {
const header = `<span style="color: blue;">${this.x} - ${this.x.replace(/:00/, ':59')}</span><br/>`
return header + (tooltip.bodyFormatter(this.points).join(''))
}
example: http://jsfiddle.net/cynysyhb/
score:1
Using tooltip.formatter, you have access to a lot of information about the current point(s), for example the data series and their x-axis.
Building on Highchart's own example:
...
tooltip: {
formatter: function () {
var point = this.points[0].point,
cats = point.series.xAxis.categories;
var catIndex = point.index,
currCat = cats[catIndex], //..or simply "this.x"
nextCat = cats[catIndex+1] || '';
var s = '<b>' + currCat + ' - ' + nextCat + '</b>';
$.each(this.points, function () {
s += '<br/>' + this.series.name + ': ' +
this.y + 'm';
});
return s;
},
shared: true
},
...
score:2
Highcharts allow you to pass tooltipFormatter calback that allows to pretty much define your tooltip in any way.
http://api.highcharts.com/highcharts/tooltip
tooltip: {
useHTML: true,
formatter: function () {
console.log(this); // just to see , what data you can access
return 'The value for <b>' + this.x +
'</b> is <b>' + this.y + '</b>';
}
}
You would also want to set the tooltip mode to be html
http://api.highcharts.com/highcharts/tooltip.useHTML
You may check which data you have access to inside the callback by sending it to the console from inside the tooltip formatter. If you need something else, then you can pass it along with datapoints, when creating the series.
I hope this helps.
Source: stackoverflow.com
Related Query
- how to customize the tooltip in solid gauge in highchart
- How to display highchart series line marker symbol from tooltip formatter?
- How to customize tooltip in Highchart?
- How can I customize a Highchart filename?
- Highcharts - how to set custom content in point tooltip (popup) on 3D scatter chart or how to customize point tooltip information?
- How to customize highchart treemap datalabels?
- How to change Highchart tooltip font family
- how to pass datalabels along with data to show it in tooltip in highchart
- How to edit tooltip in Highcharts C# code
- How to customize a tooltip number in Highcharts?
- How to change tooltip of a column chart programmatically in highchart
- How to do In highchart tooltip display the first 100 characters and then say "See more .."?
- how to use highcharts tooltip formatter in python code
- how to fix tooltip after highchart upgrade
- How to add a vertical plot line in multiple line series and show the tooltip on Plot line in highchart
- How to fix Highchart Sparkline tooltip not showing
- How to customize highchart box plot box
- How to customize tooltip styling in for Scatter plot in Highchart?
- How To Show Tooltip In Sparkline Chart From Code
- Customize Highchart tooltip
- How to remove decimal time at tooltip on React Highchart
- HighCharts - how to customize the tooltip for dynamically added series
- How to render Gantt Highchart from data source
- How to show dependencies' data in a tooltip in highchart gantt?
- Highchart spline Cut Off when reach to maximum scale value. How can it fixed?. I have attached may sample code on body
- Highchart - Area chart: customize tooltip
- How can i enable bootstrap tooltip in highchart
- How to customize Highchart graph similar to linkedin "Who's viewed your profile > Viewers found you from LinkedIn.com"
- how to hide highchart x - axis data values
- How to use the tooltip formatter and still display chart color (like it does by default)?
More Query from same tag
- Converted PHP code that built an array to JS and now highcharts doesn't work - what did I do wrong?
- highcharts: pie chart - reduce number of slice
- Highcharts-limit display of categories
- Difference in rendered SVG fetched from FirefoxDriver and HtmlUnitDriver
- Highchart 5: Pie Drilldown labels and back button not visible
- Highcharts: minorTickInterval doesn't work with specified categories
- Highcharts HeatMap cell color disappears when hover in Internet Explorer
- Highmaps: Panning programmatically
- Highcharts Legend issue: I Wanted to make Legend 100% width and text center align it works fine in crome but it is not aligned center in firefox
- How to plot line in highcharts on charts click event?
- How to show the name of which slice is clicked in high chart-piechart
- Highcharts stacked column: show total when a stack is hidden
- Dotted lines in highcharts.net
- How to change export button to custom icon in highcharts
- Calculate the 85th percentile for yAxis in highcharts
- Is it possible to dynamically refresh a HighCharts drilldown?
- How to have a solid as well as dashed line in line chart highcharts
- Maximum call stack size exceeded when trying to access highcharts via selenium
- How to make Highcharts legends focus on the chart that it belongs to?
- Highcharts line chart doesn't render when sql returns more than 121 rows
- JSON api timestamp + data parsing
- Highcharter: Add a string variable into a tooltip
- HighChart skipping x-axis years plot point
- ReactDOM.render into a <div> does not immediately produce HTML
- Remove gap between series in stacked column chart
- Highcharts angular wrapper labels.items don't refresh
- Change Highstocks.js Y axis value
- Add custom data on tooltip of Highcharts donut graph
- Highcharts - Multiple master charts in master detail charts
- Highcharts / Highstock - toggle yaxis from compare to value and back to compare