"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

exports.__esModule = true;
exports["default"] = void 0;

var _react = _interopRequireWildcard(require("react"));

var _classnames = _interopRequireDefault(require("classnames"));

var _lodash = require("lodash");

var _echart = _interopRequireDefault(require("../echart"));

var _context = _interopRequireDefault(require("../context"));

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

var OPTIONS = {
  tooltip: {
    trigger: 'axis',
    axisPointer: {
      type: 'cross'
    }
  },
  textStyle: {
    color: '#D3E2FF'
  },
  xAxis: {
    type: 'category',
    boundaryGap: false,
    axisTick: {
      show: false
    },
    axisLabel: {
      fontSize: 9.6
    }
  },
  yAxis: {
    type: 'value',
    nameTextStyle: {
      align: 'left',
      fontSize: 12
    },
    axisLine: {
      show: false
    },
    axisLabel: {
      fontSize: 9.6
    },
    axisPointer: {
      show: false
    },
    splitLine: {
      lineStyle: {
        type: 'dashed',
        color: 'rgba(211, 226, 255, 0.5)'
      }
    }
  },
  axisPointer: {
    lineStyle: {
      type: 'solid'
    }
  },
  grid: {
    top: 30,
    bottom: 0,
    left: 0,
    right: 10,
    containLabel: true
  },
  series: [{
    type: 'line',
    symbol: 'circle',
    symbolSize: 6
  }]
};

var LineChart = function LineChart(props) {
  var _useContext = (0, _react.useContext)(_context["default"]),
      _cssPrefix = _useContext._cssPrefix;

  var className = props.className,
      title = props.title,
      universalStyle = props.universalStyle,
      options = props.options,
      loading = props.loading;
  return /*#__PURE__*/_react["default"].createElement(_echart["default"], {
    title: title,
    className: (0, _classnames["default"])(className, _cssPrefix + "line-chart-wrapper"),
    universalStyle: universalStyle,
    loading: loading,
    options: (0, _lodash.merge)(options, OPTIONS)
  });
};

var _default = LineChart;
exports["default"] = _default;