Kendo UI,如何删除条形图前后的空间?

时间:2014-07-31 22:39:37

标签: javascript jquery css kendo-ui kendo-dataviz

我试图在下面的Kendo UI图表之前和之后移除空间,没有运气。这是间隙和间距问题吗?我的目标是有一个单行条形图,灰色只出现在右边。

JSFiddle Codes Here

$(document).ready(allFamilyTicketsBarChartThisYear);

function allFamilyTicketsBarChartThisYear() {
    $("#chart-7").kendoChart({
        title: {
            visible: false,
        },
        legend: {
            visible: false,
        },
        chartArea: {
            height: 90,
            padding: 0,
            margin: 0,
            background: "transparent"
        },
        seriesDefaults: {
            type: "bar",
        },
        series: [
            {
                //gap: 0,
                //spacing: 0,
                //border: {
                //    width: 0
                //},
                // the above removes the height of the bar
                name: "monthThisYear",
                data: [506785]
            }
        ],
        valueAxis: {
            max: 1000000,
            labels: {
                visible: false
            },
            line: {
                visible: false
            },
            minorGridLines: {
                visible: false
            },
            majorGridLines: {
                visible: false
            }
        },
        categoryAxis: {
            line: {
                visible: false
            },
            minorGridLines: {
                visible: false
            },
            majorGridLines: {
                visible: false
            }
        },
        tooltip: {
            visible: false,
        }
    });
}

1 个答案:

答案 0 :(得分:1)

如果隐藏类别轴而不是网格线,它看起来就像我想的那样(http://jsfiddle.net/3VXqA/2/

 categoryAxis: {
         visible: false
 },