'How to round to two digits the data of the table that shows the information of the pareto chart

When displaying the data from the pareto chart in the table it shows it without rounding, I need it to stay in two digits.



Solution 1:[1]

You can edit data visible in data-table by exportData callback function. For example:

  chart: {
    events: {
      exportData: function({ dataRows }) {
        dataRows.forEach((row, i) => {
          if (i > 1) { // skip headers
            row[1] = row[1].toFixed(2);
          }
        });
      }
    }
  }

Live demo: https://jsfiddle.net/BlackLabel/tzb430u8/

API Reference: https://api.highcharts.com/highcharts/chart.events.exportData

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ppotaczek