Annotation extends ChartItem
subclasses TextAnnotation
, ImageAnnotation
, ShapeAnnotation
Annotation 모델들의 기반 클래스.
옵션
모델은 $1이고,
차트 설정
에서 'annotation'
항목으로 설정한다.
const config = {
annotation: [{
type: 'image',
name: 'image1',
}],
};
또, Chart.getAnnotation
으로
모델 객체를 가져올 수 있다.
const annotation = chart.getAnnotation('image1');
annotation.visible = false;
Annotation 개요
페이지를 참조한다.
Properties
name: string
(opens in a new tab) readonly
어노테이션 이름.
동적으로 어노테이션을 다루기 위해서는 반드시 지정해야 한다.
default :undefined
visible: boolean
(opens in a new tab) readonly
표시 여부.
options.visible 값을 그대로 return하는 것이 아니라,
undefined나 null 등으로 지정하는 경우 모델의 상태에 따라 true나 false로 해석될 수 있다.
설정의 경우 updateOptions
({visible: value}
)로 지정하는 것과 동일하다.
default :undefined
Methods
destroy(): null
객체가 소유한 참조 등을 해제하고 null을 리턴한다.
list = lis.destroy();
return null
getOffset(w, h): IPoint
처음 표시될 때 실행될 에니메이션 설정 정보.
Parameter | Type |
---|---|
w | number (opens in a new tab) |
h | number (opens in a new tab) |