v1.4.2
✨ 기능 개선
updateOption API 개선
-
updateOption API의 기본 용도와 자식 모델
updateOption(propertyName, value)API는 원래 모델의 단일 속성 값을 변경하기 위한 함수입니다. 예:chart.title.updateOption('visible', false) -
개선된 사항 기존 방식의 한계: 이전에는
updateOption('자식 모델 이름', ...)방식으로 자식 모델의 속성을 변경할 때, string, number 같은 단순 값(Primitive value)만 전달할 수 있었습니다. 여러 속성을 담은 객체를 한 번에 전달할 수는 없었습니다. 개선된 기능: 이제updateOption('자식 모델 이름', 값)을 호출할 때,{ visible: true, text: '...' }와 같이 여러 속성을 포함한 객체(Object)를 전달할 수 있도록 개선되었습니다. -
권장 사항 기능은 개선되었으나, 코드의 명확성과 일관성을 위해 자식 모델의 여러 속성을 변경할 때는
model.child.updateOptions({ ... })방식을 사용하시기를 권장합니다.
예제:
const chart = RealChart.createChart(document, 'realchart', config);
// updateOption을 통한 자식 모델 속성 변경
chart.xAxis.updateOption('label', {
style: {
fill: 'yellow'
},
autoArrange: 'rows',
suffix: '년'
});
// 자식 모델을 통해 updateOptions으로 속성 변경 (권장 방식)
chart.xAxis.label.updateOptions({
style: {
fill: 'yellow'
},
autoArrange: 'rows',
suffix: '년'
});