需要在highcharts中显示单个条的百分比

时间:2016-11-08 09:00:01

标签: javascript jquery highcharts

您需要帮助显示特定栏末端每个单独栏的总百分比值。我不知道如何完成这项工作以及从何处开始。请给我一个有助于获得输出的建议/解决方案。

请查看下图:enter image description here



$(function () {
    Highcharts.chart('container', {
        chart: {
            type: 'bar'
        },
        title: {
            text: ''
        },
        xAxis: {
            categories: ['Dec', 'Nov', 'Oct', 'SEP', 'AUG', 'JUL', 'JUN', 'May', 'APR', 'MAR', 'FEB', 'JAN']
        },
        yAxis: {
            min: 0,
			//labels:{enabled: false},
            title: {
                text: ''
            }
        },
        legend: {
            reversed: true
        },
		exporting: { enabled: false },
        plotOptions: {
            series: {
                stacking: 'normal'
            }
        },
		colors: ['#00c292', '#fec107', '#ff902d', '#dd1936'],
        series: [{
            name: '100%',
            data: [0, 18, 15, 17, 16, 17, 18, 21, 21, 19, 15, 14]
        }, {
            name: '90%',
            data: [0, 4, 6, 4, 4, 5, 6, 5, 7, 5, 7, 12]
        }, {
            name: '80%',
            data: [0, 3, 5, 6, 5, 3, 3, 2, 1, 3, 5, 2]
        }, {
            name: '< 80%',
            data: [0, 5, 4, 3, 5, 5, 3, 2, 1, 3, 3, 2]
        }]
    });
});
&#13;
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>
<div id="container" style="min-width: 500px; max-width: 800px; height: 400px;"></div>
&#13;
&#13;
&#13;

0 个答案:

没有答案