From 23f7e98dc776ba96962e609c30a6ccff5f85b4b9 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Thu, 3 Sep 2020 17:50:29 +0200 Subject: [PATCH] Fix grafico chartjs --- GPW_Data/Objects.cs | 2 +- GPW_Smart/Content/Style.css | 3 +- GPW_Smart/Content/Style.less | 50 ++++++++----------- GPW_Smart/Content/Style.min.css | 2 +- GPW_Smart/Controllers/TempRilController.cs | 12 ++--- GPW_Smart/WebUserControls/cmp_chart.ascx | 46 +++++++++-------- GPW_Smart/WebUserControls/cmp_chart.ascx.cs | 16 +++++- .../cmp_chart.ascx.designer.cs | 9 ++++ 8 files changed, 80 insertions(+), 60 deletions(-) diff --git a/GPW_Data/Objects.cs b/GPW_Data/Objects.cs index 86a6f42..d08d000 100644 --- a/GPW_Data/Objects.cs +++ b/GPW_Data/Objects.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace GPW_data { - public class chartJsTimeSerie + public class chartJsTSerie { public DateTime x { get; set; } public decimal y { get; set; } diff --git a/GPW_Smart/Content/Style.css b/GPW_Smart/Content/Style.css index 8516254..3d11919 100644 --- a/GPW_Smart/Content/Style.css +++ b/GPW_Smart/Content/Style.css @@ -23,7 +23,8 @@ background-repeat: no-repeat; } canvas { - background: #f0f0f0; + /*border: 1px solid #339933; + background: #fafffa;*/ width: 100%; height: auto; } diff --git a/GPW_Smart/Content/Style.less b/GPW_Smart/Content/Style.less index 93354f0..163360f 100644 --- a/GPW_Smart/Content/Style.less +++ b/GPW_Smart/Content/Style.less @@ -1,6 +1,5 @@  -.logo -{ +.logo { background-image: url(../images/logo_sw.png); -ms-filter: "alpha(opacity=50)"; filter: alpha(opacity=50); @@ -9,11 +8,11 @@ width: 800px; height: 300px; margin: 50px auto 50px auto; - vertical-align:middle; + vertical-align: middle; background-repeat: no-repeat; } -.logo:hover -{ + +.logo:hover { background-image: url(../images/logo_sw.png); -ms-filter: "alpha(opacity=100)"; filter: alpha(opacity=100); @@ -22,19 +21,19 @@ width: 800px; height: 300px; margin: 50px auto 50px auto; - vertical-align:middle; + vertical-align: middle; background-repeat: no-repeat; } canvas { - background: #f0f0f0; + /*border: 1px solid #339933; + background: #fafffa;*/ width: 100%; height: auto; } -.bodyMainCenter -{ +.bodyMainCenter { /* background-image: url(../images/logo_sw.png); -khtml-opacity: .50; -moz-opacity: .50; -ms-filter: "alpha(opacity=50)"; filter: alpha(opacity=50); filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0.5); opacity: .50; */ vertical-align: middle; border-left: #0D0083 1px solid; /*border-top: #0D0083 1px solid;*/ @@ -45,28 +44,27 @@ canvas { background-attachment: scroll; background-repeat: no-repeat; } -.bodyCenter -{ + +.bodyCenter { vertical-align: middle; text-align: center; height: 100%; width: 100%; } -.centerMenu -{ + +.centerMenu { background-color: White; text-align: center; border-width: thin; border-style: groove; border-color: Blue; } -A:hover -{ + +A:hover { color: red; } -.bodyMain -{ +.bodyMain { /* background-image: url(../images/logo_sw.png); -khtml-opacity: .50; -moz-opacity: .50; -ms-filter: "alpha(opacity=50)"; filter: alpha(opacity=50); filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0.5); opacity: .50; */ vertical-align: top; border-left: #0D0083 1px solid; /*border-top: #0D0083 1px solid;*/ @@ -76,16 +74,15 @@ A:hover background-attachment: scroll; background-repeat: no-repeat; } -.bodyMainEmpty -{ + +.bodyMainEmpty { vertical-align: top; border-left: maroon 1px solid; height: 100%; width: 100%; } -.bodyMainWhite -{ +.bodyMainWhite { vertical-align: top; border-left: maroon 1px solid; height: 100%; @@ -95,21 +92,18 @@ A:hover background-repeat: no-repeat; } -.bodyMainWhite a:hover -{ +.bodyMainWhite a:hover { color: white; } -.bodyMainNoLogo -{ +.bodyMainNoLogo { vertical-align: top; border-left: maroon 1px solid; height: 100%; width: 100%; } -.bodyMainLogoPiccolo -{ +.bodyMainLogoPiccolo { background-image: url(../images/sfondoMedio.png); background-position: 97% 210px; vertical-align: top; @@ -120,6 +114,6 @@ A:hover background-repeat: no-repeat; } -.textError{ +.textError { color: red; } diff --git a/GPW_Smart/Content/Style.min.css b/GPW_Smart/Content/Style.min.css index 32fa5ce..29e2d2e 100644 --- a/GPW_Smart/Content/Style.min.css +++ b/GPW_Smart/Content/Style.min.css @@ -1 +1 @@ -.logo{background-image:url(../images/logo_sw.png);-ms-filter:"alpha(opacity=50)";filter:alpha(opacity=50);filter:progid:DXImageTransform.Microsoft.Alpha(opacity=.5);opacity:.5;width:800px;height:300px;margin:50px auto 50px auto;vertical-align:middle;background-repeat:no-repeat;}.logo:hover{background-image:url(../images/logo_sw.png);-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100);filter:progid:DXImageTransform.Microsoft.Alpha(opacity=1);opacity:1;width:800px;height:300px;margin:50px auto 50px auto;vertical-align:middle;background-repeat:no-repeat;}canvas{background:#f0f0f0;width:100%;height:auto;}.bodyMainCenter{vertical-align:middle;border-left:#0d0083 1px solid;text-align:center;height:100%;width:100%;background-position:center;background-attachment:scroll;background-repeat:no-repeat;}.bodyCenter{vertical-align:middle;text-align:center;height:100%;width:100%;}.centerMenu{background-color:#fff;text-align:center;border-width:thin;border-style:groove;border-color:#00f;}A:hover{color:#f00;}.bodyMain{vertical-align:top;border-left:#0d0083 1px solid;height:100%;width:100%;background-position:center;background-attachment:scroll;background-repeat:no-repeat;}.bodyMainEmpty{vertical-align:top;border-left:#800000 1px solid;height:100%;width:100%;}.bodyMainWhite{vertical-align:top;border-left:#800000 1px solid;height:100%;width:100%;background-position:center;background-attachment:scroll;background-repeat:no-repeat;}.bodyMainWhite a:hover{color:#fff;}.bodyMainNoLogo{vertical-align:top;border-left:#800000 1px solid;height:100%;width:100%;}.bodyMainLogoPiccolo{background-image:url(../images/sfondoMedio.png);background-position:97% 210px;vertical-align:top;border-left:#800000 1px solid;height:100%;width:100%;background-attachment:scroll;background-repeat:no-repeat;}.textError{color:#f00;} \ No newline at end of file +.logo{background-image:url(../images/logo_sw.png);-ms-filter:"alpha(opacity=50)";filter:alpha(opacity=50);filter:progid:DXImageTransform.Microsoft.Alpha(opacity=.5);opacity:.5;width:800px;height:300px;margin:50px auto 50px auto;vertical-align:middle;background-repeat:no-repeat;}.logo:hover{background-image:url(../images/logo_sw.png);-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100);filter:progid:DXImageTransform.Microsoft.Alpha(opacity=1);opacity:1;width:800px;height:300px;margin:50px auto 50px auto;vertical-align:middle;background-repeat:no-repeat;}canvas{width:100%;height:auto;}.bodyMainCenter{vertical-align:middle;border-left:#0d0083 1px solid;text-align:center;height:100%;width:100%;background-position:center;background-attachment:scroll;background-repeat:no-repeat;}.bodyCenter{vertical-align:middle;text-align:center;height:100%;width:100%;}.centerMenu{background-color:#fff;text-align:center;border-width:thin;border-style:groove;border-color:#00f;}A:hover{color:#f00;}.bodyMain{vertical-align:top;border-left:#0d0083 1px solid;height:100%;width:100%;background-position:center;background-attachment:scroll;background-repeat:no-repeat;}.bodyMainEmpty{vertical-align:top;border-left:#800000 1px solid;height:100%;width:100%;}.bodyMainWhite{vertical-align:top;border-left:#800000 1px solid;height:100%;width:100%;background-position:center;background-attachment:scroll;background-repeat:no-repeat;}.bodyMainWhite a:hover{color:#fff;}.bodyMainNoLogo{vertical-align:top;border-left:#800000 1px solid;height:100%;width:100%;}.bodyMainLogoPiccolo{background-image:url(../images/sfondoMedio.png);background-position:97% 210px;vertical-align:top;border-left:#800000 1px solid;height:100%;width:100%;background-attachment:scroll;background-repeat:no-repeat;}.textError{color:#f00;} \ No newline at end of file diff --git a/GPW_Smart/Controllers/TempRilController.cs b/GPW_Smart/Controllers/TempRilController.cs index 02e86f9..30950f7 100644 --- a/GPW_Smart/Controllers/TempRilController.cs +++ b/GPW_Smart/Controllers/TempRilController.cs @@ -17,37 +17,37 @@ namespace GPW_Smart.Controllers } // GET api/TempRil/5 - public List Get(int id) + public List Get(int id) { - List answ = new List(); + List answ = new List(); // recupero dati var tabDati = DataProxy.DP.taRT.getByUserPeriod(id, DateTime.Today, 0); foreach (var item in tabDati) { - answ.Add(new chartJsTimeSerie() { x = item.dtRilievo, y = item.tempRil }); + answ.Add(new chartJsTSerie() { x = item.dtRilievo, y = item.tempRil }); } // restituisco oggetto! return answ; } // GET api/TempRil/5?date=2020-09-01&numRec=10 - public List Get(int id, string date, int numRec) + public List Get(int id, string date, int numRec) { DateTime dtRif = DateTime.Today; DateTime.TryParse(date, out dtRif); - List answ = new List(); + List answ = new List(); // recupero dati var tabDati = DataProxy.DP.taRT.getByUserPeriod(id, dtRif, numRec); foreach (var item in tabDati) { - answ.Add(new chartJsTimeSerie() { x = item.dtRilievo, y = item.tempRil }); + answ.Add(new chartJsTSerie() { x = item.dtRilievo, y = item.tempRil }); } // restituisco oggetto! diff --git a/GPW_Smart/WebUserControls/cmp_chart.ascx b/GPW_Smart/WebUserControls/cmp_chart.ascx index a584f60..0d64935 100644 --- a/GPW_Smart/WebUserControls/cmp_chart.ascx +++ b/GPW_Smart/WebUserControls/cmp_chart.ascx @@ -4,31 +4,38 @@ +
+
Periodo
+
+ + + + + + + + +
+
+