score:1
Before you go head-desk-head-desk, while trying to format the percentage.
Here are some ways to do it:
(Math.round(this.point.percentage*100)/100) + ' %'
Highcharts.numberFormat(this.percentage, 1) + '%'
this.percentage.toFixed(1)
{point.percentage}% or {point.percentage:.1f}%
I often use #4 in tooltips and labels and when not using a custom formatter function.
score:2
For me the upvoted solution didn't work:
tooltip: {
formatter: function () {
return this.point.name + ': <b>' + Highcharts.numberFormat(this.percentage, 1) + '%</b>';
}
}
but this did:
this.percentage.toFixed(1)
score:14
A simpler solution is to use
{point.percentage:.1f}%
in the pointFormat string
score:16
Answering this question based on Billy Reverb's comment:
Just replace this attributes:
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage}%</b>',
percentageDecimals: 1
}
for this:
tooltip: {
formatter: function () {
return this.point.name + ': <b>' + Highcharts.numberFormat(this.percentage, 1) + '%</b>';
}
}
Source: stackoverflow.com
Related Query
- Highcharts Pie Chart ignores percentageDecimals tooltip setting and has floating point inaccuracy issue
- How to change Highcharts 3D Pie Chart Label and Tooltip Style?
- Highcharts - labels inside and outside a pie chart
- Highcharts connecting scatter chart and pie chart with single legend
- Highcharts - Bar - Setting the X axis width and the chart area width to be constant
- Highcharts custom renderer chart and tooltip
- display pie chart using highcharts api and mysql
- How to center highcharts pie chart and legend on a page?
- Tooltip in chart with line- and scatter plot in highcharts 3.0.7
- Show tootip and select pie slice on legend click of pie chart in HighCharts
- Highcharts - where to place style and changing style for one wedge in a pie chart
- Highcharts display label for pie chart using html table as data source
- Switch between pie charts and bar chart in highcharts
- Highcharts how to make a set number of colors for pie chart data and drilldown data
- Highcharts - column chart has space between bar and xAxis
- PIE CHART - Data Visualization With DataTables and Highcharts
- How to remove fine white line between halo and Highcharts pie chart
- Setting min and max for chart in Highcharts library error
- Server-side c# and client side javascript with json loading Highcharts gantt chart Task Progress Indicator, need to change Tooltip and Label name
- Combined Chart Highcharts Pie plus Bar grouppadding and pointapadding issue
- Highcharts - Can we have default and custom tooltip based on different chart types?
- Highcharts Pie chart how to reduce space between chart and legend caused by plot width
- Pie Chart tooltip thousand seperator and rtl labels doesn't work in highchart
- HighCharts Pie Chart - Displaying multiple series values in Tooltip
- Highcharts piechart with slice animation and drilldown on click together throws exception in chart and breaks the pie chart
- using a few data columns to plot chart and some to show on tooltip highcharts
- Position a Pie Chart inside a Highcharts Stockchart Tooltip
- How can I maintain the Highcharts halo effect on pie chart after click and mouseOut?
- Highcharts - Pie Chart - link in tooltip
- % not showing in tooltip pie chart highcharts angular js
More Query from same tag
- Highcharts legend font sizes
- displaying dates on x axis with Highcharts.js
- How to identify and format numbers with javascript
- HighCharts Highstock daily vertical grid lines showing on weekend
- Inner Margin on Highcharts Graph
- Double X-axis within same Highchart object
- How to select multiple points or markers programmatically in Highcharts?
- HighCharts box-plot: how to make it horizontal
- Hightcharts Display Date month on X-Axis
- Exporting Highcharts all data
- Add more charts in angular highcharts
- Can we get index from series data in highcharts
- Bind a function with dynamic arguments to Highcharts point
- Highcharts Unable to set value of the property 'point': object is null or undefined
- Redraw Highchart series method. Vuejs
- Using custom fonts with Highcharts
- Highcharts - Provide URL's for series data to open clickable link
- highcharts not displaying line when last point is before current x Axis minimum and next point is after current X Axis maximum
- Slider on barchart
- Get x and y value of a series in highcharts when curve is being plotted
- How to customize "Download CSV" functionality in HighCharts?
- What's the difference between 'legend' and 'showInLegend' in highcharts
- Highcharts Drawing a line with chart.renderer.path
- Can pdfmake generate mixed highcharts(SVG) and other html content?
- How to reduce the area around a highcart?
- HighCarts Pie not showing value in pie label
- R highcharter - adding total in tooltip
- Are there better interface to add Highcharts support to Zeppelin
- Highcharts column chart grouping
- The use of string argument in an "IF" statement