加载中...

不连续时间柱状图


调试运行

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>图形展示</title>
</head>
<body>
 
<div class="detail-section">
    <div id="canvas">
 
    </div>
</div>
 
<script src="http://g.tbcdn.cn/bui/acharts/1.0.32/acharts-min.js"></script>
<!-- https://g.alicdn.com/bui/acharts/1.0.29/acharts-min.js -->
 
 
  <script type="text/javascript">
    var chart = new AChart({
      theme : AChart.Theme.SmoothBase,
      id : 'canvas',
      width : 950,
      height : 500,
      plotCfg : {
        margin : [50,50,80] //画板的边距
      },
      xAxis : {
        type : 'timeCategory',//不连续的时间选择timeCategory格式的坐标轴
        formatter : function  (value) {
          return AChart.Date.format(new Date(value),'yyyy-mm-dd');
        },
        tickOffset : 10
      },
      tooltip : {
        valueSuffix : '¥'
      },
      series : [ {
        name: 'Africa',
        type : 'column',
        data: [
          [1147651200000,67.79],
          [1147737600000,64.98],
          [1147824000000,65.26],
          [1147910400000,63.18],
          [1147996800000,64.51],
          [1148256000000,63.38],
          [1148342400000,63.15],
          [1148428800000,63.34],
          [1148515200000,64.33],
          [1148601600000,63.55],
          [1148947200000,61.22],
          [1149033600000,59.77],
 
          [1149120000000,62.17],
          [1149206400000,61.66],
          [1149465600000,60.00],
          [1149552000000,59.72],
          [1149638400000,58.56],
          [1149724800000,60.76],
          [1149811200000,59.24],
          [1150070400000,57.00],
          [1150156800000,58.33],
          [1150243200000,57.61],
          [1150329600000,59.38],
          [1150416000000,57.56],
          [1150675200000,57.20],
          [1150761600000,57.47],
          [1150848000000,57.86],
          [1150934400000,59.58],
          [1151020800000,58.83],
          [1151280000000,58.99],
          [1151366400000,57.43],
          [1151452800000,56.02],
          [1151539200000,58.97],
          [1151625600000,57.27]]
 
      }]
 
    });
 
    chart.render();
  </script>
 
</body>
</html>

还没有评论.