0

如何在面积图中添加渐变颜色。请帮忙。我需要图表的粉红色区域中的渐变。

以下是我的代码:

$(function () {
    $('#container').highcharts({

        chart: {
          type: 'area',
            animation: {
                duration: 1000
            }
        },
        xAxis: {
            categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
        },

        series: [{
            name: 'Dummy Data',
            data: [1, 2, 3, 4, 5, 4, 3, 2, 1, 2, 3, 4],
            color: 'pink'
        }]
    });
});
4

1 回答 1

4

请看示例http://www.highcharts.com/demo/line-time-series

编辑:

http://jsfiddle.net/sbochan/HkeXp/

fillColor: {
                    linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1},
                    stops: [
                        [0, '#ff0000'],
                        [1, '#f4f4f4']
                    ]
                },
于 2013-07-17T10:56:36.537 回答