From 067f0be01fddf4713cdb4fa5f347d4023121e81d Mon Sep 17 00:00:00 2001 From: Jakub Juszczak Date: Sun, 26 Jun 2016 16:08:10 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Update=20readme=20and=20add=20an?= =?UTF-8?q?other=20example?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 8572626..f292c1c 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ import BarChart from '../BaseCharts/Bar' export default BarChart.extend({ ready () { + // Overwriting base render method with actual data. this.render({ labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], datasets: [ @@ -32,6 +33,20 @@ Then simply import and use your own extended component and use it like a normal import CommitChart from 'path/to/component/CommitChart' ``` +## Another Example with options + +You can overwrite the default chart options. Just pass the options object as a second paramenter to the render method + +```javascript +import LineChart from '../BaseCharts/Line' + +export default LineChart.extend({ + props: [data, options], + ready () { + this.render(this.data, this.options) + } +}) +``` ## Available ChartJ