Size
#latest
#options
차트의 크기 및 여백을 지정합니다.
크기를 따로 지정하지 않는다면 차트가 그려지는 영역(컨테이너) 크기에 맞춰집니다.
Options
Example
Code
var chart = sb.chart.render("#chartWrap", {
data: {
type: "bar",
columns: [
["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]
]
}
});
//width
document.getElementById("txtWidth").onchange = function() {
chart.global({
size: {
width: this.value
}
}).render();
};
//height
document.getElementById("txtHeight").onchange = function() {
chart.global({
size: {
height: this.value
}
}).render();
};
//top
document.getElementById("txtTop").onchange = function() {
chart.global({
padding: {
top: this.value
}
}).render();
};
//bottom
document.getElementById("txtBottom").onchange = function() {
chart.global({
padding: {
bottom: this.value
}
}).render();
};
//left
document.getElementById("txtLeft").onchange = function() {
chart.global({
padding: {
left: this.value
}
}).render();
};
//right
document.getElementById("txtRight").onchange = function() {
chart.global({
padding: {
right: this.value
}
}).render();
};