From 435abbd9837f4a360faef958865c98aea897a95f Mon Sep 17 00:00:00 2001 From: Sachin Philip Mathew Date: Mon, 3 Dec 2018 10:57:45 +0530 Subject: [PATCH 1/2] updated docs for es-modules with addision of css --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 9d844f4..d2ce1a0 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,13 @@ ```js import { Chart } from "frappe-charts" ``` + + ...or include following for es-modules(eg:vuejs): + ```js + import { Chart } from 'frappe-charts/dist/frappe-charts.esm.js' + // import css + import 'frappe-charts/dist/frappe-charts.min.css' + ``` * ...or include within your HTML From 7a93eec0ae8178f1f747b313e9c11da37ce79e24 Mon Sep 17 00:00:00 2001 From: Sachin Philip Mathew Date: Mon, 3 Dec 2018 11:07:14 +0530 Subject: [PATCH 2/2] load new chart instead of new frappe.chart for es modules --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index d2ce1a0..ea3f923 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,21 @@ const chart = new frappe.Chart("#chart", { // or a DOM element, }) ``` +...or for es-modules: +```js + +//replace new frappe.Chart() with new Chart() +const chart = new Chart("#chart", { // or a DOM element, + // new Chart() in case of ES6 module with above usage + title: "My Awesome Chart", + data: data, + type: 'axis-mixed', // or 'bar', 'line', 'scatter', 'pie', 'percentage' + height: 250, + colors: ['#7cd6fd', '#743ee2'] +}) +``` + + If you want to contribute: 1. Clone this repo.