Commit Graph

79 Commits

Author SHA1 Message Date
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
Jakub Juszczak 1f91c96f83 Add demo page for github pages
Signed-off-by: Jakub Juszczak <netghost03@gmail.com>
2016-12-07 08:38:30 +01:00
Jakub 75925f0d5c Merge pull request #14 from wahaha2012/feature-horizontal-bar
add horizontal bar parameter
2016-10-23 19:20:17 +02:00
wxwdesign ddb47ff63a add horizontal bar parameter 2016-10-22 21:17:21 +08:00
Jakub Juszczak 6f77de832e 🐛 Fix missing export 2016-10-15 13:00:24 +02:00
Jakub Juszczak f94b320dfa Change reactiveDataMixin 2016-10-15 12:58:51 +02:00
Jakub Juszczak ecdb98c4c8 🐛 Fix paths 2016-10-02 18:30:48 +02:00
Jakub Juszczak c21cf2f3ac Add export for mixins 2016-10-02 18:26:38 +02:00
Jakub Juszczak 06c3148897 ⬆️ Update examples 2016-10-02 18:25:02 +02:00
Jakub Juszczak e716482154 Add reactiveProperty mixin 2016-10-02 18:10:44 +02:00