Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Yopadd committed Aug 30, 2016
1 parent 19b73e6 commit 4777a33
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,37 @@ npm install vue-chartist

## Setup

This package include Chartist
__This package include Chartist__
```javascript
Vue.use(require('vue-chartist'))
```

## Usage

In your HTML, add `<chartist>` tag. This tag take following attributes :
In your HTML, add `<chartist>` tag. This tag take the following attributes :

- **ratio** - `String`
- __ratio__ - `String`
class ratio of Chartist, see values on [Chartist web site](https://gionkunz.github.io/chartist-js/getting-started.html#as-simple-as-it-can-get)

- **type** - `String` (required)
the chart type, possible values :
- __type__ - `String` (required)
chart type, possible values :
- `Line`
- `Bar`
- `Pie`

- **data** - `Object`
the data object like this
- __data__ - `Object`
data object like this
```javascript
const data = {
labels: ["A", "B", "C"],
series:[[1, 3, 2], [4, 6, 5]]
}
```

- **options** - `Object`
the options object, see defaultOptions on [API Documentation](https://gionkunz.github.io/chartist-js/api-documentation.html)
- __options__ - `Object`
options object, see defaultOptions on [API Documentation](https://gionkunz.github.io/chartist-js/api-documentation.html)

- **event-handlers** - `Array`
- __event-handlers__ - `Array`
a special array to use `chart.on(event, function)`
```javascript
const eventHandlers = [{
Expand All @@ -54,8 +54,8 @@ const eventHandlers = [{
}]
```

- **responsive-options** - `Array`
the object for responsive options
- __responsive-options__ - `Array`
object for responsive options

## Example

Expand Down Expand Up @@ -87,10 +87,13 @@ new Vue({

## Customize chart with no data

If chart datas are empty or not definite the plugin add `ct-nodata` class and witre a message on the element.
That way, you can customize your element with CSS when you have no data to display. To choose your message use the options plugin :
If chart data are empty or not definied the plugin add `ct-nodata` (or a custom class, see options plugin) class and write a message on the element.
That way, you can customize your element with CSS when you have no data to display. To choose your message use the options plugin.

## Options Plugin
```javascript
Vue.use(require('vue-chartist'), {
messageNoData: "You have not enough data"
messageNoData: "You have not enough data",
classNoData: "empty"
})
```

0 comments on commit 4777a33

Please sign in to comment.