index.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import { __extends } from "tslib";
  2. import { Plot } from '../../core/plot';
  3. import { getDataWhetherPercentage } from '../../utils/transform/percent';
  4. import { adaptor, meta } from './adaptor';
  5. import { DEFAULT_OPTIONS } from './constants';
  6. /**
  7. * 柱形图
  8. */
  9. var Column = /** @class */ (function (_super) {
  10. __extends(Column, _super);
  11. function Column() {
  12. var _this = _super !== null && _super.apply(this, arguments) || this;
  13. /** 图表类型 */
  14. _this.type = 'column';
  15. return _this;
  16. }
  17. /**
  18. * 获取 柱形图 默认配置项
  19. * 供外部使用
  20. */
  21. Column.getDefaultOptions = function () {
  22. return DEFAULT_OPTIONS;
  23. };
  24. /**
  25. * @override
  26. */
  27. Column.prototype.changeData = function (data) {
  28. this.updateOption({ data: data });
  29. var _a = this.options, yField = _a.yField, xField = _a.xField, isPercent = _a.isPercent;
  30. var _b = this, chart = _b.chart, options = _b.options;
  31. meta({ chart: chart, options: options });
  32. this.chart.changeData(getDataWhetherPercentage(data, yField, xField, yField, isPercent));
  33. };
  34. /**
  35. * 获取 柱形图 默认配置
  36. */
  37. Column.prototype.getDefaultOptions = function () {
  38. return Column.getDefaultOptions();
  39. };
  40. /**
  41. * 获取 柱形图 的适配器
  42. */
  43. Column.prototype.getSchemaAdaptor = function () {
  44. return adaptor;
  45. };
  46. return Column;
  47. }(Plot));
  48. export { Column };
  49. //# sourceMappingURL=index.js.map