Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/dynamic styles #162

Merged
merged 2 commits into from
Aug 1, 2017
Merged

Feature/dynamic styles #162

merged 2 commits into from
Aug 1, 2017

Conversation

apertureless
Copy link
Owner

✨ 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

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

<script>
export default {
  data () {
    return {
          height: 100
    }
  },
  computed: {
    myStyles () {
      return {
        height: `${this.height}px`,
        position: 'relative'
      }
    }
  }
}
</script>

Fixes

#158

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>
```
@codecov
Copy link

codecov bot commented Jul 31, 2017

Codecov Report

Merging #162 into develop will not change coverage.
The diff coverage is 100%.

@@          Coverage Diff           @@
##           develop   #162   +/-   ##
======================================
  Coverage      100%   100%           
======================================
  Files           11     11           
  Lines          105    114    +9     
======================================
+ Hits           105    114    +9
Impacted Files Coverage Δ
src/BaseCharts/HorizontalBar.js 100% <100%> (ø) ⬆️
src/BaseCharts/Line.js 100% <100%> (ø) ⬆️
src/BaseCharts/PolarArea.js 100% <100%> (ø) ⬆️
src/BaseCharts/Radar.js 100% <100%> (ø) ⬆️
src/BaseCharts/Doughnut.js 100% <100%> (ø) ⬆️
src/BaseCharts/Scatter.js 100% <100%> (ø) ⬆️
src/BaseCharts/Pie.js 100% <100%> (ø) ⬆️
src/BaseCharts/Bar.js 100% <100%> (ø) ⬆️
src/BaseCharts/Bubble.js 100% <100%> (ø) ⬆️

@apertureless apertureless merged commit c9bc36e into develop Aug 1, 2017
@apertureless apertureless deleted the feature/dynamic_styles branch August 4, 2017 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant