Highcharts: Ugly Candlesticks

别来无恙 提交于 2020-01-25 00:35:06

问题


My Candlestick chart imports data from a json file. Everything is great when I don't mess with the file

But when I use php to exclude some json rows to filter the data, I will end up with this even when every value on chart is correct.

How can I fix it?

My settings

(function () {
//    $.getJSON('https://www.highcharts.com/samples/data/jsonp.php?a=e&filename=aapl-ohlc.json&callback=?', function (data) {
            $.getJSON(<?php echo "'getJSON.php?symbol=" . $_GET["symbol"] . "&timeframe=" . $_GET["timeframe"] . "'"; ?>, function (data) {

        // create the chart
        $('#container').highcharts('StockChart', {
            rangeSelector : {
                selected : 1,
                                buttons: [{
                                    type: 'minute',
                                    count: 1,
                                    text: '1m'
                                }, {
                                    type: 'minute',
                                    count: 5,
                                    text: '5m'
                                }, {
                                    type: 'minute',
                                    count: 30,
                                    text: '30m'
                                }, {
                                    type: 'hour',
                                    count: 1,
                                    text: '1h'
                                }, {
                                    type: 'hour',
                                    count: 5,
                                    text: '5h'
                                }, {
                                    type: 'all',
                                    text: 'All'
                                }]
            },

            title : {
                text : <?php echo "'" . $_GET["symbol"] . " Price | " . $_GET["timeframe"] . "M'" ?>
            },

            series : [{
                type : 'candlestick',
                name : <?php echo "'" . $_GET["symbol"] . " Price'"; ?>,
                data : data,
                dataGrouping : {
                                    enable: false
                }
            }]
        });
    });
});

来源:https://stackoverflow.com/questions/34262803/highcharts-ugly-candlesticks

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!