"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
var React = _interopRequireWildcard(require("react"));
var _bizcharts = require("bizcharts");
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 LineCharts = /*#__PURE__*/function (_Component) {
  (0, _inheritsLoose2["default"])(LineCharts, _Component);
  function LineCharts(props) {
    var _this;
    _this = _Component.call(this, props) || this;
    _this.Demo = function () {
      var data = _this.state.data;
      return /*#__PURE__*/React.createElement(_bizcharts.LineChart, {
        data: data,
        title: {
          visible: true,
          text: '折线图'
        },
        description: {
          visible: true,
          text: '用平滑的曲线代替折线。'
        },
        xField: "year",
        yField: "value",
        interactions: [{
          type: 'slider',
          cfg: {
            start: 0,
            end: 1
          }
        }]
      });
    };
    _this.state = (0, _extends2["default"])({}, props.data, {
      // 数据源
      data: [{
        year: '1991',
        value: 3
      }, {
        year: '1992',
        value: 4
      }, {
        year: '1993',
        value: 3.5
      }, {
        year: '1994',
        value: 5
      }, {
        year: '1995',
        value: 4.9
      }, {
        year: '1996',
        value: 6
      }, {
        year: '1997',
        value: 7
      }, {
        year: '1998',
        value: 9
      }, {
        year: '1999',
        value: 13
      }]
    });
    return _this;
  }
  var _proto = LineCharts.prototype;
  _proto.render = function render() {
    return /*#__PURE__*/React.createElement("div", null, this.Demo());
  };
  return LineCharts;
}(React.Component);
exports["default"] = LineCharts;
LineCharts.displayName = 'LineCharts';