소개

중소벤처기업진흥공단개발소스예제

Open API 개발 소스 예제를 유형별로 확인하실 수 있습니다.

<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://code.highcharts.com/highcharts.js" /></script>
<script type="text/javascript" src="https://code.highcharts.com/modules/exporting.js" /></script>
<script type="text/javascript">
	function getChartData() {
	    $.ajax({
	        url: 'http://www.kosmes.or.kr/opendata/portal/openapi/TFINRT?YY=2016&Type=json',
	        type: 'GET',
	        dataType: 'json',
	        success: function (result) {
	            drawBarChart(result);
	        },
	        error: function (result) {}
	    });
	}

	function drawBarChart(jsonData) {
	    var data = jsonData.TFINRT[1].row;
	
	    $('#barChart').highcharts({
	        credits: {enabled: false},
	        chart:  {type: 'column'},
	        title:  {text: data[0].CO_SIZE},
	        legend: {enabled: false},
	        xAxis:  {type: 'category'},
	        yAxis: {
	            title: {
	                text: ""
	            }
	
	        },
	        series: [{
	            name: "",
	            colorByPoint: true,
	            data: [{name: "총자본투자효율", y: data[0].INVS_EFFC_RT},
	                   {name: "순이익증가율", y: data[0].NET_PROF_INC_RT},
	                  ]
	               }]
	    });
	
	}
</script>

<div id="barChart" style="min-width:300px;height:400px;margin:0 auto;"></div>