Highcharts stacked bar minPointLength

我的未来我决定 提交于 2019-12-02 12:18:02

问题


I have two similar graphics, vertical and horizontal.

In these graphs there are small values at which the signature is not displayed, in the vertical to solve this problem, I applied MinPointLength to the series and everything became as it should.

I have horizontal stacked bar chart and some small value in it. If I set minPointLength to red series - then my series hide.

Before

After

Why in jsfiddle minPointLenght working, but in my situation - no? I place chart with gridster js. I want see all my series and labels, how I can do it?

Highcharts.chart('container', {
    chart: {
  		  height: 100,
        type: 'bar'
    },
    title: {
        text: null
    },

    credits: {
        enabled: false
    },

    navigation: {
        buttonOptions: {
            enabled: false
        }
    },

    xAxis: {
    		visible: false,
        categories: ['Activity'],
        lineWidth: 0,
        minorGridLineWidth: 0,
        lineColor: 'transparent',
        labels: {
    		enabled: false
  			},

    },
    yAxis: {
    		visible: false,
        min: 0,
        max:100,
        title: {
            text: ''
        },
        gridLineWidth: 0,
        minorGridLineWidth: 0,

    },


    legend: {
        enabled: false,
        reversed: true
    },
    plotOptions: {
        series: {
            borderWidth: 0,
            stacking: 'normal',
            pointWidth: 3,
            dataLabels: {
                format: '{y} % <br/> {series.name}',
                enabled: true,
                y: 2,
                verticalAlign: 'top',
                align: 'left',
                color: '#000000',

                style: {
                    textOutline: false
                }
            }
        }
    },
    series: [ {
        name: '2 series',
        data: [71],
        color: '#ff9f1c',
   
    },
    {
      
        name: '1 series',
        data: [28.5],
        color: '#44bba4',
   

    },
    
        {
       
        name: '0 series',
        data: [5.8],
        color: '#f45b69'
    },]
});
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>

<div id="container" style="min-width: 310px; max-width: 800px; height: 400px; margin: 0 auto"></div>

来源:https://stackoverflow.com/questions/47770182/highcharts-stacked-bar-minpointlength

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!