Echarts可视化教程

  1. 网站首页
  2. 百度ECharts
  3. ECharts实例
  4. ECharts入门
  5. 地图大全
  6. ECharts官网

Highcharts图表之堆叠柱形图

$(document).ready(function() {  
   var chart = {
      type: 'column'
   };
   var title = {
      text: '堆叠柱形图'   
   };    
   var xAxis = {
      categories: ['周一','周二','周三','周四','周五','周六','周日']
   };
   var yAxis ={
      min: 0,
      title: {
        text: '总访问量'
      },
      stackLabels: {
        enabled: true,
        style: {
           fontWeight: 'bold',
           color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
        }
      }
   };
   var legend = {
      align: 'right',
      x: -30,
      verticalAlign: 'top',
      y: 25,
      floating: true,
      backgroundColor: (Highcharts.theme && Highcharts.theme.background2) || 'white',
      borderColor: '#CCC',
      borderWidth: 1,
      shadow: false
   };   
   var plotOptions = {
      column: {
         stacking: 'normal',
         dataLabels: {
            enabled: true,
            color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white',
            style: {
               textShadow: '0 0 3px black'
            }
         }
      }
   };
   var credits = {
      enabled: false
   };
   var series= [{
       name: '中国',
		data: [49, 71, 106, 129, 144, 176, 200]
	}, {
		name: '美国',
		data: [83, 78, 98, 93, 106, 84, 105]
	}];
      
   var json = {};   
   json.chart = chart; 
   json.title = title;   
   json.xAxis = xAxis;
   json.yAxis = yAxis;
   json.legend = legend;
   json.plotOptions = plotOptions;
   json.credits = credits;
   json.series = series;
   $('#myChart').highcharts(json);
  
});

点击运行 》

点击展开全文

相关文章

  1. 如何利用Highcharts中使用盒须图来展示数据
  2. Highcharts图表之测量图
  3. Highcharts图表之3D圆环图
  4. Highcharts图表之3D饼图系列
  5. Highcharts图表之堆叠3D柱状图