export function barDataView(titleName, fileName) {
  var dataView = {
    show: true,
    readOnly: false,
    lang: ['数据视图', '关闭', '刷新'],
    optionToContent: function(opt) {
      var axisData = opt.xAxis[0].data // 坐标数据
      var series = opt.series // 折线图数据
      var tdHeads = ''
      for (let index = 0; index < titleName.length; index++) {
        // 样式
        tdHeads += '<td  style="height:30px;text-align: center;">' + titleName[index] + '</td>'
      }
      var tdBodys = '' // 表数据
      var table = '<table id="tableExcel_Day" border="1" class="table-bordered table-striped" style="width:100%;text-align:centerborder:1px solid #ccc;border-collapse:collapse;" ><tbody><tr>' + tdHeads + ' </tr>'
      // 组装表数据
      for (var i = 0, l = axisData.length; i < l; i++) {
        for (var j = 0; j < series.length; j++) {
          var temp = series[j].data[i]
          if (temp != null && temp !== undefined) {
            tdBodys += '<td>' + temp + '</td>'
          } else {
            tdBodys += '<td></td>'
          }
        }
        // 样式
        table += '<tr style="height:30px;text-align: center;"><td >' + axisData[i] + '</td>' + tdBodys + '</tr>'
        tdBodys = ''
      }
      table += '</tbody></table>'
      return table
    }
  }
  return dataView
}