score:16
The formatter function doesn't seem to work when it's defined for a series. You can check which series you are in by using this.series.name and then you can check if you are on the final point using this.series.xData.length - 1 == this.point.x. But, it would be easier to name the point that you want to target and check for that in the formatter function. http://jsfiddle.net/Swsbb/. To see all the formatter data, check here http://api.highcharts.com/highcharts#tooltip.formatter.
$('#container').highcharts({
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul']
},
tooltip : {
formatter: function() {
var tooltip;
if (this.key == 'last') {
tooltip = '<b>Final result is </b> ' + this.y;
}
else {
tooltip = '<span style="color:' + this.series.color + '">' + this.series.name + '</span>: <b>' + this.y + '</b><br/>';
}
return tooltip;
}
},
series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, {y:135.6, name: 'last'}]
},
{
data: [194.1, 95.6, 54.4, 29.9, 71.5, 106.4, 129.2]
}]
});
Source: stackoverflow.com
Related Query
- highcharts customize tooltip for a single point
- create a sticky tooltip for a point or a permanent label using HighCharts
- Highcharts - how to set custom content in point tooltip (popup) on 3D scatter chart or how to customize point tooltip information?
- Changing backgroundcolor of tooltip for a specific data point in Highcharts
- show tooltip for each point of highcharts network graph in Angular
- Custom color & tooltip for a single bar in Highcharts histogram
- Highcharts tooltip for single series always centre. Can I force it to be left hover of the marker?
- Custom data label for a single point in OHLC candlestick in Highcharts
- Highcharts; disabling the tooltip for a single point renders a random little box
- HighCharts - how to customize the tooltip for dynamically added series
- Highcharts - How to show two tooltips for single point at different positions of chart?
- Make Highcharts tooltip show info for closest point to the left (i.e. not change at midpoint)
- Customize tooltip and format the number to 2 decimal places of highcharts
- customize highcharts tooltip to show datetime
- Display tooltip for invisible series in Highcharts
- Adding thousands separator for custom formatted highcharts tooltip
- Highcharts highlight single point on line
- Highcharts Pie Chart ignores percentageDecimals tooltip setting and has floating point inaccuracy issue
- Highcharts - only show tooltip when hovering directly on point
- Highcharts - Draw Crosshairs / Tooltip on Mouse Position Instead of Snapping to Data Point
- Highcharts - How to remove connecting line between fixed tooltip and point
- Tooltip text alignment in Highcharts for 'direction: rtl'
- Show value of last point as label or tooltip on Highcharts Stock Chart
- Highcharts shared tooltip for line series and scatter plot not working
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- Highcharts - xAxis label for each point
- Highcharts : Shared Tooltip for non-matching x values
- How to customize the crosshair Line for Highcharts
- How to get next point in Highcharts tooltip
- Highcharts JS- add third variable to tooltip for two series
More Query from same tag
- Highcharts - Gantt Chart plot issue
- Logarithmic axis not showing appropriate ticks for small numbers
- Highstocks - Use tickmarkPlacement "between" on datetime Axis (no categories)
- Highcharts not displaying data labels for Pie chart in arabic
- Highcharts accessibility / VUE.js
- highcharts render does not match grid in docraptor rendered pdf
- React Native Highcharts call method
- Build highcharts from oracle with html, java, json
- Highcharts Pyramid - same size of segments - despite the data value
- Highcharts add image on export
- highcharts line chart passing in x values
- Highcharts not plotting Date string as Category
- Highcharts loading data from a HTML table with a title
- jquery highcharts multiline mvc asp.net
- Highcharts point click event returns "hover" state instead of "select" state
- Highcharts(highstock) line chart Tooltip shows previous date
- Adding space between Navigation bar and legend in pie chart(highcharts)
- How to export a python-highcharts chart for use in flask or django?
- Need assistance adding an additional series to a Highcharts graph using a SharePoint list and PSServices
- Highstock graph shows points instead of line at certain zoom levels
- Highcharts version 3 type definitions for typescript
- Highcharts - How to show x-axis with incomplete data?
- HighCharts performance degrades dramatically with 'chart' and 'renderer' together
- primefaces chart x axis
- Draw something under highstock chart navigator
- Highchart Heatmap: Why only every second datavalue is displayed?
- R highcharter legend based on point color
- Showing only the first custom label. Highcharts
- Highchart columnrange, color code lines based on data
- My Highchart is stepping back to 01/18/1970 everytime. Why?