0

我有一个“面积”类型的比较图。我希望其中一个系列是区域,而其他系列是这样的一条线

![预期对比图][1] https://docs.google.com/file/d/0B9CP3yK--vZSRDVRUFFHeVhDQzQ/edit?usp=sharing

但是使用 highstock 我得到了这样的图表

无论如何要在图表上完全绘制该区域。

提前致谢。

编辑:-我使用了以下代码

$(function() {
var seriesOptions = [],
    yAxisOptions = [],
    seriesCounter = 0,
    names = ['MSFT', 'AAPL', 'GOOG'],
    colors = Highcharts.getOptions().colors;

$.each(names, function(i, name) {

    $.getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename='+ name.toLowerCase() +'-c.json&callback=?',   function(data) {
        if(name == 'AAPL'){
        seriesOptions[i] = {
            name: name,
            data: data,
            type : "area"
        };
        }else{
                seriesOptions[i] = {
            name: name,
            data: data,
            type : "line"
        };
        }

        // 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++;

        if (seriesCounter == names.length) {
            createChart();
        }
    });
});



// create the chart when all data is loaded
function createChart() {

    $('#container').highcharts('StockChart', {
        chart: {
        },

        rangeSelector: {
            selected: 4
        },

        yAxis: {
            labels: {
                formatter: function() {
                    return (this.value > 0 ? '+' : '') + this.value + '%';
                }
            },
            plotLines: [{
                value: 0,
                width: 2,
                color: 'silver'
            }]
        },

        plotOptions: {
            series: {
                compare: 'percent'
            }
        },

        tooltip: {
            pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b> ({point.change}%)<br/>',
            valueDecimals: 2
        },

        series: seriesOptions
    });
}

});

是我的小提琴

4

1 回答 1

0

您需要修改阈值参数。

于 2013-07-31T10:18:14.767 回答