문제

See jsfiddle - sum is not considering the 1st data point???

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

StackOverflow is making me add more to the description because too much of this post is code... StackOverflow is making me add more to the description because too much of this post is code... StackOverflow is making me add more to the description because too much of this post is code... StackOverflow is making me add more to the description because too much of this post is code... StackOverflow is making me add more to the description because too much of this post is code...

$(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
    }]
});

});

도움이 되었습니까?

해결책

This looks like a bug from the beta version that has been fixed in the full release. If you change the script tags to use the latest version it works fine. 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 Issue: https://github.com/highslide-software/highcharts.com/issues/1597

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top