Customize tooltip and format the number to 2 decimal places of highcharts

You can use Format Strings to help you format numbers and dates. x Decimal Places View the JSFiddle // point.percentage = 29.9345816 pointFormat: ‘{point.percentage:.0f}%’ // returns: `30%` – (rounds to nearest) pointFormat: ‘{point.percentage:.1f}%’ // returns: `29.9%` pointFormat: ‘{point.percentage:.2f}%’ // returns: `29.93%` pointFormat: ‘{point.percentage:.3f}%’ // returns: `29.935%` Thousands separator View the JSFiddle // point.percentage = 1029.9 … Read more

How to use the tooltip formatter and still display chart color (like it does by default)?

I found the documentation for this (http://api.highcharts.com/highcharts#tooltip.pointFormat). The HTML they’re using is located under pointFormat, not formatter: <span style=”color:{point.color}”>\u25CF</span> {series.name}: <b>{point.y}</b><br/> Here’s the updated code to use to get the colored circles in the tooltip: tooltip: { formatter: function() { var s=”<b>”+ this.x +'</b>’; $.each(this.points, function(i, point) { s += ‘<br/><span style=”color:’ + point.color + … Read more

Reload chart data via JSON with Highcharts

The other answers didn’t work for me. I found the answer in their documentation: http://api.highcharts.com/highcharts#Series Using this method (see JSFiddle example): var chart = new Highcharts.Chart({ chart: { renderTo: ‘container’ }, 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] }] }); // the button action $(‘#button’).click(function() { chart.series[0].setData([129.2, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)