score:14
Unfortunately that's not possible, I am afraid: the default tooltip formatters are somewhat hidden inside the Point
and Tooltip
objects and do not provide access to the number formatting.
However, you may want to globally override the default implementation of a Point
's tooltipFormatter
with something of your own, e.g.
Highcharts.Point.prototype.tooltipFormatter = function (useHeader) {
var point = this, series = point.series;
return ['<span style="color:' + series.color + '">', (point.name || series.name), '</span>: ',
(!useHeader ? ('<b>x = ' + (point.name || point.x) + ',</b> ') : ''),
'<b>', (!useHeader ? 'y = ' : ''), Highcharts.numberFormat(point.y, 0), '</b>'].join('');
};
This implementation is the same as the default one except for the Highcharts.numberFormat
call on the last line, which will do your number formatting.
Keep in mind that such a change will apply to all your charts.
score:-1
The way to apply Math.round()
function inside the highchart script.
series: [{
type: 'pie',
name: 'CPU (GHz)',
data: [
['Used',Math.round( <?php echo $gSum_Allocated_CPU; ?>, 2)],
{
name: 'Available',
y:Math.round(<?php echo $gSum_Available_CPU; ?>, 2),
sliced: true,
selected: true
}
]
}]
score:1
Since 2.2 there is a new option "pointFormat" to specify a separate formater for the pointvalues only: http://api.highcharts.com/highcharts#tooltip.pointFormat
score:3
Use pointFormatter
to format shared tooltip. This is available since version 4.1.0:
tooltip: {
shared: true,
pointFormatter: function() {
return '<span style="color:' + this.series.color + ';">●</span> ' + this.series.name + ': <b>' + numberFormat(this.y) + '</b><br/>';
}
}
Source: stackoverflow.com
Related Query
- HighChart Shared Tooltip Number Formatting
- Highcharts Tooltip formatting for shared Tooltips
- Tooltip is not hidden after formatting in highchart
- Shared tooltip on multiple charts not formatting correctly
- Customize tooltip and format the number to 2 decimal places of highcharts
- How to display highchart series line marker symbol from tooltip formatter?
- Number Formatting at Highcharts Chart Values?
- Highcharts: Shared tooltip formatter this.points[i]
- adapting text to highchart tooltip max width
- Highcharts shared tooltip requires different valueSuffix and varying decimals
- Adding new data to highchart tooltip
- HighCharts: Use shared tooltip only when series overlap
- highchart total in tooltip
- Scatter tooltip of highchart is not being displaying
- Border Styles for the Highchart tooltip
- Highcharts shared tooltip for line series and scatter plot not working
- Commas in tooltip of Highchart
- Adding a custom tooltip to a bubble chart / highchart
- Formatting datetime in Highcharter tooltip
- Highchart - tooltip for legends
- Highcharts : Shared Tooltip for non-matching x values
- Highcharts tooltip using HTML allows advanced formatting like images
- Highchart donut pie - Is there a max number of slices
- Building dynamic number of arrays to display in Highchart
- HighChart Tooltip Position can be changed?
- Highchart tooltip position to be fixed
- Highcharts shared tooltip between charts with multiple series and shared tooltip
- Tooltip covering bar in highchart
- Dynamically update tooltip date format highchart
- Display percentage on tooltip highchart Angular 2
More Query from same tag
- Highchart tooltip & events from external function
- Accessing an element of an array according to a variable for a HighCharts object
- highcharts Scatter Chart not loading with LOTS of data
- How to display percentage along with Count value in Pie chart Using Higcharts Plugin?
- Highcharts renderer: fill colour of embedded SVG image
- Highchart's selection-function updating with delay
- Highcharts.js How to put current time label in the end of xAxis
- highcharts multiline text inside donut piechart
- HighCharts - How can I turn off the points?
- getSelectedPoints array delay problem in HighCharts
- Highcharts animation with color blending
- Highchart highlight area between points with custom colors
- Error: Template parse errors: Can't bind to 'options' since it isn't a known property of 'chart'
- Set a maximum for data grouping in Highstock charts to prevent from grouping
- Highcharts prevent xAxis Labels hidden
- Highcharts - margin top to yAxis label
- HighCharts BoxPlot With Multiple Series Having Single Data
- Highcharts tooltip is hidden behind other charts
- Highcharts : How to update Plotoptions pointStart on Ajax call?
- For higher number of data in time series highchart calculates average value
- How can i use double click in Highcharts and get that data
- Highstock - How to handle large data sets
- How can I show only one x-axis in synchronous chart highchart
- Highchart: stacked grouped column
- Chart update everytime on Loading second array : Highcharts, Javascript
- Configure Data Table at bottom in Highcharts
- How to add percent symbol with data inside column in highchart?
- Highcharts : How to flag the local maxima on a dynamic graph drawn using HighChart
- HIghcharts column tickmarks not aligned to column
- Double X-axis within same Highchart object