function RepaymentCalculationGraphViewModel(){var d=this;d.graphValues=ko.observableArray([]);d.renderGraph=function(a){Log(a);d.graphValues([]);for(var f=CalculateAmount(a.maxMonths(),12,a.interestRate(),a.residualValue(),a.monthlyPayment(),a.getMode(),0),b=a.maxMonths(),c,e=moment(a.contractDate(),Constants.LongDataFormat);0<b;b--,e.add(Constants.Months,1))c=CalculateAmount(b,12,a.interestRate(),a.residualValue(),a.monthlyPayment(),a.getMode(),0),f<c&&(f=c);c=moment(a.contractDate(),Constants.LongDataFormat);
c.add(Constants.Months,-1*a.maxMonths());Log(a.maxMonths());for(b=a.maxMonths();0<b;b--,c.add(Constants.Months,1)){var e=a.isContract()?c.format(msf.LC._my):b,g=CalculateAmount(b,12,a.interestRate(),a.residualValue(),a.monthlyPayment(),a.getMode(),0),h=100*(g/f),i=a.months()==b?!0:!1,e={month:e,value:g.formatCurrency(),percent:h,current:i};d.graphValues.push(e)}Log(d.graphValues())}};
