6

KendoUI の円グラフのサイズを小さくするにはどうすればよいですか? 次の構成を使用して円グラフを使用しています。マージンを 1 ピクセルに設定し、パディングを 1 ピクセルに設定しましたが、円グラフのレンダリング方法には影響がないようです。タイトルはありませんが、タイトルのスペースはまだあります。グラフの上部と、凡例と実際のグラフの間のスペースを縮小できるようにしたいと考えています。

私の構成:

jQuery("#chart").kendoChart({
//              theme: jQuery(document).data("kendoSkin") || "Metro",
            legend: {
                position: "bottom",
                padding: 1,
                margin: 1
            },
            seriesDefaults: {
                labels: {
                    visible: true,
                    template: "${ value }%"
                }
            },
            dataSource: {
                data: <%=ChartData%>
            },
            series: [{
                type: "pie",
                field: "percentage",
                categoryField: "source",
                explodeField: "explode"
            }],
            tooltip: {
                visible: false,
                template: "${ category } - ${ value }%"
            },
            title: { padding: 1, margin: 1 },
            seriesColors: ["#d15400", "#19277e", "#e2935e", "#d2d2d2"],
            chartArea: { margin: 1 },
            plotArea: { margin: 1 }
        });
4

2 に答える 2

17

円グラフのpaddingデフォルトは 60px です。円グラフの周りのスペースを減らす必要がある場合は、そのパディングを変更する必要があります。

...
series: [{
    type: "pie",
    field: "percentage",
    categoryField: "source",
    explodeField: "explode",
    padding: 0
}]
...
于 2012-02-23T09:03:33.270 に答える
2
$("#chart").kendoChart({
    theme: $(document).data("kendoSkin") || "default",
    title: {
        text: "Samplet"
    },
    seriesDefaults: {
        labels: {
            template: "#= kendo.format('{0:P}', percentage)#",
            visible: true
        }
    },chartArea: {
    width: 300,
    height: 300
},
    series: [{
        type: "pie",
        data: [{
            category: "Quality",
            value: 80},
        {
            category: "Time",
            value: 20},
        {
            category: "Cost",
            value: 40}]}],
    tooltip: {
        visible: true,
        template: "#= kendo.format('{0:P}', percentage)#"
    }

});

ここでは、円グラフのサイズを変更するための chartarea のプロパティを定義します。

于 2014-06-03T06:37:43.317 に答える