duanmu5039 2015-01-21 17:42
浏览 32
已采纳

Highcharts json与coinbase

I want to make a coinbase chart :

$.getJSON("Getprice.php",   {},   function(data) {
        Price = data[1]['date'];

        $("#result").html(data[1]['date']);
        alert(Price);



    $('#container').highcharts({

        title: {
            text: 'July temperatures',
            type: 'datetime'
        },

        xAxis: {
            type: 'datetime'
        },

        yAxis: {
            title: {
                text: null
            }
        },

        tooltip: {
            crosshairs: true,
            shared: true,
            valueSuffix: '°C'
        },

        legend: {
        },

        series: [{
            name: 'Date',
            data: Price,
            zIndex: 1,
            marker: {
                fillColor: 'white',
                lineWidth: 2,
                lineColor: Highcharts.getOptions().colors[0]
            }
        }, {
            name: 'Range',
            data: data[2],
            type: 'arearange',
            lineWidth: 0,
            linkedTo: ':previous',
            color: Highcharts.getOptions().colors[0],
            fillOpacity: 0.3,
            zIndex: 0
        }]
    });
});

And the chart can't show up here's the coinbase url : https://www.coinbase.com/charts/price_history?days=365 I used in Getprice.php curl and header json just to get the page

  • 写回答

1条回答 默认 最新

  • dqba94619 2015-01-22 12:32
    关注

    A few clues

    • Your data should be JSON
    • date field should have name x, and time be timestamp (time in miliseconds)
    • value should have name y
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 UE5#if WITH_EDITOR导致打包的功能不可用
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
  • ¥20 yolov5自定义Prune报错,如何解决?
  • ¥15 电磁场的matlab仿真
  • ¥15 mars2d在vue3中的引入问题
  • ¥50 h5唤醒支付宝并跳转至向小荷包转账界面
  • ¥15 算法题:数的划分,用记忆化DFS做WA求调
  • ¥15 chatglm-6b应用到django项目中,模型加载失败