1

见 jsfiddle - sum 不考虑第一个数据点???

http://jsfiddle.net/Q3sPq/13/

StackOverflow 让我在描述中添加更多内容,因为这篇文章太多是代码...... StackOverflow 让我在描述中添加更多内容,因为这篇文章太多是代码...... StackOverflow 让我在描述中添加更多内容,因为这篇文章的代码太多了... StackOverflow 让我在描述中添加更多内容,因为这篇文章中有太多内容是代码... StackOverflow 让我在描述中添加了更多内容,因为这篇文章中有太多内容是代码...

$(document).ready(function () {
var div = 'container';
var data = new Array(100, -5, -8, -16, -10);
var xAxis = new Array("Attempts", "Declines", "Declines", "Approved", "User", "Processor", "net");
var chart = new Highcharts.Chart({
    chart: {
        type: 'waterfall',
        renderTo: div,
        width: 700,
        height: 275
    },

    title: {
        text: 'Percent '
    },

    xAxis: {
        type: 'category'
    },

    yAxis: {
        max: 100,
        min: 25,
        title: {
            text: 'Percent'
        }
    },

    legend: {
        enabled: false
    },
    credits: {
        enabled: false
    },

    tooltip: {
        pointFormat: '{point.y:,.1f}%'
    },

    series: [{
        upColor: Highcharts.getOptions().colors[2],
        color: Highcharts.getOptions().colors[3],
        data: [{
            name: xAxis[0],
            y: data[0],
            color: Highcharts.getOptions().colors[1]
        }, {
            name: xAxis[1],
            y: data[1]
        }, {
            name: xAxis[2],
            y: data[2]
        }, {
            name: xAxis[3],
            isIntermediateSum: true,
            color: Highcharts.getOptions().colors[1]
        }, {
            name: xAxis[4],
            y: data[3]
        }, {
            name: xAxis[5],
            y: data[4]
        }, {
            name: xAxis[6],
            isSum: true,
            color: Highcharts.getOptions().colors[1]
        }],
        dataLabels: {
            enabled: true,
            formatter: function () {
                return this.y + '%';
            },
        verticalAlign: 'top',
            style: {
                color: '#FFFFFF',
                fontWeight: 'bold'
            }
        },
        pointPadding: 0
    }]
});

});

4

1 回答 1

2

这看起来像是测试版中的一个错误,已在完整版本中修复。如果您更改脚本标签以使用最新版本,它可以正常工作。 http://jsfiddle.net/Q3sPq/14/

<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/highcharts-more.js"></script>

GitHub问题: https ://github.com/highslide-software/highcharts.com/issues/1597

于 2013-03-27T04:05:19.237 回答