diff --git a/app/scripts/controllers/client/ViewClientController.js b/app/scripts/controllers/client/ViewClientController.js index acda8053..633b6034 100644 --- a/app/scripts/controllers/client/ViewClientController.js +++ b/app/scripts/controllers/client/ViewClientController.js @@ -241,6 +241,96 @@ scope.downloadClientIdentifierDocument=function (identifierId, documentId){ console.log(identifierId,documentId); + }; + + // *********************** InVenture controller *********************** + scope.fetchInventureScore = function(){ + // dummy data for the graph - DEBUG purpose + var inventureScore = getRandomInt(450,800); + var natAverage = getRandomInt(450,800); + var industryAverage = getRandomInt(450,800); + var inventureMinScore = 300; + var inventureMaxScore = 850; + + // dummy data for inventure loan recommendation - DEBUG purpose + scope.inventureAgricultureLimit = '21,000'; + scope.inventureFishermenLimit = '27,500'; + scope.inventureHousingLimit = '385,000'; + scope.inventureBusinessLimit = '10,000'; + + // this part is used to generate data to see the look of the graph + function getRandomInt (min, max) { + return Math.floor(Math.random() * (max - min + 1)) + min; + } + + // CHART1 - comparison chart control + var comparisonData = [ + { + key: "Score Comparison", + values: [ + { + "label" : "National Average", + "value" : (natAverage) + }, + { + "label" : "Agriculture Average", + "value" : (industryAverage) + }, + { + "label" : "This Client", + "value" : (inventureScore) + } + ] + } + ]; + + // add the comparison chart to the viewclient.html + nv.addGraph(function() { + var comparisonChart = nv.models.discreteBarChart() + .x(function(d) { return d.label }) + .y(function(d) { return d.value }) + .staggerLabels(true) + .tooltips(true) + .showValues(true); + + // set all display value to integer + comparisonChart.yAxis.tickFormat(d3.format('d')); + comparisonChart.valueFormat(d3.format('d')); + comparisonChart.forceY([inventureMinScore, inventureMaxScore]); + + d3.select('#inventureBarChart svg') + .datum(comparisonData) + .transition().duration(1500) + .call(comparisonChart); + + nv.utils.windowResize(comparisonChart.update); + return comparisonChart; + }); + + // CHART2 - inventure score bullet chart control + nv.addGraph(function() { + var bullet = nv.models.bulletChart() + .tooltips(false); + + d3.select('#inventureBulletChart svg') + .datum(scoreData()) + .transition().duration(1500) + .call(bullet); + + nv.utils.windowResize(bullet.update); + return bullet; + }); + + function scoreData() { + return { + "title": "", + "ranges": [(inventureMinScore - 300), (inventureMaxScore - 300)], + "measures": [(inventureScore - 300)], + "markers": [(inventureScore - 300)]}; + } + + // this will be used to display the score on the viewclient.html + scope.inventureScore = inventureScore; }; } }); diff --git a/app/styles/app.css b/app/styles/app.css index 413d36bb..cdb541a8 100644 --- a/app/styles/app.css +++ b/app/styles/app.css @@ -584,4 +584,74 @@ div[data-tree-model] li .selected { margin-left: -90px; border-left-width: 1px; margin-right: 90px; -} \ No newline at end of file +} + +/* Inventure */ +.inventureTabTitle a { + font-weight: bold; + color: #FF6600; +} + +#inventureBulletChart .nv-tick text { + display: none; +} + +.inventureMainBorder { + border: 1.5px solid #DDDDDD; + padding:15px; +} + +.inventureCategoryTitle { + background-color: #E8E8E8; + border-bottom: 1.5px solid #DDDDDD; + padding: 10px 15px; + margin: -15px -15px 15px; +} + +.inventureBulletLegendCell { + width:90px; + text-align:center; +} + +.inventureRecommendationTable { + font-size: 18px; + margin-left: auto; + margin-right: auto; +} + +.inventureTableTopBorder { + border-top: 3px solid #DDDDDD; +} + +.inventureRecommendationCellTitle { + font-weight:bold; + color:#333; +} + +.inventureRecommendationCellType { + width:125px; + height:25px; + text-align:center; +} + +.inventureRecommendationCellAmount { + width:175px; + height:25px; + text-align:center; +} + +.inventureRecommendationCellLeftGap { + width:7px; + text-align:center; + border-right: 2px solid #DDDDDD; +} + +.inventureTooltip .tooltip-inner { + white-space: pre-wrap; + font-size: 13px; +} + +.inventureRecommendationCellRightGap { + width:7px; + text-align:center; +} diff --git a/app/styles/bootstrap-combined.min.css b/app/styles/bootstrap-combined.min.css index 65e108aa..86e27221 100644 --- a/app/styles/bootstrap-combined.min.css +++ b/app/styles/bootstrap-combined.min.css @@ -4051,8 +4051,8 @@ input[type="submit"].btn.btn-mini { .nav-tabs > li > a, .nav-pills > li > a { - padding-right: 12px; - padding-left: 12px; + padding-right: 10px; + padding-left: 10px; margin-right: 2px; line-height: 14px; } diff --git a/app/views/clients/viewclient.html b/app/views/clients/viewclient.html index 3fcc05ce..8e2497ac 100644 --- a/app/views/clients/viewclient.html +++ b/app/views/clients/viewclient.html @@ -289,6 +289,110 @@ + + + + + +
+
+
+ Score Comparison +
+ +
+ Question +
+ +
+ +
+
+
+ + +
+
+
+ InVenture Score +
+ +
+ Question +
+ +
+

InVenture Score: {{inventureScore}}

+
+ +
+ +
+ +
+ + + + + + + + + +
300-450
Bad
451-550
Fair
551-700
Good
701-850
Excellent
+
+
+
+ + +
+
+
+ InVenture Loan Recommendation +
+ +
+ Question +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Loan TypeCredit Limit ₹ (Rs)
Agriculture{{inventureAgricultureLimit}}
Fishermen{{inventureFishermenLimit}}
Housing{{inventureHousingLimit}}
Business{{inventureBusinessLimit}}
+
+
+
+
+