@amcharts/amcharts5
Version:
amCharts 5
30 lines • 1.02 kB
JavaScript
import { Entity } from "../../core/util/Entity";
/**
* A universal placeholder for bullet elements.
*
* @see {@link https://www.amcharts.com/docs/v5/concepts/common-elements/bullets/} for more info
*/
export class Bullet extends Entity {
_afterNew() {
// Applying themes because bullet will not have parent
super._afterNewApplyThemes();
}
_beforeChanged() {
super._beforeChanged();
if (this.isDirty("sprite")) {
const sprite = this.get("sprite");
if (sprite) {
sprite.setAll({ position: "absolute", role: "figure" });
this._disposers.push(sprite);
}
}
if (this.isDirty("locationX") || this.isDirty("locationY")) {
if (this.series) {
this.series._positionBullet(this);
}
}
}
}
Bullet.className = "Bullet";
Bullet.classNames = Entity.classNames.concat([Bullet.className]);
//# sourceMappingURL=Bullet.js.map