• 'data.csv'


    $.get('data.csv', function(data) {
        // Split the lines
        var lines = data.split('\n');
       
        // Iterate over the lines and add categories or series
        $.each(lines, function(lineNo, line) {
            var items = line.split(',');
           
            // header line containes categories
            if (lineNo == 0) {
                $.each(items, function(itemNo, item) {
                    if (itemNo > 0) options.xAxis.categories.push(item);
                });
            }
           
            // the rest of the lines contain data with their name in the first position
            else {
                var series = {
                    data: []
                };
                $.each(items, function(itemNo, item) {
                    if (itemNo == 0) {
                        series.name = item;
                    } else {
                        series.data.push(parseFloat(item));
                    }
                });
               
                options.series.push(series);
       
            }
           
        });
       
        // Create the chart
        var chart = new Highcharts.Chart(options);
    });

    来自杭州西溪。主打Linux系统架构、维优、项目外包
  • 相关阅读:
    P1631-序列合并
    P1484-种树
    17.树的子结构(python)
    16.合并两个排序的链表(python)
    反转链表
    链表中倒数第k个节点(python)
    调整数组顺序使奇数位于偶数前面(python)
    Spark--wordcount(词频降序)
    数值的整数次方
    二进制中1的个数(python)
  • 原文地址:https://www.cnblogs.com/tinaleft/p/2867345.html
Copyright © 2020-2023  润新知