import _defineProperty from '@babel/runtime/helpers/defineProperty';
import assign from '../../utils/assign.js';
import config, { CATEGORY, axis, options } from '../../config.js';
import { to } from '../../utils/tools.js';

function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var def = assign({}, options, {
  $indices: [],
  $statistical: 100,
  $appendable: 3,
  $series: [{
    $code: CATEGORY.STAGE,
    z: 5,
    type: "line",
    smooth: true,
    large: true,
    emphasis: {
      itemStyle: {
        opacity: 0.8
      }
    },
    itemStyle: {
      opacity: 0
    },
    markPoint: {
      data: [{
        type: "max",
        symbolSize: 8,
        symbol: '',
        label: {
          position: 'top',
          align: 'center',
          verticalAlign: 'bottom',
          color: "inherit",
          fontWeight: "bold",
          fontSize: 14,
          formatter: function formatter(e) {
            return to(e.value);
          }
        }
      }]
    }
  }, {
    $code: ~CATEGORY.STAGE,
    z: 5,
    type: "line",
    smooth: true,
    large: true,
    emphasis: {
      itemStyle: {
        opacity: 0.8
      }
    },
    itemStyle: {
      opacity: 0
    },
    markPoint: {
      data: [{
        type: "max",
        symbolSize: 8,
        symbol: '',
        label: {
          position: 'top',
          align: 'center',
          verticalAlign: 'bottom',
          color: "inherit",
          fontWeight: "bold",
          fontSize: 14,
          formatter: function formatter(e) {
            return to(e.value);
          }
        }
      }]
    }
  }],
  color: config.color,
  grid: {
    top: 60,
    bottom: 60,
    left: 80,
    right: 80
  },
  tooltip: {
    trigger: 'axis',
    axisPointer: {
      type: 'cross'
    }
  },
  legend: {
    show: true,
    top: 10
  },
  dataZoom: [{
    type: 'slider',
    brushSelect: false,
    handleIcon: config.icon.zoom,
    handleSize: "60%",
    realtime: true,
    throttle: 30,
    bottom: 10,
    height: 20
  }, {
    type: 'inside'
  }],
  xAxis: [_objectSpread(_objectSpread({}, axis), {}, {
    type: "category",
    boundaryGap: false,
    axisLine: {
      onZero: false
    },
    nameGap: 30
  })],
  yAxis: [_objectSpread(_objectSpread({}, axis), {}, {
    $layout: CATEGORY.STAGE,
    type: "value",
    nameLocation: 'middle',
    nameGap: 50,
    nameTextStyle: {
      align: "right"
    },
    min: function min(v) {
      return to(v.min - (v.max - v.min) * 0.1);
    },
    max: function max(v) {
      return to(v.max + (v.max - v.min) * 0.1);
    }
  }), _objectSpread(_objectSpread({}, axis), {}, {
    $layout: ~CATEGORY.STAGE,
    type: "value",
    nameLocation: 'middle',
    nameGap: 50,
    nameTextStyle: {
      align: "left"
    }
  })]
});

export { def as default };
