import _defineProperty from '@babel/runtime/helpers/defineProperty';
import assign from '../../utils/assign.js';
import { axis, options } from '../../config.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, {
  $points: false,
  title: {
    show: false,
    text: '库容曲线图'
  },
  grid: {
    top: 70,
    bottom: 50,
    left: 80,
    right: 20
  },
  tooltip: false,
  dataset: {
    source: []
  },
  legend: {
    show: true,
    top: 7
  },
  xAxis: [_objectSpread(_objectSpread({}, axis), {}, {
    name: '库容（万m³）',
    type: 'value',
    nameLocation: 'middle',
    nameGap: 25,
    splitNumber: 10,
    min: 0,
    max: function max(v) {
      return v.max.toFixed(2);
    }
  }), _objectSpread(_objectSpread({}, axis), {}, {
    name: '面积（k㎡）',
    type: 'value',
    inverse: true,
    nameLocation: 'middle',
    nameGap: 25,
    splitNumber: 10,
    min: 0,
    max: function max(v) {
      return v.max;
    },
    splitLine: {
      show: false
    }
  })],
  yAxis: [_objectSpread(_objectSpread({}, axis), {}, {
    name: '水位（m）',
    type: 'value',
    nameLocation: 'middle',
    nameGap: 50,
    splitNumber: 10,
    min: function min(v) {
      return (v.min - (v.max - v.min) * 0.1).toFixed(2);
    },
    max: function max(v) {
      return (v.max + (v.max - v.min) * 0.1).toFixed(2);
    },
    axisPointer: {
      show: true,
      label: {
        formatter: function formatter(p) {
          return p.value.toFixed(2);
        }
      }
    }
  }), {}],
  series: [{
    type: 'line',
    smooth: true,
    xAxisIndex: 0,
    encode: {
      x: 1,
      y: 0
    },
    color: '#43CBFF',
    lineStyle: {
      color: '#43CBFF',
      width: 2
    },
    itemStyle: {
      opacity: 0
    },
    emphasis: {
      itemStyle: {
        borderColor: '#43CBFF',
        opacity: 1
      }
    }
  }, {
    type: 'line',
    smooth: true,
    xAxisIndex: 1,
    encode: {
      x: 2,
      y: 0
    },
    color: '#EB64FB',
    lineStyle: {
      color: '#EB64FB',
      width: 2
    },
    itemStyle: {
      opacity: 0
    },
    emphasis: {
      itemStyle: {
        opacity: 1,
        borderColor: '#EB64FB'
      }
    }
  }]
});

export { def as default };
