从Highbase for Highcharts.JS中提取数据

时间:2014-11-14 20:49:52

标签: javascript jquery html highcharts

好吧我正在尝试使用highcharts创建基本条形图,我正在尝试使用QuickBase数据库中包含的数据,我已经设法从服务器中提取数据,我使用了API调用并拥有数据使用此

http://pastebin.com/fJry1jA8

    <!Doctype html>         
    <html>         
    <head>
    </head>         
    <body>
    <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.js"></script>
    <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
    <script type="text/javascript" src="https://code.highcharts.com/highcharts.js"></script>
    <script type="text/javascript" src="https://code.highcharts.com/highcharts.src.js"></script>
    <script type="text/javascript" src="https://code.highcharts.com/highcharts-more.js"></script>
    <script type="text/javascript" src="https://code.highcharts.com/highcharts-more.src.js"></script>
    <script type="text/javascript" src="https://code.highcharts.com/modules/exporting.js"></script>
    <script type="text/javascript" src="https://code.highcharts.com/modules/exporting.src.js"></script>         

    <script>         
    var dbidApplication = "-EDITED OUT-";
    var dbidTable = "-EDITED OUT-";
    var apptoken = "-EDITED OUT-";

    $.ajaxSetup({data: {apptoken: apptoken}});

    var promise1 = $.get(dbidApplication , {
      a: "dbpage",
      pagename: "chart.html"
    });         

    var promise2 = $.get(dbidTable, {
      act: "API_GenResultsTable",
      query: "{14.EX.'_FID_9}",
      clist: "7.24.25.26.27.28.29.30.31.32.33.34.35.36.37",
      jsa: 1,
      options: "num-1",
    });         

    $.when(promise1, promise2).then(function(chartArgs, dataArgs) {
      var chart = chartArgs[0];
      var markup = new Highcharts.Chart(chart, qdb_data);
      console.log(markup);
    });

    </script>    

     <div id="container" style="width:100%; height:400px;"></div>  

<script>    
    $(function () { 
        $('#container').highcharts({
            chart: {
                type: 'bar',
         renderTo: 'container',
            },
            title: {
                text: 'Fruit Consumption'
            },
            xAxis: {
                categories: ['Apples', 'Bananas', 'Oranges']
            },
            yAxis: {
                title: {
                    text: 'Fruit eaten'
                }
            },
            series: [{
            name: 'Jane',
            data: [1, 0, 4]
        }, {
                name: 'John',
                data: [5, 7, 3]
            }]
        });
    });

    </script>    
    </body>
    </html>

我查了一下人们告诉我的例子,但是现在我很困惑被告知我需要解析,采摘,获取,以及其他一些我不知道要研究的东西的列表所以我实际上可以使用这些数据,但我正在寻找实际发生的事情的解释(我真的不觉得看到一堆代码,其中一半我不理解,因为我还没学会那,它相当令人沮丧)

0 个答案:

没有答案