首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >海图中水平杆间的间距

海图中水平杆间的间距
EN

Stack Overflow用户
提问于 2018-10-12 00:10:33
回答 1查看 736关注 0票数 0

在我的水平条形图的高级图表配置中,当我添加自定义的pointWidth时,我不能更改两个条形图之间的距离。

请注意maxPointWidth: 8

代码语言:javascript
运行
复制
{
                chart: {
                    type: 'bar'
                },
                title: {
                    text: ''
                },
                xAxis: {
                    categories: ['Document', 'Image', 'Audio', 'CAD', 'Zip'],
                    title: {
                        text: 'File Type',
                        align: 'high',
                        offset: 0,
                        rotation: 0,
                        y: -10,
                        x: -15
                    },
                    lineColor: 'transparent',
                    minorTickLength: 0,
                    tickLength: 0,
                    labels: {
                        style: {

                        }
                    }
                },
                yAxis: {
                    opposite: true,
                    title: {
                        text: '# Files',
                        align: 'middle',
                        style: {
                            /* TODO: Modify styles to accommodate the bars header */
                            color: '#000000'
                        }
                    },
                    tickInterval: 2,
                    gridLineColor: 'transparent',
                    labels: {
                        enabled: false
                    }
                },
                tooltip: {
                    valueSuffix: ' millions'
                },
                plotOptions: {
                    bar: {
                        dataLabels: {
                            enabled: true
                        }
                    }
                },
                legend: {
                    layout: 'vertical',
                    align: 'right',
                    verticalAlign: 'top',
                    x: -40,
                    y: 80,
                    floating: true,
                    borderWidth: 1,
                    backgroundColor: ('#FFFFFF'),
                    shadow: true,
                    enabled: false
                },
                credits: {
                    enabled: false
                },
                series: [{
                    name: '',
                    data: [56, 30, 15, 11, 5],
                    maxPointWidth: 8
                }],
                colors: this.colors || defaultColors
            }

下面是工作的JS小提琴:https://stackblitz.com/edit/highcharts-angular-drilldown?file=app%2Fapp.component.ts

我想减少酒吧和标签之间的间隔,并保持maxPointWidth的完整。在这里输入图像描述

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-10-12 07:22:06

若要减少条形图之间的间距,请减少图表height

代码语言:javascript
运行
复制
chart: {
    type: 'bar',
    height: 200
}

现场演示:http://jsfiddle.net/BlackLabel/msph2uca/

API:https://api.highcharts.com/highcharts/chart.height

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52770474

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档