我创建使用代表资产配置HighCharts金融饼图。 我的目标是创建一个代表每个切片,但每张幻灯片内的实际分配值将主要显示显示各种投资工具的目标百分比第二个数据标签的图表。 需要注意的是目前的资产配置可能并不总是与目标分配值相匹配是非常重要的。
我已经得到了一切,除了每张幻灯片内部的目标标签的工作。 见下面我想完成什么形象:
以下是我迄今:
var asset_allocation_pie_chart = new Highcharts.Chart({
chart: { renderTo: 'asset_allocation_bottom_left_div' },
title: { text: 'Current Asset Allocation', style: { fontSize: '17px', color: entity_color, fontWeight: 'bold', fontFamily: 'Verdana'} },
subtitle: { text: '(As of ' + effective_date_formatted + ')', style: { fontSize: '15px', color: entity_color, fontFamily: 'Verdana', marginBottom: '10px' }, y: 40 },
tooltip: { pointFormat: '{series.name}: <b>{point.percentage}%</b>', percentageDecimals: 0 },
plotOptions: {
pie: { allowPointSelect: true, cursor: 'pointer', dataLabels: { enabled: true, color: '#000000', connectorWidth: 1, connectorColor: '#000000', formatter: function() { return '<b>' + this.point.name + '</b>:<br/> ' + Math.round(this.percentage) + ' %'; } } }
},
series: [{
type: 'pie',
name: 'Asset Allocation',
data: [['Investment Grade Bonds', InvestmentGradeBondPercentage], ['High Yield Bonds', HighYieldBondPercentage], ['Hedged Equity', HedgedEquityPercentage], ['Global Equity', GlobalEquityPercentage], ['Cash', CashPercentage]]
}],
exporting: { enabled: false },
credits: { enabled: false }
});