# <%= appName %> Chart module for _{your chart type here}_. ![](preview.png) ### Install ```bash $ npm install --save <%= appName %> ``` ##### Requirements This module uses ES6 syntax. To use as a pre-compiled module, you'll need a compiler like [babel](https://babeljs.io/). ### Use In the client, include the `global-chart.js` bundle, which defines a global chart object, `<%= objName %>`: ```html ``` To use as a module, simply import the chart object: ```javascript import <%= objName %> from '<%= appName %>'; ``` The chart object has two methods, one to create the chart, initially, and another to update it. ```javascript var myChart = new <%= objName %>(); // create needs a selection string and prefectched data myChart.create('#chart', data); // update needs only new data myChart.update(newData); ``` To apply this chart's default styles when using SCSS, simply define the variable `$<%= objName %>-container` to represent the ID or class of the chart's container(s) and import the `_chart-styles.scss` partial. ```CSS $<%= objName %>-container: '#chart'; @import 'path/to/<%= appName %>/src/scss/_chart-styles'; ``` ### Developing Write your chart code in `chart.js` and add custom styles to `_chart-styles.scss`. Then, just run gulp: ```bash $ gulp ``` Or to minimize javascript before publishing: ```bash $ gulp --production ```