добавил графики

This commit is contained in:
Dmitry Borisenko
2021-12-26 00:36:28 +01:00
parent 7cbfdcdd86
commit 9ad4d085fd
3 changed files with 31 additions and 6 deletions

17
package-lock.json generated
View File

@@ -562,6 +562,11 @@
"integrity": "sha512-o2RiJQ6DZaR/5+Si0qJUIy637QMRudSi9kU/FFzx9EZazrIdnBgpU+3sEWCxAVhH2RtxW2Oz+T4p2o8uOPVcgA==", "integrity": "sha512-o2RiJQ6DZaR/5+Si0qJUIy637QMRudSi9kU/FFzx9EZazrIdnBgpU+3sEWCxAVhH2RtxW2Oz+T4p2o8uOPVcgA==",
"dev": true "dev": true
}, },
"frappe-charts": {
"version": "1.6.2",
"resolved": "https://registry.npmjs.org/frappe-charts/-/frappe-charts-1.6.2.tgz",
"integrity": "sha512-9TC3/+YVUi84yYoEbxFiSqu+1FQ5If/ydUNj6i8FRpwynd08t6a7RkS+IRJozAk6NfdL8/LVTTE1DUOjjKZZxg=="
},
"fs-extra": { "fs-extra": {
"version": "10.0.0", "version": "10.0.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz",
@@ -1497,8 +1502,16 @@
"svelte": { "svelte": {
"version": "3.44.2", "version": "3.44.2",
"resolved": "https://registry.npmjs.org/svelte/-/svelte-3.44.2.tgz", "resolved": "https://registry.npmjs.org/svelte/-/svelte-3.44.2.tgz",
"integrity": "sha512-jrZhZtmH3ZMweXg1Q15onb8QlWD+a5T5Oca4C1jYvSURp2oD35h4A5TV6t6MEa93K4LlX6BkafZPdQoFjw/ylA==", "integrity": "sha512-jrZhZtmH3ZMweXg1Q15onb8QlWD+a5T5Oca4C1jYvSURp2oD35h4A5TV6t6MEa93K4LlX6BkafZPdQoFjw/ylA=="
"dev": true },
"svelte-frappe-charts": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/svelte-frappe-charts/-/svelte-frappe-charts-1.9.1.tgz",
"integrity": "sha512-cp2Sv+EXxdH5nIJ9I6ant9XP73Sc8CGXLzb0h8vpV0viH+zCCE+CEmo/cOiWL4JWNZrxRJ5UBdDGVk5nnORyKA==",
"requires": {
"frappe-charts": "^1.6.2",
"svelte": "^3.44.0"
}
}, },
"svelte-preprocess": { "svelte-preprocess": {
"version": "4.9.8", "version": "4.9.8",

View File

@@ -27,6 +27,7 @@
}, },
"dependencies": { "dependencies": {
"daisyui": "^1.16.4", "daisyui": "^1.16.4",
"sirv-cli": "^1.0.14" "sirv-cli": "^1.0.14",
"svelte-frappe-charts": "^1.9.1"
} }
} }

View File

@@ -5,12 +5,12 @@
router.mode.hash(); // enables hash navigation method router.mode.hash(); // enables hash navigation method
//router.mode.memory(); // enables in-memory navigation method //router.mode.memory(); // enables in-memory navigation method
//import Chart from "svelte-frappe-charts";
import Card from "./widgets/Card.svelte"; import Card from "./widgets/Card.svelte";
import Input from "./widgets/Input.svelte"; import Input from "./widgets/Input.svelte";
import Toggle from "./widgets/Toggle.svelte"; import Toggle from "./widgets/Toggle.svelte";
import Anydata from "./widgets/Anydata.svelte"; import Anydata from "./widgets/Anydata.svelte";
//import Modal from "svelte-simple-modal";
import Chart from "svelte-frappe-charts";
//==================================constants section======================================== //==================================constants section========================================
let debug = true; let debug = true;
@@ -135,6 +135,15 @@
}, },
]; ];
let datachart = {
labels: ["Sun", "Mon", "Tues", "Wed", "Thurs", "Fri", "Sat"],
datasets: [
{
values: [10, 12, 3, 9, 8, 15, 9],
},
],
};
let widgetCollection = {}; let widgetCollection = {};
widgetCollection = { widgetCollection = {
@@ -685,7 +694,9 @@
</Card> </Card>
</Route> </Route>
<Route path="/about"> <Route path="/about">
<Card title={"Список устройств"} /> <Card title={"Пример графика"}>
<Chart data={datachart} type="line" />
</Card>
</Route> </Route>
</div> </div>
</ul> </ul>