-
-
Notifications
You must be signed in to change notification settings - Fork 836
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* docs: translate landing page to Korean * docs: translate guide to Korean * docs: translate api to Korean
- Loading branch information
1 parent
197367f
commit 8ca163b
Showing
3 changed files
with
631 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
# ์ฝ๋ฉ ๋ ํผ๋ฐ์ค | ||
|
||
## Props | ||
|
||
`vue-chartjs`๊ฐ ์ ๊ณตํ๋ ์ปดํฌ๋ํธ๋ค์ ๋ช ๊ฐ์ง ๊ธฐ๋ณธ์ ์ธ ์์ฑ๋ค์ ์ ์ํ๋ค. `ํ์ฅ`ํ๊ณ ์๊ธฐ ๋๋ฌธ์, ๊ทธ๋ค์ * ๋ณด์ด์ง ์๋ *์ด์ง๋ง, ๊ทธ ๊ฐ์ ๋ฎ์ด ์ธ ์ ์์ต๋๋ค : | ||
|
||
| Prop ์ด๋ฆ | ์ค๋ช | | ||
|---|---| | ||
| width | ์ฐจํธ ํญ | | ||
| height | ์ฐจํธ ๋์ด | | ||
| chart-id | canvas ์์์ id | | ||
| css-classes | ๋๋ฌ์ธ๋ div css ํด๋์ค (๋ฌธ์์ด) | | ||
| styles | ๋๋ฌ์ธ๋ div ์ css ํด๋์ค (๊ฐ์ฒด) | | ||
| plugins | chartjs ํ๋ฌ๊ทธ์ธ (๋ฐฐ์ด) | | ||
|
||
## Events | ||
|
||
`reactData` ๋๋ `reactProp` ๋ฏน์ค ์ธ์ด ์ฌ์ฉ๋๋ฉด ๋ค์ ์ด๋ฒคํธ๊ฐ ๋ฐํ๋ฉ๋๋ค. | ||
|
||
| ์ด๋ฒคํธ ์ด๋ฆ | ์ค๋ช | | ||
|---|---| | ||
| `chart:render` | ๋ฏน์ค ์ธ์ด ์์ ํ ๋ ๋๋ง ๋ ๋ | | ||
| `chart:destroy` | ๋ฏน์ค์ธ์ด ์ฐจํธ ์ค๋ธ์ ํธ ์ธ์คํด์ค๋ฅผ ์ญ์ ํ ๋ | | ||
| `chart:update` | ๋ฏน์ค ์ธ์ด ๋ค์ ๋ ๋๋ง ๋์ ์ ๋ฐ์ดํธ๋ฅผ ํ ๋ | | ||
| `labels:update` | labels๊ฐ ์ค์ ๋๋ฉด | | ||
| `xlabels:update` | xlabels๊ฐ ์ค์ ๋๋ฉด | | ||
| `ylabels:update` | ylabels๊ฐ ์ค์ ๋๋ฉด | | ||
|
||
## Global Methods | ||
์ ์ญ ๋ฉ์๋๋ ๊ฐ์ ธ์ค๊ณ ์ฌ์ฉํฉ๋๋ค. | ||
|
||
### generateChart | ||
|
||
- **Type:** `Function` | ||
- **Arguments**: `chart-id`, `chart-type` | ||
- **Usage:** | ||
|
||
```js | ||
import { generateChart } from 'vue-chartjs' | ||
// First argument is the chart-id, second the chart type. | ||
const CustomLine = generateChart('custom-line', 'LineWithLine') | ||
``` | ||
|
||
## Instance Methods | ||
|
||
์ธ์คํด์ค ๋ฉ์๋๋ ๋ ์์ ์ธ ์ฐจํธ ์ปดํผ๋ํธ๋ด์์ ์ฌ์ฉํ ์๊ฐ ์์ต๋๋ค. | ||
|
||
|
||
### generateLegend() | ||
|
||
HTML ๋ฒ๋ก๋ฅผ ๋ง๋๋ ๋์ฐ๋ฏธ ํจ์ | ||
|
||
- **Type:** `Function` | ||
- **Arguments**: `none` | ||
- **Usage:** | ||
|
||
```js{11} | ||
import { Line } from 'vue-chartjs' | ||
export default { | ||
extends: Line, | ||
props: ['datasets', 'options'] | ||
data: () => ({ | ||
htmlLegend: null | ||
}) | ||
mounted () { | ||
this.renderChart(this.datasets, this.options) | ||
this.htmlLegend = this.generateLegend() | ||
} | ||
} | ||
``` | ||
|
||
### ํ๋ฌ๊ทธ์ธ ์ถ๊ฐ | ||
|
||
Chart.js์์๋ ๊ธ๋ก๋ฒ ํ๋ฌ๊ทธ์ธ๊ณผ ์ธ๋ผ์ธ ํ๋ฌ๊ทธ์ธ์ ์ ์ํ ์ ์์ต๋๋ค. ๊ธ๋ก๋ฒ ํ๋ฌ๊ทธ์ธ์ [Chart.js docs] (http://www.chartjs.org/docs/latest/developers/plugins.html)์์ ์ค๋ช ํ๋๋ก 'vue-chartjs'์์๋ ์ ์๋ํฉ๋๋ค. . | ||
|
||
|
||
์ธ๋ผ์ธ ํ๋ฌ๊ทธ์ธ์ ์ถ๊ฐํ๋ ค๋ ๊ฒฝ์ฐ๋ฅผ ๋๋นํ์ฌ `vue-chartjs`๋ `addPlugin()`์ด๋ผ๋ ํฌํผ ๋ฉ์๋๋ฅผ ๋ ธ์ถํฉ๋๋ค. | ||
|
||
`renderChart()` ๋ฉ์๋ ์์ `addPlugin()` ์ ํธ์ถํด์ผํฉ๋๋ค. | ||
|
||
- **Type:** `Function` | ||
- **Arguments**: `Array` of Plugins | ||
- **Usage:**### ํ๋ฌ๊ทธ์ธ ์ถ๊ฐ | ||
|
||
```js | ||
mounted () { | ||
this.addPlugin({ | ||
id: 'my-plugin', | ||
beforeInit: function (chart) { | ||
.... | ||
} | ||
}) | ||
} | ||
``` | ||
|
||
### renderChart() | ||
|
||
Chart.js์ ์ธ์คํด์ค๋ฅผ ๋ง๋ค๊ณ ๊ทธ๋ฆฝ๋๋ค. | ||
|
||
- **Type:** `Function` | ||
- **Arguments**: `Chart Data`, `Chart Options` | ||
- **Usage:** | ||
|
||
```js | ||
mounted () { | ||
this.renderChart({ | ||
labels: ['January', 'February'], | ||
datasets: [ | ||
{ | ||
label: 'Data One', | ||
backgroundColor: '#f87979', | ||
data: [40, 20] | ||
} | ||
]}, | ||
{ | ||
responsive: true | ||
} | ||
) | ||
} | ||
``` | ||
|
||
## Chart.js ๊ฐ์ฒด | ||
|
||
๋ ์์ ์ธ ์ฐจํธ ์ปดํผ๋ํธ๋ด๋ก๋ถํฐ Chart.js ์ ์ค๋ธ์ ํธ์๋ `this.$data._chart` ๋ก ์ก์ธ์ค ํ ์ ์์ต๋๋ค. | ||
|
||
## Canvas | ||
|
||
Canvas ์์๋ `this.$refs.canvas`๋ก ์ก์ธ์ค ํ ์ ์์ต๋๋ค. |
Oops, something went wrong.