2017년 6월 28일 수요일

하이차트 Highcharts Stacked column chart



high차트 중 Stacked column chart 예제입니다.

<script type="text/javascript" src="/?/highcharts.js"></script>
<script type="text/javascript" src="/?/modules/exporting.js"></script>

<script type="text/javascript">
$(document).ready(function(){
//var chart1 = new Highcharts.Chart(options);
new Highcharts.Chart({
   chart: {
    renderTo: 'chartBox',
       type: 'column'
   },
    //상단 버튼 제거
     exporting: {
         enabled: false
     },
     //하단 라벨 삭제
credits: {
          enabled: false
          },
   title: {
        text: 'Stacked column chart'
        //text: null
   },
   xAxis: {
       categories: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas']
   },
   yAxis: {
       min: 0,
       title: {
           text: 'Total fruit consumption'
       },
       stackLabels: {
           enabled: true,
           style: {
               fontWeight: 'bold',
               color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
           }
       }
   },
   legend: {
       align: 'right',
       x: -30,
       verticalAlign: 'top',
       y: 25,
       floating: true,
       backgroundColor: (Highcharts.theme && Highcharts.theme.background2) || 'white',
       borderColor: '#CCC',
       borderWidth: 1,
       shadow: false
   },
      //툴팁 제거
      /*
      tooltip: {
          enabled: false
      },
      */
   tooltip: {
       headerFormat: '<b>{point.x}</b><br/>',
       pointFormat: '{series.name}: {point.y}<br/>Total: {point.stackTotal}'
   },
   plotOptions: {
       column: {
           stacking: 'normal',
           dataLabels: {
               enabled: true,
               color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white'
           }
       }
   },
   series: [{
       name: 'John',
       data: [5, 3, 4, 7, 2]
   }, {
       name: 'Jane',
       data: [2, 2, 3, 2, 1]
   }, {
       name: 'Joe',
       data: [3, 4, 4, 2, 5]
   }]
});
});

</script>


<div id="chartBox" style="height:240px;">



highCharts에 대한 자세한 정보는


댓글 없음:

댓글 쓰기

스프링 빈 등록 순서 오류 시 @PostConstruct 사용

  스프링 xml 설정에서 등록할 빈을 명시적으로 지정한 것과 <context:component-scan>와 혼용해서 사용한  경우 빈등록 순서 오류가 발생 할 수도 있습니다. 여러가지 방법이 있지만, 그 중에서 @PostConstruct ...