index.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { __extends } from "tslib";
  2. import { Plot } from '../../core/plot';
  3. import { adaptor } from './adaptor';
  4. import { DEFAULT_OPTIONS } from './constants';
  5. import { getProgressData } from './utils';
  6. var Progress = /** @class */ (function (_super) {
  7. __extends(Progress, _super);
  8. function Progress() {
  9. var _this = _super !== null && _super.apply(this, arguments) || this;
  10. /** 图表类型 */
  11. _this.type = 'process';
  12. return _this;
  13. }
  14. /**
  15. * 获取 仪表盘 默认配置项
  16. * 供外部使用
  17. */
  18. Progress.getDefaultOptions = function () {
  19. return DEFAULT_OPTIONS;
  20. };
  21. /**
  22. * 更新数据
  23. * @param percent
  24. */
  25. Progress.prototype.changeData = function (percent) {
  26. this.updateOption({ percent: percent });
  27. this.chart.changeData(getProgressData(percent));
  28. };
  29. Progress.prototype.getDefaultOptions = function () {
  30. return Progress.getDefaultOptions();
  31. };
  32. /**
  33. * 获取 进度图 的适配器
  34. */
  35. Progress.prototype.getSchemaAdaptor = function () {
  36. return adaptor;
  37. };
  38. return Progress;
  39. }(Plot));
  40. export { Progress };
  41. //# sourceMappingURL=index.js.map