Echarts 自定义toolbox

toolbox: {
  show: true,
  right: '80px',
  feature: {
    mark: {show: true},
    dataView: {
      show: true,
      title: 'data view',
      readOnly: true,
      lang: ['data view', 'close'],
      optionToContent: function (opt) {
        var axisData = opt.xAxis[0].data
        var series = opt.series
        var table = '' +
          '' +
          '' +
          '' +
          ''
        for (var i = 0, l = axisData.length; i < l; i++) {
          table += '' +
            '' +
            '' +
            '' +
            ''
        }
        table += '
Time' + series[0].name + '' + series[1].name + '
' + axisData[i] + '' + (series[0].data[i] !== undefined ? series[0].data[i] : 0) + '' + (series[1].data[i] !== undefined ? series[1].data[i] : 0) + '
' return table } }, magicType: { show: true, title: { line: 'switch to line', bar: 'switch to pillar' }, type: ['line', 'bar'] }, restore: { show: true, title: 'restore' } } },

你可能感兴趣的:(前段知识)