首页 > 解决方案 > 图表 js 高度 100%

问题描述

我的图表高度有问题,我无法将高度设置为 100%,请在下面找到我的两个图表的图像 在此处输入图像描述

这是图表的选项

type: 'horizontalBar',
            data: chartdata,
            options:{
                responsive: true,
                maintainAspectRatio: true,
                aspectRatio: 1,
                animation: false,
                scaleSteps: 10,
                legend:{
                    display: false,
                },
                showAllTooltips: true,
                tooltips:{
                    enabled: false,
                },
                layout:{
                    padding:{
                        right: 70,
                    }
                },
                scales: {
                    xAxes: [{
                        position: 'top',
                        gridLines: {
                            lineWidth: 1,
                        },
                        scaleLabel: {
                            display: true,
                            labelString: 'Nombre de mouvement par outil',
                        },
                        ticks: {
                            min: 0,
                            stepSize: 1,
                        },
                    }],
                    yAxes: [{
                        barPercentage:0.9,
                        categoryPercentage:1,
                        gridLines: {
                            lineWidth: 1,
                        },
                        scaleLabel: {
                            display: true,
                            labelString: 'Identifiants outils',
                        },
                    }],
                },

我查看了所有我做不到的可能选项

标签: csschartschart.js

解决方案


推荐阅读