diff --git a/README.md b/README.md index 1e33b6c..cb55f84 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ and include in your project: ```js - import Chart from "frappe-charts" + import { Chart } from "frappe-charts" ``` * ...or include within your HTML @@ -73,7 +73,8 @@ const data = { ] } -const chart = new Chart("#chart", { // or a DOM element +const chart = new frappe.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' diff --git a/docs/index.html b/docs/index.html index 8ce4ca6..a38c6d5 100644 --- a/docs/index.html +++ b/docs/index.html @@ -49,7 +49,7 @@
  <!--HTML-->
   <div id="chart"></div>
  // Javascript
-  let chart = new Chart( "#chart", { // or DOM element
+  let chart = new frappe.Chart( "#chart", { // or DOM element
     data: {
       labels: ["12am-3am", "3am-6am", "6am-9am", "9am-12pm",
       "12pm-3pm", "3pm-6pm", "6pm-9pm", "9pm-12am"],
@@ -211,7 +211,7 @@
               
-
  let heatmap = new Chart("#heatmap", {
+              
  let heatmap = new frappe.Chart("#heatmap", {
     type: 'heatmap',
     title: "Monthly Distribution",
     data: {
@@ -316,6 +316,10 @@
               
  import { Chart } from "frappe-charts"

... or include it directly in your HTML

  <script src="https://unpkg.com/frappe-charts@1.1.0"></script>
+

Use as:

+
  new Chart();          // ES6 module
+                        // or
+  new frappe.Chart();   // Browser