zoukankan      html  css  js  c++  java
  • Highstock 演示 › 导航器包含多数据列

    $(function () {
        var seriesOptions = [],
            seriesCounter = 0,
            names = ['MSFT', 'AAPL', 'GOOG'];
        /**
         * Create the chart when all data is loaded
         * @returns {undefined}
         */
        function createChart() {
            $('#container').highcharts('StockChart', {
                rangeSelector: {
                    selected: 4
                },
                yAxis: {
                    labels: {
                        formatter: function () {
                            return (this.value > 0 ? ' + ' : '') + this.value + '%';
                        }
                    },
                    plotLines: [{
                        value: 0,
                         2,
                        color: 'silver'
                    }]
                },
                plotOptions: {
                    series: {
                        compare: 'percent',
                        showInNavigator: true
                    }
                },
                series: seriesOptions
            });
        }
        $.each(names, function (i, name) {
            $.getJSON('http://datas.org.cn/jsonp?filename=json/' + name.toLowerCase() + '-c.json&callback=?',    function (data) {
                seriesOptions[i] = {
                    name: name,
                    data: data
                };
                // As we're loading the data asynchronously, we don't know what order it will arrive. So
                // we keep a counter and create the chart when all the data is loaded.
                seriesCounter += 1;
                if (seriesCounter === names.length) {
                    createChart();
                }
            });
        });
    });
  • 相关阅读:
    hortonworks
    使用Ambari快速部署Hadoop大数据环境
    js模板引擎
    Scala中的语言特性是如何实现的2
    IOS多线程编程一:概述
    Struts框架
    总体设计
    算法介绍
    社区与关怀
    从C#的Singleton设计模式
  • 原文地址:https://www.cnblogs.com/onetwo/p/6150037.html
Copyright © 2011-2022 走看看