Commit Graph

88 Commits

Author SHA1 Message Date
Nick Nissen bdeac75422 Refactor: Don't include package.json into dist files
Instead of including package.json file into the build files.
Use webpacks DefinePlugin to define a global lib version.
2018-02-05 13:40:04 +01:00
Nick Nissen ebcab9f2f8 Extract identical code into shared function 2018-02-05 13:32:05 +01:00
Nick Nissen 96adf9eab3 Refactor: Extract identical code into a function 2018-01-31 07:58:29 +01:00
Jakub Juszczak ecae747ba3 chore(examples): Update reactive prop examples 2018-01-12 13:52:45 +01:00
Jakub Juszczak ac5d4d824c feat(charts): Remove default styling 2018-01-12 13:30:29 +01:00
Jakub Juszczak 39ff839d92 fix(mixins): Check for chartjs instance before rendering chart
Closes #288
2018-01-12 13:13:46 +01:00
Daniel Shuy 072724fc6f Fix references to private _plugins data property 2017-12-13 20:58:43 +08:00
Daniel Shuy 5486560257 Add prop for inline plugins 2017-12-13 20:10:01 +08:00
Jakub d498b7c8cf Feature/v3 (#225)
* Remove Vue dependency and change extends

Signed-off-by: Jakub Juszczak <netghost03@gmail.com>

* 💎 Release new version 3.0.0-rc0

* ⬆️ Update examples

* 📝 Update README.md

* ⬆️ Update examples

* ⬆️ Update englishd docs

* ⬆️ Update transalted docs with current code examples

* 🔥 Remove dist files from gitignore

* ⬆️ Update dependencies vue and chartjs

* Change private data

Implements #182. The private chart instance is now in the vue.js data model. And can be accessed over `this.$data._chart`
Updated unit tests

* 📝 Update docs with private data

*  Add codeclimate ignore

* ⬆️ Update codeclimate

* ⬆️ Update codeclimate

* ⬆️ Update codeclimate

Add build and config folders to ignore
2017-10-14 16:27:07 +02:00
Jakub Juszczak e4977a6be7 Replace deepmerge with lodash.merge 2017-09-12 10:53:31 +02:00
Jakub Juszczak 750abb2e88 Add dependency deepmerge 2017-09-08 09:59:37 +02:00
Jakub Juszczak 154e284528 🔥 Remove default styles object as it causes problems
This will fix #176

Signed-off-by: Jakub Juszczak <netghost03@gmail.com>
2017-09-02 15:11:47 +02:00
Jakub Juszczak d26078f08c 🔥 Remove lodash merge
Replaced with Object.assign()

Signed-off-by: Jakub Juszczak <netghost03@gmail.com>
2017-09-02 14:27:48 +02:00
Jakub Juszczak 6de69631b3 Replace lodash with lodash.merge
Single module should be smaller

Signed-off-by: Jakub Juszczak <netghost03@gmail.com>
2017-09-02 13:40:16 +02:00
bertolds 676a60a363 fix linting errors 2017-08-07 09:49:46 -04:00
bertolds f60f87c141 Merge branch 'develop' into patch-1 2017-08-07 09:46:37 -04:00
bertolds b7f2bf7db2 Merge branch 'patch-1' of https://github.com/dsbert/vue-chartjs into patch-1 2017-08-07 09:46:03 -04:00
Dan 1e392091ea Add support for xLabels and yLabels 2017-08-07 09:41:33 -04:00
Jakub Juszczak ab31dfe727 🐛 Fix default height to 100% 2017-08-05 14:23:38 +02:00
Dan a5b58c3b98 Add support for xLabels and yLabels 2017-08-04 15:06:22 -04:00
Jakub Juszczak 7e52380bd4 Clean up example 2017-07-31 21:46:37 +02:00
Jakub Juszczak 32229fbfdd Add dynamic styles and css classes as prop
You can now pass in css classes as a string for the surrounding div of the canvas and a styles object which will be applied as inline styles.
This way you can have a dynamic height with `reposnive: true`

## Example

```js
<template>
   <line-chart :styles="myStyles"/>
</template>

<script>
export default {
  data () {
    return {
          height: 100
    }
  },
  computed: {
    myStyles () {
      return {
        height: `${this.height}px`,
        position: 'relative'
      }
    }
  }
}
</script>
```
2017-07-31 21:42:48 +02:00
Clark Du ab9721b577 remove useless labels 2017-07-22 22:36:05 +08:00
kutrumi 882bdd86b8 ✏️ Remove generateLegend() from initialization codes 2017-07-08 19:18:20 +09:00
Jakub Juszczak f04441ab36 🐛 Fix missing exports 2017-07-05 21:04:10 +02:00
Jakub Juszczak b23ce23015 Merge branch 'develop' of github.com:apertureless/vue-chartjs into develop
* 'develop' of github.com:apertureless/vue-chartjs:
  Fix beforeDestory when renderChart was not called
2017-07-04 10:30:53 +02:00
Jakub Juszczak 7f62914edb Add addPlugin method to scatter chart 2017-07-04 10:30:46 +02:00
Zhang Yijiang 3e423fd7ae Fix beforeDestory when renderChart was not called 2017-07-04 09:58:52 +08:00
Jakub 362639c4e2 Merge pull request #137 from kurbar/inline-plugins-support
Add support for inline plugins
2017-07-03 10:09:23 +02:00
Karl Viiburg ef127686cd Add support for inline plugins 2017-07-03 08:12:28 +03:00
Jakub Juszczak ba5cedc981 📝 Update README and assets 2017-07-02 17:02:34 +02:00
Jakub Juszczak d304a2c5ab Add scatter chart 2017-07-02 16:40:38 +02:00
Jakub Juszczak 80799b7bd5 🐛 Fix reactive-prop example 2017-07-02 16:18:47 +02:00
Jakub Juszczak 9d44758976 📺 Add reactive-prop example 2017-07-02 16:14:03 +02:00
Jakub Juszczak 7a048a07df 🐛 Fix #122 reactive mixin
Reactive mixin broke if the initial data was set to null.
2017-07-02 16:02:10 +02:00
Spencer Dellis dbce4d7c2c Fixing eslint issues. 2017-05-19 11:11:56 -04:00
Spencer Dellis d49b06f92a Fixing eslint issues. 2017-05-19 11:11:33 -04:00
Spencer Dellis 5cc8f0a878 Resolve reactivity mixin animation issue.
A small consequence of replacing the entire dataset in the [reactive mixins files](https://github.com/apertureless/vue-chartjs/blob/develop/src/mixins/reactiveData.js) is that it causes charts to completely re-render even if only the 'data' attribute of a dataset is changing. In my case, I set up a reactive doughnut chart with two data points but whenever the data values change, instead of shifting the fill coloring, it completely re-renders the entire chart.

You can see the issue in this fiddle (the problem remains even when changing chart type):
https://jsfiddle.net/sg0c82ev/11/

To solve the issue, I instead run a diff between the new and old dataset keys, remove keys that aren't present in the new data,  and update the rest of the attributes individually. After making these changes my doughnut chart is animating as expected (even when adding and removing new dataset attributes).

A fiddle with my changes:
https://jsfiddle.net/sg0c82ev/12/

Perhaps this is too specific of a scenario to warrant a complexity increase (and better suited for a custom handler) but I figured it would be better to dump it here and make it available for review. Let me know what you think.
2017-05-19 03:16:12 -04:00
Spencer Dellis b762d400d2 Removing unnecessary line 2017-05-19 03:13:43 -04:00
Spencer Dellis ceb5988e1c Resolve reactive props animation issue.
A small consequence of replacing the entire dataset in the mixins files is that it causes certain charts to completely re-render even if only the 'data' attribute of a dataset is changing. In my case, I set up a reactive doughnut chart with two data points but whenever the data values change, instead of shifting the fill coloring, it completely re-renders the entire chart.

You can see the issue in this fiddle (note the constant re-rendering):
https://jsfiddle.net/sg0c82ev/11/

To solve the issue, I instead run a diff between the new and old dataset keys, remove keys that aren't present in the new data,  and update the rest of the attributes individually. After making these changes my doughnut chart is animating as expected (even when adding and removing new dataset attributes).

A fiddle with my changes:
https://jsfiddle.net/sg0c82ev/12/

Perhaps this is too specific of a scenario to warrant a complexity increase like this (and better suited for a custom watcher) but I figured it would be better to dump it here and make it available for review. Let me know what you think.
2017-05-19 02:40:29 -04:00
Jakub Juszczak f32d989334 🔥 Remove deprecated type argument in barchart
The BarChart got splitted into HorizontalBar and Bar, so the type is not nessasary anymore.
2017-04-21 16:16:31 +02:00
Jakub Juszczak 2c8d1169e8 Add version to object 2017-04-05 16:04:07 +02:00
Jakub Juszczak 348de825bf Add new entry for development 2017-03-22 19:02:49 +01:00
Сергей Степанов fcaa3dee91 separate HorizontalBar component added, to remove optional 'type' parameter at Bar, which was ignored inside reactive mixins 2017-03-07 14:14:46 +03:00
Jakub Juszczak 874b674803 🐛 Fix reactiveMixins issue #42 2017-02-22 15:39:42 +01:00
Jakub e048ca5257 🐛 Fix ReactiveProp example 2017-02-21 18:54:28 +01:00
Jakub Juszczak 6a82e42c6e 🐛 Fix eslint errors 2017-02-14 17:37:54 +01:00
Jakub Juszczak aa76f518cb 🔨 Change reactiveMixins
Destroy chart instance on render()
Add additional check for dataset length
Add comments
Refactor reactiveData to match reactiveProp style
2017-02-14 17:31:18 +01:00
Jakub Juszczak bb21a40506 Rewrite template option to render function 2016-12-20 14:36:35 +01:00
Jakub Juszczak 5fe11ea5a9 Change mixins exports to be seperate 2016-12-17 17:29:18 +01:00