맨위로가기
 

SBCHART

닫기

Legend Item

#latest  #options

범례 상자에서 타일(tile)의 크기를 변경합니다.

Options

Tile
  • legend.item.tile.width

    타일의 너비를 지정합니다.

  • legend.item.tile.height

    타일의 높이를 지정합니다.

Example

사용 가능 차트 :

Code

var chart = sb.chart.render("#chartWrap", {
    data: {
        type: "bar",
        columns: [
            ["2015",3.51,4.6,3.43,7.96,3.37,5.83,0.35,3.23,-0.09,4.47,2.21,1.13,0.77,0.35,0.92,2.65,1.64,8.08],
            ["2016",0.71,2.14,3.18,-1.84,0.79,0.35,0.28,0.44,0.79,0.84,1.33,-0.7,-1.51,0.09,1.05,-1.66,-0.58,4.63],
            ["2017",1.48,3.64,2.35,1.29,1.42,1.34,1.51,-1.08,4.29,1.67,2.4,-0.36,-0.53,1.98,2.23,-0.9,-1.62,1.66]
        ]
    },
    legend: {
        item: {
            tile: {
                height: 5,
                width: 20
            }
        }
    }
});
document.getElementById("txtTileW").value = chart.legend().item.tile.width;
document.getElementById("txtTileH").value = chart.legend().item.tile.height;

document.getElementById("txtTileW").onchange = function() {
    chart.legend().item.tile.width = this.value;
    chart.render();
};
document.getElementById("txtTileH").onchange = function() {
    chart.legend().item.tile.height = this.value;
    chart.render();
};