-
Notifications
You must be signed in to change notification settings - Fork 724
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docs] add treeshaking selective import
- Loading branch information
Showing
2 changed files
with
9 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,7 +49,7 @@ <h6 class="margin-vertical-rem">Create a chart</h6> | |
<pre><code class="hljs html"> <!--HTML--> | ||
<div id="chart"></div></code></pre> | ||
<pre><code class="hljs javascript"> // 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 @@ <h6 class="margin-vertical-rem"> | |
<div class="btn-group export-buttons mt-1 mx-auto" role="group"> | ||
<button type="button" class="btn btn-sm btn-secondary export-heatmap">Export ...</button> | ||
</div> | ||
<pre><code class="hljs javascript margin-vertical-px"> let heatmap = new Chart("#heatmap", { | ||
<pre><code class="hljs javascript margin-vertical-px"> let heatmap = new frappe.Chart("#heatmap", { | ||
type: 'heatmap', | ||
title: "Monthly Distribution", | ||
data: { | ||
|
@@ -316,6 +316,10 @@ <h6 class="margin-vertical-rem">Install</h6> | |
<pre><code class="hljs javascript"> import { Chart } from "frappe-charts"</code></pre> | ||
<p class="step-explain">... or include it directly in your HTML</p> | ||
<pre><code class="hljs html"> <script src="https://unpkg.com/[email protected]"></script></code></pre> | ||
<p class="step-explain">Use as:</p> | ||
<pre><code class="hljs javascript"> new Chart(); // ES6 module | ||
// or | ||
new frappe.Chart(); // Browser</code></pre> | ||
|
||
</div> | ||
</div> | ||
|