Skip to content

Commit

Permalink
[#774][3.0] Chart Resize - debounce wait(timeout)값 옵션화 (#775)
Browse files Browse the repository at this point in the history
##################################
- Chart Resize - debounce wait(timeout)값 옵션화
- 관련 DOCS 모두 수정

Co-authored-by: jinhee park <jinhee@ex-em.com>
  • Loading branch information
jhee564 and jhee564 authored Mar 11, 2021
1 parent c13ce3e commit 4edb6f6
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 1 deletion.
7 changes: 7 additions & 0 deletions docs/views/barChart/api/barChart.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<ev-chart
:data="차트데이터"
:options="차트속성"
:resize-timeout="debounce wait시간(단위: ms)"
/>
```

Expand Down Expand Up @@ -184,3 +185,9 @@ const chartData = {
| click | selectedItem | 클릭된 series의 label, value, seriesID 값을 반환 |
| dbl-click | selectedItem | 더블 클릭된 series의 label, value, seriesID 값을 반환 |
* 단, `selectedItem` 옵션의 `use`값이 `true` 이어야 `selectedItem` 객체를 반환하며 false일 경우 빈 객체를 반환


### 3. resize-timeout
- Default : 0
- debounce 사용. 연속으로 이벤트가 발생한 경우, 마지막 이벤트가 끝난 시점을 기준으로 `주어진 시간 (resize-timeout)` 이후 콜백 실행

6 changes: 6 additions & 0 deletions docs/views/lineChart/api/lineChart.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<ev-chart
:data="차트데이터"
:options="차트속성"
:resize-timeout="debounce wait시간(단위: ms)"
/>
```

Expand Down Expand Up @@ -160,3 +161,8 @@ const chartData =
| click | selectedItem | 클릭된 series의 label, value, seriesID 값을 반환 |
| dbl-click | selectedItem | 더블 클릭된 series의 label, value, seriesID 값을 반환 |
* 단, `selectedItem` 옵션의 `use`값이 `true` 이어야 `selectedItem` 객체를 반환하며 false일 경우 빈 객체를 반환


### 3. resize-timeout
- Default : 0
- debounce 사용. 연속으로 이벤트가 발생한 경우, 마지막 이벤트가 끝난 시점을 기준으로 `주어진 시간 (resize-timeout)` 이후 콜백 실행
6 changes: 6 additions & 0 deletions docs/views/pieChart/api/pieChart.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<ev-chart
:data="차트데이터"
:options="차트속성"
:resize-timeout="debounce wait시간(단위: ms)"
/>
```

Expand Down Expand Up @@ -64,3 +65,8 @@ const chartData =
| inactive | HexCode(String) | '#aaa' | 비활성화 상태의 폰트 색상 | |
| width | Number | 140 | Legend의 넓이 *('left', 'right'의 경우 조절)* | |
| height | Number | 24 | Legend의 높이 *('top', 'bottom'의 경우 조절)* | |


### 3. resize-timeout
- Default : 0
- debounce 사용. 연속으로 이벤트가 발생한 경우, 마지막 이벤트가 끝난 시점을 기준으로 `주어진 시간 (resize-timeout)` 이후 콜백 실행
6 changes: 6 additions & 0 deletions docs/views/scatterChart/api/scatterChart.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<ev-chart
:data="차트데이터"
:options="차트속성"
:resize-timeout="debounce wait시간(단위: ms)"
/>
```

Expand Down Expand Up @@ -116,3 +117,8 @@ const chartData =
| --- | ---- | ----- | --- | ----------|
| use | Boolean | true | indicator 사용 여부 | |
| color | HexCode(String) | '#EE7F44' | 색상 | |


### 3. resize-timeout
- Default : 0
- debounce 사용. 연속으로 이벤트가 발생한 경우, 마지막 이벤트가 끝난 시점을 기준으로 `주어진 시간 (resize-timeout)` 이후 콜백 실행
6 changes: 5 additions & 1 deletion src/components/chart/Chart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
type: Object,
default: () => ({}),
},
resizeTimeout: {
type: Number,
default: 0,
},
},
emits: [
'click',
Expand Down Expand Up @@ -102,7 +106,7 @@
}
};
const onResize = debounce(redrawChart, 300);
const onResize = debounce(redrawChart, props.resizeTimeout);
const selectItemByLabel = (label) => {
evChart.selectItemByLabel(label);
Expand Down

0 comments on commit 4edb6f6

Please sign in to comment.