You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unless you have a writable computed `chartData`, you won't be able to use the newer `structuredClone`, as you'll likely hit the `Write operation failed: computed value is readonly` error.
139
+
140
+
You don't need to use a clone if your `chartData` is a [writable computed value](https://vuejs.org/guide/essentials/computed#writable-computed).
141
+
142
+
143
+
128
144
## Access to Chart instance
129
145
130
146
You can get access to chart instance via template refs.
Copy file name to clipboardExpand all lines: website/src/kr/guide/index.md
+30-19
Original file line number
Diff line number
Diff line change
@@ -96,34 +96,45 @@ export default {
96
96
97
97
## 차트 데이터 업데이트
98
98
99
-
Chart.js 자체는 데이터 세트를 변경할 때 라이브 업데이트 기능을 제공하지 않습니다. 그러나 `vue-chartjs`는 이것을 실현하기 위해 2 개의 mixin을 제공합니다.
99
+
v4부터 차트는 기본적으로 데이터 변경 `watch`와 옵션 변경 `watch`가 있으므로 새 데이터 또는 새 옵션이 전달되면 (변경되면) Vue Chart 래퍼가 차트를 업데이트하거나 다시 렌더링합니다. v4부터는 믹스인이 제거되었습니다.
100
100
101
-
-`reactiveProp`
102
-
-`reactiveData`
103
-
104
-
두 믹스 인은 실제로 동일한 결과를 얻습니다. 대부분의 경우 `reactiveProp`을 사용합니다. 이 믹스인은 차트 컴포넌트의 로직을 확장하고 자동으로 `chartData`라는 속성을 생성하고 이 속성에 `vue watch`를 추가합니다. 데이터가 변경되면, 데이터 세트내의 데이터만이 변경되고 있으면 `update()`를, 새로운 데이터 세트가 추가되고 있으면 `renderChart()`를 호출합니다.
101
+
### 예제
105
102
106
-
`ractiveData`는 속성이 아닌 로컬 chartData 변수를 만들고 Watcher를 추가합니다. 이것은 단일 목적 차트가 필요하고 차트 구성 요소 내에서 API 호출을 수행하는 경우에만 유용합니다.
103
+
```vue
104
+
<template>
105
+
<Bar :data="chartData" :options="chartOptions" />
106
+
</template>
107
107
108
-
### 예제
108
+
<script>
109
+
// DataPage.vue
110
+
import { Bar } from 'vue-chartjs'
111
+
import { Chart as ChartJS, Title, Tooltip, Legend, BarElement, CategoryScale, LinearScale } from 'chart.js'
0 commit comments