我有一個繪製柱形圖的函數。我想向工具提示添加額外的信息。Highcharts的工具提示
這裏是我的功能
function arm_bar_graph(result){
$('#arms_graph').highcharts({
chart: {
type: 'column',
backgroundColor : '#fafafa',
height : 300,
},
title: {
text: 'Load Per Arm/Open Shipments'
},
subtitle: {
text: ''
},
xAxis: {
categories: result[0],
labels: {
rotation: -45,
align: 'right',
style: {
fontSize: '13px',
fontFamily: 'Verdana, sans-serif'
}
}
},
yAxis: {
min: 0,
title: {
text: ''
}
},
tooltip: {
headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
'<td style="padding:0"><b>{point.y}</b></td></tr>',
footerFormat: '</table>',
shared: true,
useHTML: true
},
credits: {
enabled: false
},
series: [{
data: result[1],
name : 'Open Shipments',
},
]
});
}
結果是
[
[
u'Arm1',
u'Arm10',
u'Arm2',
u'Arm3',
u'Arm4',
u'Arm5',
u'Arm6',
u'Arm7',
u'Arm8',
u'Arm9'
],
[
10,
8,
9,
7,
6,
5,
4,
3,
2,
1
],
{
u'Arm10': {
'bags_closed_per_arm': 0,
'total_pptls_per_arm': 40,
'last_bagged_on_arm_time': 'NoBagsclosedinthisinterval.',
'total_shipments_per_arm': 0,
'bags_open_per_arm': 0,
'last_packet_scan_arm_time': 'NoShipmentscannedonthisarm.'
},
u'Arm8': {
'bags_closed_per_arm': 0,
'total_pptls_per_arm': 24,
'last_bagged_on_arm_time': 'NoBagsclosedinthisinterval.',
'total_shipments_per_arm': 0,
'bags_open_per_arm': 0,
'last_packet_scan_arm_time': 'NoShipmentscannedonthisarm.'
},
u'Arm9': {
'bags_closed_per_arm': 0,
'total_pptls_per_arm': 19,
'last_bagged_on_arm_time': 'NoBagsclosedinthisinterval.',
'total_shipments_per_arm': 0,
'bags_open_per_arm': 0,
'last_packet_scan_arm_time': 'NoShipmentscannedonthisarm.'
},
u'Arm6': {
'bags_closed_per_arm': 0,
'total_pptls_per_arm': 0,
'last_bagged_on_arm_time': 'NoBagsclosedinthisinterval.',
'total_shipments_per_arm': 0,
'bags_open_per_arm': 0,
'last_packet_scan_arm_time': '1970-01-0100: 00: 00+00: 00'
},
u'Arm7': {
'bags_closed_per_arm': 0,
'total_pptls_per_arm': 22,
'last_bagged_on_arm_time': 'NoBagsclosedinthisinterval.',
'total_shipments_per_arm': 0,
'bags_open_per_arm': 0,
'last_packet_scan_arm_time': 'NoShipmentscannedonthisarm.'
},
u'Arm4': {
'bags_closed_per_arm': 0,
'total_pptls_per_arm': 0,
'last_bagged_on_arm_time': 'NoBagsclosedinthisinterval.',
'total_shipments_per_arm': 0,
'bags_open_per_arm': 0,
'last_packet_scan_arm_time': '1970-01-0100: 00: 00+00: 00'
},
u'Arm5': {
'bags_closed_per_arm': 0,
'total_pptls_per_arm': 24,
'last_bagged_on_arm_time': 'NoBagsclosedinthisinterval.',
'total_shipments_per_arm': 0,
'bags_open_per_arm': 0,
'last_packet_scan_arm_time': 'NoShipmentscannedonthisarm.'
},
u'Arm2': {
'bags_closed_per_arm': 0,
'total_pptls_per_arm': 10,
'last_bagged_on_arm_time': 'NoBagsclosedinthisinterval.',
'total_shipments_per_arm': 0,
'bags_open_per_arm': 0,
'last_packet_scan_arm_time': 'NoShipmentscannedonthisarm.'
},
u'Arm3': {
'bags_closed_per_arm': 0,
'total_pptls_per_arm': 24,
'last_bagged_on_arm_time': 'NoBagsclosedinthisinterval.',
'total_shipments_per_arm': 0,
'bags_open_per_arm': 0,
'last_packet_scan_arm_time': 'NoShipmentscannedonthisarm.'
},
u'Arm1': {
'bags_closed_per_arm': 0,
'total_pptls_per_arm': 40,
'last_bagged_on_arm_time': 'NoBagsclosedinthisinterval.',
'total_shipments_per_arm': 0,
'bags_open_per_arm': 0,
'last_packet_scan_arm_time': 'NoShipmentscannedonthisarm.'
}
}
]
我想更多的信息添加到其包含在結果中提供的字典中的提示。我怎樣才能做到這一點?目前工具提示顯示Y軸值,即結果[1]值。
如何從字典中添加值?