Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/427.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Jqplot:为什么要渲染0条?_Javascript_Jquery_Jqplot - Fatal编程技术网

Javascript Jqplot:为什么要渲染0条?

Javascript Jqplot:为什么要渲染0条?,javascript,jquery,jqplot,Javascript,Jquery,Jqplot,我在jqplot中遇到了一个问题,堆叠的条形图有时会显示0的条形图。我不想要0的酒吧。所有与每个条相关的数字加起来就是最大值。下面是我看到的 问题在于MS/AL(27次停止)。有一个蓝色条,但该条表示0。但这种情况并不总是发生。实际上有第三种颜色可以显示在工具栏中,但本例中没有一种显示它 下面是一个点标签显示0(而不是hideZeros:true)的示例,只是为了证明0导致渲染条 以下是我的javascript: $.jqplot(div_id, customer_amount, {

我在jqplot中遇到了一个问题,堆叠的条形图有时会显示0的条形图。我不想要0的酒吧。所有与每个条相关的数字加起来就是最大值。下面是我看到的

问题在于MS/AL(27次停止)。有一个蓝色条,但该条表示0。但这种情况并不总是发生。实际上有第三种颜色可以显示在工具栏中,但本例中没有一种显示它

下面是一个点标签显示0(而不是hideZeros:true)的示例,只是为了证明0导致渲染条

以下是我的javascript:

$.jqplot(div_id, customer_amount, {
                            title:{
                                text: v.truck_label+' ('+v.count+' stops)',
                                textAlign: 'left'
                            },
                            animate: true,
                            stackSeries: true,
                            axesDefaults:{
                                showTicks: false,
                                tickOptions:{
                                    show: false,
                                    showTicks: false,
                                    showGridline: false
                                },
                                rendererOptions: {
                                    baselineWidth: 1.5,
                                    drawBaseline: false
                                }
                            },
                            seriesDefaults:{
                                renderer:$.jqplot.BarRenderer,
                                rendererOptions: {
                                    barDirection: 'horizontal',
                                    highlightMouseOver: false,
                                    //shadow: false
                                    shadowAngle: 35,
                                    shadowAlpha: 0.1,
                                    shadowDepth: 4
                                },
                                pointLabels: {
                                    show: true,
                                    formatString: '%d',
                                    hideZeros:true
                                }
                            },
                            axes: {
                                yaxis: {
                                    renderer: $.jqplot.CategoryAxisRenderer,
                                    showTicks: false,
                                    ticks: [''],
                                    tickOptions:{
                                        show: false,
                                        showGridline: false
                                    }
                                },
                                xaxis: {
                                    max: max,
                                    showTicks: false,
                                    tickOptions:{
                                        show: false,
                                        showGridline: false
                                    }
                                }
                            },
                            grid: {
                                drawGridLines: false,
                                drawBorder: false,
                                shadow: false,
                                borderColor: 'transparent',
                                background: 'transparent'
                            },
                            seriesColors: series_colors

});

有人知道发生了什么吗?有什么建议吗?

请看工作提琴

var options = {
        title: 'Title ',
        stackSeries: true,
        seriesColors: ["#eb4b3d", "#ffc800", "#009149"],
        seriesDefaults: {
            renderer: $.jqplot.BarRenderer,
            pointLabels: {
                show: true,
                hideZeros: true
            },
            rendererOptions: {
                barWidth: 25,
                varyBarColor: true,
            },
        },
        axes: {
            xaxis: {
                // renderer: $.jqplot.CategoryAxisRenderer,
                //  
                renderer: $.jqplot.CategoryAxisRenderer,
                ticks: ticks,
            },
            yaxis: {
                //autoscale: true,
                //label: 'Application Count',
                min: 0,
                tickInterval: 5,
                max: 50
            }
        },
        axesDefaults: {
            tickRenderer: $.jqplot.CanvasAxisTickRenderer,
            tickOptions: {
                angle: -30,
                fontSize: '10pt'
            }
        }
    };

将点标签:{show:true,formatString:'%d',hideZeros:true}替换为点标签:{show:true,hideZeros:true}将最小值:0应用于轴解决了此问题。谢谢你给我指明了正确的方向。很高兴我能帮上忙!你也能投赞成票吗?但愿我能。显然,我没有足够的声望去投票。