score:7
i'm not quite sure how this override happens, but as you mention the tooltip.formatter
takes precedence. instead of using tooltip.formatter
move the same function to plotoptions.series.tooltip.pointformatter
. this should work as you expect, with the plotoptions
pointformatter
being used in general and your series
pointformatter
being used in the specific cases.
for example (jsfiddle):
plotoptions: {
series: {
tooltip: {
pointformatter: function () { return 'default ' + this.x + '</b> is <b>' + this.y + '</b>'; }
}
}
},
series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
tooltip: {
pointformatter: function () { return 'custom format...'; }
}
}]
score:3
to avoid the overwrite you need to use option headerformat for the chart tooltip and define point format for the individual series
https://api.highcharts.com/highcharts/tooltip.headerformat
the syntax is a bit different but at least it provides basic formatting options
let's say you want custom date format and manipulate font size and color,
your code should look like this:
highcharts.chart('container', {
tooltip: {
valuesuffix: '',
xdateformat: '%a, %b %e at %l:%m %p',
headerformat: '<span style="font-size: 14px; font-weight: 500; color: #8995a0;">{point.key}</span>',
},
...
}
... and for certain series, specify a modified formatter:
series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
tooltip: {
pointformatter: function () { return 'custom format...'; }
}
},
...
]
Source: stackoverflow.com
Related Query
- Change Highcharts tooltip formatter from chart Object , after chart is rendered
- how to use highcharts tooltip formatter in python code
- Format Highcharts chart tooltip pointFormat in formatter
- Highcharts column chart returning incorrect series index on click when using shared tooltip
- How to hide Series Name in HighCharts Tooltip when using pointFormatter
- HighCharts Pie Chart - Displaying multiple series values in Tooltip
- How to use the tooltip formatter and still display chart color (like it does by default)?
- Highcharts tooltip formatter
- Weird character in front of Highcharts tooltip series names
- Display tooltip for invisible series in Highcharts
- How can I use chart tooltip formatter in react-highcharts?
- Highcharts Pie Chart ignores percentageDecimals tooltip setting and has floating point inaccuracy issue
- Highcharts - How to hide series name and Y value in tooltip
- highcharts - chart names for multiple pie chart series in one chart
- Highchart/stock tooltip formatter for both series and flags
- Highcharts - best way to handle and display zero (or negative) values in a line chart series with logarithmic Y axis
- Show value of last point as label or tooltip on Highcharts Stock Chart
- Highcharts - Scatter chart with a line connecting the dots in the series
- Highcharts shared tooltip for line series and scatter plot not working
- Show HighCharts tooltip when chart loads
- Highcharts custom renderer chart and tooltip
- How to hide one series data info in tooltip using highcharts
- Highcharts 3.0, area chart with stacked and unstacked series - how to fix?
- Highcharts add tooltip that has a small arrow pointing toward the series
- HighCharts tooltip appearing behind the dialog holding the chart
- Highcharts JS- add third variable to tooltip for two series
- Highcharts - Remove first marker from Area chart in every series
- Highcharts - Area Chart - Stacking with series containing negative and positive values
- unable to get series id in HighCharts chart
- Highcharts stock chart - Technical Indicators - Stock price is missing in the tooltip when selecting the 'All' range
More Query from same tag
- Highstock Navigator always starts from 1970-1-1
- Pie chart: image exporting cutting off labels
- Is it possible to change background color of highcharts?
- To show difference between two bars in high charts?
- Chart is not rendered and throws script error, if yaxis contains null dateTime data and useUTC is false
- high chart- how to add array in custom dataLabels formatter
- rChart, for loop
- How do I setup Individual Column color for each Column (HighStock/HighChart)
- Highcharts-ng with drilldown
- Get Value of visibility of series
- Highcharts not printing the line when there is empty data in the beginning
- Highcharts inactive state must be applied to all items except for hovered item
- Process SQL to JSON through PHP for Bubble Chart
- how to set xAxis pointInterval(update: tickInterval) in highcharts
- Rendering the charts as columnrange type
- Angular-highcharts colors. Is there any way to get color besides Highcharts.getOptions().colors[index]?
- Highcharts-ng directive (Angular) not updating
- Add different symbols to highcharts chart with dynamic data
- how to center highcharts at the middle
- Combine xAxis Highcharts
- how to set fieldnames in high chart?
- Is there a way of dynamically toggling the Highstock navigator to regain vertical space for the chart?
- Highcharts Bar Graph's Tool Tip Point Format
- How to draw a pie with logarithmic scale in HighCharts?
- How set options from HIGHCHARTS in a chart using vue chartkick
- Highcharts use legend symbol and legend parms, not scatter marker symbols - in scatter plot
- How to set xAxis minimum and maximum values on Highstock?
- Is there a way of implementing shades of colors in treemap for childs of specific parent
- Setting highcharts datalabels backgroundColor with the same color of its serie
- How to change json jackson format for highcharts json