highchartsdotnethighcharts

Why doesn't a comma show up in my XLS file when it is shown on a chart?


I display a chart using Highcharts.Chart and the chart shows my values with a comma for the thousands separator. When I choose to download to XLS, via the HighCharts options menu on my chart, the data in XLS doesn't contain a comma. Is this something that just doesn't happen or what do I need to do to get the comma to be displayed in my XLS file as well.

Here a link to JSFiddler. In the example you can see the chart shows the data with the commas as thousands separators. If you click the download to XLS the commas are not shown in the XLS. I guess I'm expecting the data to be shown as it is in the chart. Can someone tell me if there is a way to show the commas in the XLS data?

Here is the JSFiddler code

HTML

<script src='https://code.highcharts.com/highcharts.js'></script>
<script src='https://code.highcharts.com/modules/exporting.js'></script>
<script src='https://code.highcharts.com/modules/export-data.js'></script>

<div id='container'></div>

Javascript

let options = {

  series: [{
    data: [1021, 1210, 933, 804, 904, 1004]
  }]
}
Highcharts.setOptions({
        lang: {
            thousandsSep: ','
        }
    });
  
Highcharts.chart('container', options)

Thanks


Solution

  • Microsoft Excel can’t force comma formatting across different regions, because it relies on each user’s system locale for number formats, so it's not possible to force a certain comma style from the Highcharts side.

    Reference: https://support.microsoft.com/en-us/office/change-the-character-used-to-separate-thousands-or-decimals-c093b545-71cb-4903-b205-aebb9837bd1e