简体   繁体   English

大范围数据上的Highchart Bar不显示

[英]Highchart Bar on big range data dont show

I'm currently working on a web project for showing traffic usage in chart mode, and I'm using Highchart Bar for this project. 我目前正在一个Web项目中以图表模式显示流量使用情况,并且我正在将该项目使用Highchart Bar。 The problem is, when I run this code it doesn't give error at all 问题是,当我运行此代码时,它根本不会出错

 <script type="text/javascript">
    $(function () {
    $('#chart1').highcharts({
        chart: {
            type: 'column',
            margin: [ 50, 50, 100, 80]
        },
        title: {
            text: 'Sum of User'
        },
        xAxis: {
            categories: [
                'A','B','C','D',                ],
            labels: {
                rotation: -20,
                align: 'right',
                style: {
                    fontSize: '13px',
                    fontFamily: 'Verdana, sans-serif'
                }
            }
        },
        yAxis: {
            min: 0,
            title: {
                text: 'Total'
            }
        },
        legend: {
            enabled: false
        },
        tooltip: {
            formatter: function() {
                return '<b>'+ this.x +'</b><br/>'+
                    'User Values: '+ Highcharts.numberFormat(this.y, 1);
            }
        },
        series: [{
            name: 'sum',
            data: [
            3,5,1,1,                ],
            dataLabels: {
                enabled: true,
                rotation: 0,
                color: '#FFFFFF',
                align: 'center',
                x: 0,
                y: 17,
                style: {
                    fontSize: '14px',
                    fontFamily: 'Verdana, sans-serif'
                }
            }
        }]
    });
});
</script>

But when I'm increasing the data categories into A, B, C, D, E, F, and G with each categories values respectively: 2,1,1,17,1,43,6,5, the script doesn't show any graph at all. 但是,当我将数据类别分别增加为A,B,C,D,E,F和G时,每个类别的值分别为:2、1、1、1、17、1、43、6、5,脚本不会t根本不显示任何图形。 Any ideas? 有任何想法吗?

I dont think anything is wrong. 我不认为有什么问题。

 $(function () {
    $('#chart1').highcharts({
        chart: {
            type: 'column',
            margin: [ 50, 50, 100, 80]
        },
        title: {
            text: 'Sum of User'
        },
        xAxis: {
            categories: [
                'A','B','C','D','E','F','G'                ],
            labels: {
                rotation: -20,
                align: 'right',
                style: {
                    fontSize: '13px',
                    fontFamily: 'Verdana, sans-serif'
                }
            }
        },
        yAxis: {
            min: 0,
            title: {
                text: 'Total'
            }
        },
        legend: {
            enabled: false
        },
        tooltip: {
            formatter: function() {
                return '<b>'+ this.x +'</b><br/>'+
                    'User Values: '+ Highcharts.numberFormat(this.y, 1);
            }
        },
        series: [{
            name: 'sum',
            data: [
            2,1,1,17,1,43,6,               ],
            dataLabels: {
                enabled: true,
                rotation: 0,
                color: '#FFFFFF',
                align: 'center',
                x: 0,
                y: 17,
                style: {
                    fontSize: '14px',
                    fontFamily: 'Verdana, sans-serif'
                }
            }
        }]
    });
});

test the fiddle 测试小提琴

let me know your comments. 让我知道你的评论。

Please start with small data... 请从小数据开始...

Like first try to display A,B,C .. then A,B,C,D . 像首先尝试显示A,B,C ..然后显示A,B,C,D . .if success then add one more E .. 。如果成功,则再添加一个E ..

Do small steps then check at which point that graph does not show.. 进行一些small steps然后检查该图未显示的位置。

On this way may solve you problem. 这样可以解决您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM