0

如果这些图表之一在 XAxis 上包含多个值(例如“数据”:[[52,1],[100,1]]),则它们之间的距离越大,列就越大。如何摆脱这个问题?

jsFiddle

$(function () {

    $('#container').highcharts({
        chart: {
            type: 'column',
        },
        xAxis: {
            title: {
                text: 'value'
            }
        },
        yAxis: {
            min: 0,
        },    
        legend: {
        },
        tooltip: {
        },
        plotOptions: {
            column: {
                 stacking: 'normal',          
            }
        },
        series: [{"name":"RunContractid = 316 name","stack":109,"data":[[52,1], [100,1]],"type":"column"},{"name":"RunContractid = 314 name","stack":109,"data":[[49,1]],"type":"column"},{"name":"RunContractid = 472 name","stack":109,"data":[[49,1]],"type":"column"},{"name":"RunContractid = 327 name","stack":109,"data":[[49,1]],"type":"column"},{"name":"RunContractid = 476 name","stack":109,"data":[[52,1]],"type":"column"},{"name":"RunContractid = 299 name","stack":109,"data":[[52,1]],"type":"column"},{"name":"RunContractid = 298 name","stack":109,"data":[[52,1]],"type":"column"},{"name":"RunContractid = 469 name","stack":109,"data":[[56,1]],"type":"column"},{"name":"RunContractid = 479 name","stack":109,"data":[[56,1]],"type":"column"},{"name":"RunContractid = 500 name","stack":109,"data":[[59,1]],"type":"column"},{"name":"RunContractid = 320 name","stack":109,"data":[[59,1]],"type":"column"},{"name":"RunContractid = 600 name","stack":109,"data":[[59,1]],"type":"column"},{"name":"RunContractid = 326 name","stack":109,"data":[[59,1]],"type":"column"},{"name":"RunContractid = 642 name","stack":109,"data":[[59,1]],"type":"column"},{"name":"RunContractid = 312 name","stack":109,"data":[[64,1]],"type":"column"},{"name":"RunContractid = 480 name","stack":109,"data":[[48,1]],"type":"column"}]
    });
});

找到解决方案 - 在空白点添加零。

4

1 回答 1

0

您可以设置pointWidth参数

http://api.highcharts.com/highcharts#plotOptions.column.pointWidth

编辑: PointRange解决问题http://jsfiddle.net/UMpBL/4/

plotOptions: {
        column: {
            pointRange:1,
            stacking: 'normal',
        }
    },
于 2013-10-07T12:37:23.747 回答