From 7247477d5104c196a8f90837b788a7989f20fdff Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Wed, 8 Dec 2021 17:10:36 +0700 Subject: [PATCH] add refresh function --- src/app/data-provider.service.ts | 2 +- src/app/home/home.page.html | 6 +++++- src/app/home/home.page.ts | 10 +++++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/app/data-provider.service.ts b/src/app/data-provider.service.ts index a0f9056..5d52aef 100644 --- a/src/app/data-provider.service.ts +++ b/src/app/data-provider.service.ts @@ -17,7 +17,7 @@ export class DataProviderService { // allData(){ // return this.http.get('https://bc50-104-199-132-26.ngrok.io/alldata'); // } - public url = 'http://796c-35-186-184-86.ngrok.io/' + public url = 'http://6447-35-186-184-86.ngrok.io' insert(dbname: String,colname: String,web: String,cat: String){ //return this.http.get("http://localhost:/insert?dbname="+dbname+"&collectionname="+colname+"&web="+web+"&cat="+cat); return this.http.get(this.url+"/insert?dbname=data&collectionname=testdata&web=com.burbn.instagram&cat=photos"); diff --git a/src/app/home/home.page.html b/src/app/home/home.page.html index dcc5e99..cd7eab3 100644 --- a/src/app/home/home.page.html +++ b/src/app/home/home.page.html @@ -1,11 +1,15 @@ - Charts.js in Ionic 5 + Charts + + + +
diff --git a/src/app/home/home.page.ts b/src/app/home/home.page.ts index 42e07fe..91ab6f1 100644 --- a/src/app/home/home.page.ts +++ b/src/app/home/home.page.ts @@ -221,5 +221,13 @@ export class HomePage { } }); } - + doRefresh(event){ + this.myDataProvider.updateData(); + this.barChartMethod(); + this.doughnutChartMethod(); + setTimeout(() => { + console.log('Async operation has ended'); + event.target.complete(); + }, 2000); + } }