2

我尝试使用两者来更改 jqplot 条形图之间的间距barMarginbarPadding但两者都没有帮助。请帮助我弄清楚我错过了什么。

让我知道一种减少每个条之间空间的方法。

<script>
        $(document).ready(function(){
    var line1 = [['Nissan', 4],['Porche', 6],['Acura', 2],['Aston Martin', 5],['Rolls Royce', 6],['Maserati',3],['Ferrari',3]];

    $('#chart3').jqplot([line1], {
        title:'Test with Custom Colors :)',
        // Provide a custom seriesColors array to override the default colors.
        seriesColors:['#3366cc', '#dc3912', '#ff9900', '#109618', '#ffc607'],
        seriesDefaults:{
            renderer:$.jqplot.BarRenderer,
            rendererOptions: {
                // Set varyBarColor to tru to use the custom colors on the bars.
                varyBarColor: true,
                barWidth: 25,
                barPadding:-10,
                barMargin: -10

            }
        },
        grid:{
           drawGridLines: true,       
           gridLineColor: '#000000',    
           background: '#ffffff',     
           borderColor: 'transparent',     
           borderWidth: 2.0,
           shadow:false,

        },
        tickOptions:{
        // markSize: 1,
        showMark: false,
        showGridline: false,
        },
        axes:{
            xaxis:{
                renderer: $.jqplot.CategoryAxisRenderer,
                 drawMajorGridlines: false
            }
        }
    });
});
    </script>
4

0 回答 0