Highcharts 柱形图

效果图:


image.png
$(function () {
    var chart = $('#container').highcharts({
        chart: {
            type: 'column'
        },
        title: {
            text: '时长'
        },
        xAxis: {
            categories: [
                '0~30min',
                '30~120min',
                '大于2H'
            ],
            crosshair: true
        },
        yAxis: {
            min: 0,
            title: {
                text: '百分比(%)'
            },
            labels: {
                formatter: function () {
                    return this.value + '%'; // y轴加上%
                }
            }
        },
        credits: {
            enabled: false // 右下角图表版权信息不显示
        },
        tooltip: {
            headerFormat: '{point.key}',
            pointFormat: '' +
            '',
            footerFormat: '
{series.name}: {point.y:.1f} %
', shared: true, useHTML: true }, plotOptions: { column: { pointPadding: 0.2, borderWidth: 0 } }, series: [{ name: '东京', data: [49.9, 71.5, 106.4] }, { name: '纽约', data: [83.6, 78.8, 98.5] }, { name: '伦敦', data: [48.9, 38.8, 39.3] }] }); });

你可能感兴趣的:(Highcharts 柱形图)