繁体   English   中英

jqplot不在条形图上显示值的标签

[英]jqplot not display label of value on bar chart

我尝试使用jqplot绘制条形图,但发现图形中第一个条形存在问题,它不显示点标签。 如何解决这个问题呢? 感谢您的帮助和建议。

洛卡奥 在此处输入图片说明

对不起,我忘了。

<script type="text/javascript">
$(document).ready(function() {
        var s1 = [32100,0,0,990000,0,0,0,0,0,0,0,0];
        var s2 = [36000,0,0,1800,0,4980,0,0,0,0,0,0];
        var s3 = [0,0,0,0,0,0,0,0,0,0,0,0];
        var ticks = ['1 2013','2 2013','3 2013','4 2013','5 2013','6 2013','7 2013','8 2013','9 2013','10 2013','11 2013','12 2013'];
            $('#show-graph').css('height', '699px').jqplot([s1, s2, s3], {
                title:'รายจ่าย',
                seriesDefaults:{
                    renderer:$.jqplot.BarRenderer,
                    rendererOptions: {
                        barWidth: 20,
                        barMargin: 10
                    },
                    pointLabels: {
                        show: true, 
                        formatString: "%#.2f", 
                        hideZeros: true
                    }
                },
                axes:{
                    xaxis:{
                        renderer: $.jqplot.CategoryAxisRenderer,
                        tickRenderer: $.jqplot.CanvasAxisTickRenderer ,
                        tickOptions: {
                           fontFamily: 'Georgia',
                           fontSize: '10pt',
                           angle: -30,
                           labelPosition: 'middle'
                        },
                        ticks: ticks
                    },
                    yaxis: {
                        min: 0
                    }
                },
                legend: {
                    show: true,
                    location: 'ne',
                    placement: 'insideGrid'
                },
                series:[
                    {label: 'beverage'},
                    {label: 'equipment'},
                    {label: 'another'}
                ]
            });
});

这是因为最左边的条形太靠近边缘,因此jqPlot不会渲染它。 尝试增加宽度。

$jqplot('show-graph', [s1, s2, s3], {
    title: 'xxxx',
    width: 1000,
    ....
}

暂无
暂无

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

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