Skip to content

Commit 2cecf07

Browse files
committed
docs: Update docs and fix spelling and grammar issues
1 parent 5fa95af commit 2cecf07

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

docs/guide/README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@ It abstracts the basic logic but exposes the Chart.js object to give you maximal
1212

1313
### NPM
1414

15-
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 have full control over the versioning of Chart.js
15+
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 have full control over the versioning of Chart.js
1616

1717
`yarn add vue-chartjs chart.js` or `npm install vue-chartjs chart.js --save`
1818

1919
::: tip
20-
If you are using vue 1.x please use the `legacy` tag. However the Vue 1 version is not maintained anymore.
20+
If you are using vue 1.x please use the `legacy` tag. However, the Vue 1 version is not maintained anymore.
2121

2222
`yarn add vue-chartjs@legacy`
2323
:::
2424

2525
### Browser
2626

2727
You can also use `vue-chartjs` directly in the browser.
28-
First add the `Chart.js` script and then the `vue-chartjs` script.
28+
First, add the `Chart.js` script and then the `vue-chartjs` script.
2929

3030
```html
3131
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.min.js"></script>
@@ -36,13 +36,13 @@ First add the `Chart.js` script and then the `vue-chartjs` script.
3636

3737
Every chart type that is available in `Chart.js` is exported as a named component and can be imported as such. These components are normal Vue components, however you need to `extend` it.
3838

39-
The idea behind `vue-chartjs` is to provide easy to use components, with maximum flexibility and extensibility. To achive this, you need to create your own *Chart Component* and extend it with the provided `vue-chartjs` components.
39+
The idea behind `vue-chartjs` is to provide easy to use components, with maximum flexibility and extensibility. To achieve this, you need to create your own *Chart Component* and extend it with the provided `vue-chartjs` components.
4040

4141
This way, the methods and logic in the Chart components, get merged into your own chart component.
4242

4343
## Creating your first Chart
4444

45-
You need to import the base chart and extend it. This gives more flexibility when working with different data. You can encapsulate your components and use props to pass data or you can input them directly inside the component. However your component is not reusable this way.
45+
You need to import the base chart and extend it. This gives more flexibility when working with different data. You can encapsulate your components and use props to pass data or you can input them directly inside the component. However, your component is not reusable this way.
4646

4747
You can import the whole package or each module individual. Then you need either to use `extends:` or `mixins:[]`. And then in the `mounted()` hook, call `this.renderChart()`. This will create your chart instance.
4848

@@ -63,11 +63,11 @@ You can either use `extends: Bar` or `mixins: [Bar]`
6363

6464
The method `this.renderChart()` is provided by the `Bar` component and is accepting two parameters. Both are `objects`. The first one is your chart data and the second one is an options object.
6565

66-
Check out the offical [Chart.js docs](http://www.chartjs.org/docs/latest/#creating-a-chart) to see the object structure you need to provide.
66+
Check out the official [Chart.js docs](http://www.chartjs.org/docs/latest/#creating-a-chart) to see the object structure you need to provide.
6767

6868
### Vue Single File Components
6969

70-
Most examples in the docs are based on javascript files and not `.vue` files. This is because you mostly will only need the `<script>` block. You can however use `.vue` files as well.
70+
Most examples in the docs are based on javascript files and not `.vue` files. This is because you mostly will only need the `<script>` block. You can, however, use `.vue` files as well.
7171

7272
**Chart.vue**
7373

@@ -94,7 +94,7 @@ Do not include the `<template>` tag to your `.vue` files. Vue can **not** merge
9494

9595
## Updating Charts
9696

97-
Chart.js does not provide a live update if you change the datasets. However `vue-chartjs` provides two mixins to achieve this.
97+
Chart.js does not provide a live update if you change the datasets. However, `vue-chartjs` provides two mixins to achieve this.
9898

9999
- `reactiveProp`
100100
- `reactiveData`
@@ -202,7 +202,7 @@ The reactive mixins will emit events if the data changes. You can listen to them
202202

203203
### Troubleshooting
204204

205-
The reactivity system at it's current state is not **robust**. You will run into several problems with it, because there are many use-cases and ways to pass in your data.
205+
The reactivity system at its current state is not **robust**. You will run into several problems with it because there are many use-cases and ways to pass in your data.
206206

207207
#### Options
208208

@@ -260,9 +260,9 @@ watch: {
260260

261261
### Chart with props
262262

263-
Your goal should be to create reuseable chart components. For this purpose you should utilize Vue.js props to pass in your options and your chart data. This way the chart itself does not care,about fetching data and is only for presentation.
263+
Your goal should be to create reusable chart components. For this purpose, you should utilize Vue.js props to pass in your options and your chart data. This way the chart itself does not care, about fetching data and is only for presentation.
264264

265-
First create your component
265+
First, create your component
266266

267267
```js
268268
import { Line } from 'vue-chartjs'
@@ -327,7 +327,7 @@ export default {
327327

328328
### Chart with API data
329329

330-
It is a common pattern to use an API to get your data. However there are some things to keep in mind. The most common problem is, that you mount your chart component directly and pass in data from an async api call. The problem with this approach is, that chart.js tries to render your chart and access the chart data, but your api call is async. So you chart mounts before your data arrives.
330+
It is a common pattern to use an API to get your data. However, there are some things to keep in mind. The most common problem is, that you mount your chart component directly and pass in data from an async API call. The problem with this approach is, that chart.js tries to render your chart and access the chart data, but your API call is async. So you chart mounts before your data arrives.
331331

332332
To prevent this, a simple `v-if` is the best solution.
333333

@@ -395,7 +395,7 @@ export default {
395395

396396
### Chart with dynamic styles
397397

398-
You can set `responsive: true` and pass in an styles object which get applied as inline styles to the outer div. This way you can change the height and width of the outer container dynamically. Which is not the default behaviour of chart.js. It is best to use computed properties for this.
398+
You can set `responsive: true` and pass in a styles object which get applied as inline styles to the outer div. This way you can change the height and width of the outer container dynamically. Which is not the default behaviour of chart.js. It is best to use computed properties for this.
399399

400400
::: warning
401401
You need to set `position: relative`
@@ -437,7 +437,7 @@ export default {
437437

438438
Sometimes you need to extend the default Chart.js charts. There are a lot of [examples](http://www.chartjs.org/docs/latest/developers/charts.html) how to extend and modify the default charts. Or you want to create a own chart type.
439439

440-
In `vue-chartjs` you can do this pretty much the same way.
440+
In `vue-chartjs`, you can do this pretty much the same way.
441441

442442
```js
443443
// 1. Import Chart.js so you can use the global Chart object

0 commit comments

Comments
 (0)