Jquery 海图可以';不能用逗号读取数据

Jquery 海图可以';不能用逗号读取数据,jquery,highcharts,Jquery,Highcharts,我在从数据库中提取的金额上添加逗号时遇到问题 我添加了“commaSeparateNumber函数”,我可以工作,但问题是Highcharts不能用逗号读取数字。我尝试过使用parsefloat,但对我无效。以下是我的功能: function Filltbl(data) { $.each(data, function () { var html = "<tr><td&g

我在从数据库中提取的金额上添加逗号时遇到问题

我添加了“commaSeparateNumber函数”,我可以工作,但问题是Highcharts不能用逗号读取数字。我尝试过使用parsefloat,但对我无效。以下是我的功能:

  function Filltbl(data) {

                        $.each(data, function () {
                            var html = "<tr><td>" + this.SampleNo + "</td><td>" + this.SC_Com + "</td><td>" + this.SC_AP + "</td><td>" + this.SC_Cer + "</td><td>" + this.SC_Pd + "</td></tr>";
                            $('#datatable').append(commaSeparateNumber(html));

                        });                   
                    }
  function commaSeparateNumber(val) {
                while (/(\d+)(\d{3})/.test(val.toString())) {
                    val = val.toString().replace(/(\d+)(\d{3})/, '$1' + ',' + '$2');
                }
                return val;
            }
这是我从Highcharts得到的信息:

Highcharts Error #14

String value sent to series.data, expected Number

This happens if you pass in a string as a data point, for example in a setup like this:

series: [{
    data: ["3", "5", "1", "6"]
}]
Highcharts expects the data values to be numbers. The most common reason for this is that data is parsed from CSV or from a XML source, and the implementer forgot to run parseFloat on the parsed value.

For performance reasons internal type casting is not performed, and only the first value is checked (since 2.3).

您能在代码中添加一个JSFIDLE吗?获得这样的帮助要容易得多。此外,您的
数据
数组需要有数字,而不是字符串。例如:[1,2,3,4]而不是[“1”、“2”、“3”、“4”]是的,我有过。=它工作得很好。我唯一的问题是,当我使用commaseparated函数时,我的HIghChart不会显示。您能否添加一个运行代码的JSFIDLE,以便我们看到它在哪里失败?您在哪里使用
parsefloat
,为什么它对您不起作用。我在您的代码中找不到任何
parsefloat