我正在使用 java 脚本创建高图表,它们工作正常,但我希望连同答案变量,它们还应该显示百分比符号我有三个变量 ans66 ans67 和 ans68 我想要它们的值,它也应该显示 %
<script type="text/javascript">
$(document).ready(function() {
ans66=0;
ans67=0;
ans68=0;
ans69=0;
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container_1',
defaultSeriesType: 'column'
},
xAxis: {
categories: [''],
title: {
text: 'Revenue base on one trip/one 4-pack per year',
style: {
color: '#767575'
}},
labels: {
align: 'right',
style: {
font: 'normal 11px Verdana'
},
x: 24,
}
},
yAxis: {
min: 0,
startOnTick: false,
labels: {
formatter: function() {
return this.value;
},
style: {
color: '#767575'
}
},
title: {
text: '$',
style: {
color: '#767575'
}
}
},
series: [{
name: 'Revenue $',
data: [ans66]
}, {
name: 'Revenue $',
data: [ans67]
}, {
name: 'Revenue $',
data: [ans68]
}, {
name: 'Revenue $',
data: [ans69]
}]
});
});