Chart.js 누적 막대 그래프

1 개요[ | ]

Chart.js Stacked Bar
Chart.js 누적 막대 그래프, 누적 막대 차트
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.1.1/Chart.min.js"></script>
<script src="//cdn.rawgit.com/Regaddi/Chart.StackedBar.js/76fc9/src/Chart.StackedBar.js"></script>
<script src="//code.jquery.com/jquery.min.js"></script>
<canvas id="canvas1" height="300" width="400"></canvas>
 
<script>
var randomScalingFactor = function(){ return Math.round(Math.random()*100)};
var barChartData = {
	labels : ["1월","2월","3월","4월","5월","6월","7월"],
	datasets : [
		{
			fillColor : "rgba(220,220,220,0.5)",
			data : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()]
		},
		{
			fillColor : "rgba(151,187,205,0.5)",
			data : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()]
		},
		{
			fillColor : "rgba(240,73,73,0.5)",
			data : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()]
		}
	]
};
$(function(){
	var ctx = $("#canvas1")[0].getContext("2d");
	window.myBar = new Chart(ctx).StackedBar(barChartData);
});
</script>

2 같이 보기[ | ]

3 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}