1
请参阅jsfiddle - 总和不考虑第一个数据点?highcharts瀑布不正确求和
的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
}]
});
});
固定。谢谢,斯科特。 – bramwell2010 2013-03-27 04:30:15