Skip to content

Commit

Permalink
docs: Translate pt-br (#606)
Browse files Browse the repository at this point in the history
* docs: Translate Landingpage /pt-br/README.md

* docs: Translate Guide /pt-br/guide/README.md

* docs: Translate API Reference /pt-br/api/README.md

* docs: Tranlate ./vuepress/config.js update pt-br
  • Loading branch information
roberto0arruda committed Mar 31, 2020
1 parent 7c06f29 commit c09cc8e
Show file tree
Hide file tree
Showing 5 changed files with 631 additions and 15 deletions.
15 changes: 10 additions & 5 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,18 @@ module.exports = {
},
},
'/pt-br/': {
selectText: 'Languages',
selectText: 'Linguas',
label: 'Português do Brasil',
editLinkText: 'Edit this page on GitHub',
editLinkText: 'Edite esta página no GitHub',
nav: [
{ text: 'Home', link: '/pt-br/' },
{ text: 'Guia', link: '/pt-br/guide/' },
{ text: 'API', link: '/pt-br/api/' }
],
serviceWorker: {
updatePopup: {
message: "New content is available.",
buttonText: "Refresh"
message: "Novo conteúdo está disponível.",
buttonText: "Atualizar"
}
},
},
Expand Down Expand Up @@ -147,7 +152,7 @@ module.exports = {
'/pt-br/': {
lang: 'pt-br',
title: '📈 vue-chartjs',
description: '⚡ Easy and beautiful charts with Chart.js and Vue.js'
description: '⚡ Gráficos bonitos e fácil com Chart.js e Vue.js'
},
'/fr-fr/': {
lang: 'fr-fr',
Expand Down
3 changes: 2 additions & 1 deletion docs/guide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ It abstracts the basic logic but exposes the Chart.js object to give you maximal

### NPM

You can install `vue-chartjs` over `npm`. However, you also need to add `chart.js` as a dependency to your project because `Chart.js` is a peerDependency. This way you can have full control over the versioning of `Chart.js`.
You can install `vue-chartjs` over `yarn` or `npm`. However, you also need to add `chart.js` as a dependency to your project because `Chart.js` is a peerDependency. This way you can have full control over the versioning of `Chart.js`.

```bash
yarn add vue-chartjs chart.js
```

```bash
npm install vue-chartjs chart.js --save
```
Expand Down
18 changes: 9 additions & 9 deletions docs/pt-br/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
home: true
heroImage: /vue-chartjs.png
actionText: Get Started
actionLink: /guide/
actionText: Começar
actionLink: /pt-br/guide/
features:
- title: Easy
details: Easy for both beginners and pros 🙌
- title: Extendable
details: Simple to use, easy to extend 💪
- title: Powerful
details: With the full power of chart.js 💯
footer: MIT Licensed | Copyright © 2018-present Jakub Juszczak
- title: Fácil
details: Fácil para ambos, iniciantes e profissionais 🙌
- title: Extensível
details: Simples de usar, fácil de estender 💪
- title: Poderoso
details: Com todo o poder do chart.js 💯
footer: MIT Licenciado | Copyright © 2018-presente Jakub Juszczak
---
128 changes: 128 additions & 0 deletions docs/pt-br/api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# Referência de codificação

## Props

Existem alguns props básicas definidas nos componentes fornecidos pelo `vue-chartjs`. Porque você os `estende`, eles são _invisíveis_, mas você pode substituí-los:

| Prop | Descrição |
| ----------- | ------------------------------------------------------- |
| width | largura do gráfico |
| height | altura do gráfico |
| chart-id | Id da tela |
| css-classes | String com classes css para a div circundante |
| styles | Objeto com estilos css para o div contêiner circundante |
| plugins | Array com plugins chartjs |

## Eventos

Se o mixin `reactiveData` ou `reactiveProp` estiver anexado, os seguintes eventos serão emitidos:

| Evento | Descrição |
| ---------------- | ------------------------------------------------------------------- |
| `chart:render` | se o mixin executar um renderizador completo |
| `chart:destroy` | se o mixin excluir a instância do objeto de gráfico |
| `chart:update` | se o mixin executar uma atualização em vez de uma nova renderização |
| `labels:update` | se novos labals foram definidos |
| `xlabels:update` | se novos xLabels foram definidos |
| `ylabels:update` | se novos yLabels foram definidos |

## Métodos Globais

Os métodos globais precisam ser importados.

### generateChart

- **Tipo:** `Function`
- **Argumentos**: `chart-id`, `chart-type`
- **Uso:**

```js
import { generateChart } from "vue-chartjs";
// O primeiro argumento é o ID do gráfico, depois o tipo de gráfico.
const CustomLine = generateChart("custom-line", "LineWithLine");
```

## Métodos de instância

Os métodos de instância podem ser usados ​​dentro do componente do gráfico.

### generateLegend()

Função auxiliar para gerar uma legenda HTML.

- **Tipo:** `Function`
- **Argumentos**: `none`
- **Uso:**

```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()
}
}
```

### addPlugin

No Chart.js, você pode definir plugins globais e embutidos. Os plug-ins globais estão funcionando sem problemas com o `vue-chartjs` como descrito no [Chart.js docs](http://www.chartjs.org/docs/latest/developers/plugins.html).

Se você deseja adicionar plug-ins embutidos, `vue-chartjs` expõe um método auxiliar chamado `addPlugin()`
Você deve chamar `addPlugin()` antes do método `renderChart()`.

- **Tipo:** `Function`
- **Argumentos**: `Array` de Plugins
- **Uso:**

```js
mounted () {
this.addPlugin({
id: 'my-plugin',
beforeInit: function (chart) {
...
}
})
}
```

### renderChart()

Cria uma instância Chart.js e renderiza o gráfico.

- **Tipo:** `Function`
- **Argumentos**: `Chart Data`, `Chart Options`
- **Uso:**

```js
mounted () {
this.renderChart({
labels: ['January', 'February'],
datasets: [
{
label: 'Data One',
backgroundColor: '#f87979',
data: [40, 20]
}
]},
{
responsive: true
}
)
}
```

## Objeto Chart.js

Você pode acessar o objeto Chart.js dentro do componente do gráfico com `this.$data._chart`

## Canvas

Você pode acessar canvas com `this.$refs.canvas`

0 comments on commit c09cc8e

Please sign in to comment.