提交 6d00f9ca 编写于 作者: S susiwen8

Fix: radar model mixin with AxisModelCommonMixin

上级 4c3b1b26
......@@ -20,7 +20,6 @@
import * as zrUtil from 'zrender/src/core/util';
import axisDefault from '../axisDefault';
import Model from '../../model/Model';
import {AxisModelCommonMixin} from '../axisModelCommonMixin';
import ComponentModel from '../../model/Component';
import {
ComponentOption,
......@@ -32,6 +31,7 @@ import { AxisBaseOption } from '../axisCommonTypes';
import { AxisBaseModel } from '../AxisBaseModel';
import Radar from './Radar';
import {CoordinateSystemHostModel} from '../../coord/CoordinateSystem';
import {mixinAxisModelCommonMethods} from '../../helper';
const valueAxisDefault = axisDefault.value;
......@@ -151,11 +151,9 @@ class RadarModel extends ComponentModel<RadarOption> implements CoordinateSystem
innerIndicatorOpt.name, innerIndicatorOpt
);
}
const model = zrUtil.extend(
new Model(innerIndicatorOpt, null, this.ecModel),
AxisModelCommonMixin.prototype
) as AxisBaseModel<InnerIndicatorAxisOption>;
mixinAxisModelCommonMethods(Model);
const model = new Model(innerIndicatorOpt, null, this.ecModel) as AxisBaseModel<InnerIndicatorAxisOption>;
// For triggerEvent.
model.mainType = 'radar';
model.componentIndex = this.componentIndex;
......
......@@ -103,6 +103,6 @@ export function createScale(dataExtent: number[], option: object | AxisBaseModel
* `getMax(origin: boolean) => number`
* `getNeedCrossZero() => boolean`
*/
export function mixinAxisModelCommonMethods(Model: Model) {
export function mixinAxisModelCommonMethods<T = Model>(Model: T) {
zrUtil.mixin(Model, AxisModelCommonMixin);
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册