Skip to content

Instantly share code, notes, and snippets.

@weakish
Created February 20, 2020 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weakish/5e03540ff9a9977fbda304de9734c5a0 to your computer and use it in GitHub Desktop.
Save weakish/5e03540ff9a9977fbda304de9734c5a0 to your computer and use it in GitHub Desktop.
Frappe Hello World
<script src="https://cdn.jsdelivr.net/npm/frappe-charts@1.2.4/dist/frappe-charts.min.iife.js"></script>
<div id="chart"></div>
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