Created
February 20, 2020 14:59
-
-
Save weakish/5e03540ff9a9977fbda304de9734c5a0 to your computer and use it in GitHub Desktop.
Frappe Hello World
This file contains hidden or 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
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/frappe-charts.min.iife.js"></script> | |
<div id="chart"></div> |
This file contains hidden or 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
const data = { | |
labels: ["2 Feb", "3 Feb", "4 Feb", "5 Feb*", "6 Feb", "7 Feb", "8 Feb", "9 Feb*", "10 Feb*", "11 Feb", "12 Feb", "13 Feb", "14 Feb*", "15 Feb", "16 Feb", "17 Feb*", "18 Feb*", "19 Feb"], | |
datasets: [ | |
{ | |
name: "quarantine", chartType: 'line', | |
values: [34, 35, 33, 33, 33, 30, 29, 29, 29, 26, 10, 10, 10, 10, 10, 10, 10, 10] | |
} | |
], | |
yRegions: [ | |
{ label: "Households", | |
start: 0, end: 40, | |
options: { labelPos: 'right' } | |
} | |
] | |
} | |
const chart = new frappe.Chart( "#chart", { | |
data: data, | |
title: "Quarantine Chart (* means interpolation)", | |
type: 'line', | |
height: 300, | |
colors: ['purple', '#ffa3ef'] | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment