From 172c8d1c0383bef2bb973692b03d53194fdad257 Mon Sep 17 00:00:00 2001 From: rheasunshine Date: Fri, 18 Aug 2017 13:26:31 -0400 Subject: [PATCH 1/6] Cash projection widget legend icons --- .../accounts-cash-projection.less | 19 ++++++++++++++++-- src/images/cashflow.png | Bin 0 -> 1037 bytes src/images/payables.png | Bin 0 -> 751 bytes src/images/projectedcash.png | Bin 0 -> 1306 bytes src/images/receivables.png | Bin 0 -> 755 bytes .../highcharts-factory.svc.coffee | 9 +++++++++ 6 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 src/images/cashflow.png create mode 100644 src/images/payables.png create mode 100644 src/images/projectedcash.png create mode 100644 src/images/receivables.png diff --git a/src/components/widgets/accounts-cash-projection/accounts-cash-projection.less b/src/components/widgets/accounts-cash-projection/accounts-cash-projection.less index 01dca88c..c9484108 100644 --- a/src/components/widgets/accounts-cash-projection/accounts-cash-projection.less +++ b/src/components/widgets/accounts-cash-projection/accounts-cash-projection.less @@ -1,8 +1,23 @@ .analytics .widget-item .content.accounts-cash-projection { .tall-widget(); - .cash-projection-chart { - height: ~"calc(@{impac-big-widget-size} - 50px)"; + .cash-projection-chart { + height: ~"calc(@{impac-big-widget-size} - 50px)"; + } + + .highcharts-legend-item { + + rect.highcharts-point { + display: none; + } + + span { + width: 110px; + text-align: center; + img { + text-align: center; + } + } } .offset-box { diff --git a/src/images/cashflow.png b/src/images/cashflow.png new file mode 100644 index 0000000000000000000000000000000000000000..210b30c2c6aefbb5bde4ba9aaf7d334f4f146b59 GIT binary patch literal 1037 zcmeAS@N?(olHy`uVBq!ia0vp^=0GgT!3HF!)@}om3@qu6zK#qG8~eHcB(ehe3dtTp zz6=aiY77hwEes65fIZUImS1A|S46_A;mT9T+xk(-lOY*k^a1Xf`MWP^nDl@!2AO0sR0B76fB zob!uP6-@O^^bC~jxD*r=Y>HCStb$zJpxS{vTcwPWk^(Dz{qpj1y>er{{GxPyLrY6b zeFGzXBO_g)3f4M^0=IX}0cD7Cm4Xuh4H4Ok_L7{VTidjF!# zRG>>i?t!aE7DHDbkda@K4-B=U%w*5JlGGxgWl-HlP}^{;fSP5a5ArxtKtMtnED8)} zJ1!f2c$C?3G2LhYCI-gso-U3d5u9(seEknO2-LPRIc9J^4escC;raB?{4f1K^n0p4 zCnW9hYGIzj+$A*OlcGr1WhoDDkIWUKIlDYB=ar|G->Wv>efrGGgGFj2AW_lnZ0gmv>y zeRi62JX5Jnr#wNbW9mUyu4`74L_aU}z3|@I&^t@$Ldlg~vy>}WHLko|Rm$|mQFTMc znWuLjf69~O+n~W=6lZ#O)u~E=`yl6kxLKf!lFYwsw~yP5-QAtSlT`_Vq3| zW>VI@n)%iJSK{IAjB^rOtg>uZbcwO>xf}A;$#2eD^mTr;?42-a>EMF3n@{?Op5VrLkh0{Z{s= zY(D}7YPI72>b*!=aQjTIZUImS1A|S46_A;mT9T+xk(-lOY*k^a1Xf`MWP^nDl@!2AO0sR0B76fB zob!uP6-@O^^bC~jxD*r=Y>HCStb$zJpxS{vTcwPWk^(Dz{qpj1y>er{{GxPyLrY6b zeFGzXBO_g)3f4M^0=IX}0cD7Cm4Xuh4H4Ok_L7{VTidjF!# zRG>>i?t!aE7DHDbkda@K4-B=U%w*5JlGGxgWl-HlP}^{;fSP5a5ArxtKtMtnED8)} zJ1!f2c$C?3G2LhYC5D-vE{-7)oNs4n^EDUCCz5lhJXd{%@ybye3SYZYfr|CHz@H)0#bJHlA3#cimZ0 t+qXy8Z8YhPWDH%kd9yv+!Ous3GHNg4XY9YU%nFp&JYD@<);T3K0RZ6+|JVQk literal 0 HcmV?d00001 diff --git a/src/images/projectedcash.png b/src/images/projectedcash.png new file mode 100644 index 0000000000000000000000000000000000000000..562339ab9ffed0b9aaa608ccd8d74a58076dbcaf GIT binary patch literal 1306 zcmeAS@N?(olHy`uVBq!ia0vp^=0GgT!3HF!)@}om3@qu6zK#qG8~eHcB(ehe3dtTp zz6=aiY77hwEes65fIZUImS1A|S46_A;mT9T+xk(-lOY*k^a1Xf`MWP^nDl@!2AO0sR0B76fB zob!uP6-@O^^bC~jxD*r=Y>HCStb$zJpxS{vTcwPWk^(Dz{qpj1y>er{{GxPyLrY6b zeFGzXBO_g)3f4M^0=IX}0cD7Cm4Xuh4H4Ok_L7{VTidjF!# zRG>>i?t!aE7DHDbkda@K4-B=U%w*5JlGGxgWl-HlP}^{;fSP5a5ArxtKtMtnED8)} zJ1!f2c$C?3G2LhYCI+S>o-U3d5u9(Q$9e=ON*w>6Ze3g~f6mA|l}ps^N|(e*2Nxl& zO?gduOF9;;nC0vr}5n#NU~oS7-GeGqOpLNN5gY4qMo;X6oYnjR`t>jTaBP z7_`J)7x|IGwJB^}`U~sEhXv=d&M|KJT7S&=`jVQ5^LD5eynLzfPR5>N@iHCuzPN%V z-)ERVo_BQFFW&$ykB#e^R9P7B3Ghe%SC5d++OU74oYy6ZjZ+#-G*@e_joOozv03MG z&`Xm)6ZhAKo$!6g>3+1WXOdK`=3?J_-!C`E3(7TS$lR|fzOX97r#Nw=_@PdfxZYif zJL~wDzuVtnen$C(`U6ha={}9$ZpzHRo!&ZUhNPZST{NHnZ%-z#ExD$mQPCyyRvl1h zb@6x^ zjL|k0bN{l%dv7!TKIwcT`__&n%CQcOY-)RUSidFth{Fb#sf@I z+pio9I5z1(eN&nZYtU=v$#E}2v}S01eYCFJ?#q-BQ$?5V>Dy|J&I9f0x{gz~Xm@!lCU0u()X?I`TxU9jpO#fI>k->?hT!#V~>Q%b3=7#C% zR91@p{WHl}LRFV*`gT#H*%8f?XC?&g%0A^8t+?6IQ~SGgH@o~iqqzz4pkm3>)z4*} HQ$iB}!UPau literal 0 HcmV?d00001 diff --git a/src/images/receivables.png b/src/images/receivables.png new file mode 100644 index 0000000000000000000000000000000000000000..8cd8ae8d2013059a2f48d6dd08f1b060038b2d16 GIT binary patch literal 755 zcmeAS@N?(olHy`uVBq!ia0vp^=0GgX!3HF6Y!&AQQY`6?zK#qG8~eHcB(ehe3dtTp zz6=aiY77hwEes65fIZUImS1A|S46_A;mT9T+xk(-lOY*k^a1Xf`MWP^nDl@!2AO0sR0B76fB zob!uP6-@O^^bC~jxD*r=Y>HCStb$zJpxS{vTcwPWk^(Dz{qpj1y>er{{GxPyLrY6b zeFGzXBO_g)3f4M^0=IX}0cD7Cm4Xuh4H4Ok_L7{VTidjF!# zRG>>i?t!aE7DHDbkda@K4-B=U%w*5JlGGxgWl-HlP}^{;fSP5a5ArxtKtMtnED8)} zJ1!f2c$C?3G2LhYC5E}4E{-7)oXLOqS$GbM81M$yH|{;^wU(VK&d9?rS&Gy*tDK#ZY?)?ronr# z@shn%F|+8WDYvYpil?+aaCj--yR(t2((A2kuceoB!GbUS$L=_^+ARIX_j<<~&SMX49`P{f-r#3mt~qBqD7|^Q`njxgN@xNAX@L3D literal 0 HcmV?d00001 diff --git a/src/services/highcharts-factory/highcharts-factory.svc.coffee b/src/services/highcharts-factory/highcharts-factory.svc.coffee index 57dc9b61..572a4659 100644 --- a/src/services/highcharts-factory/highcharts-factory.svc.coffee +++ b/src/services/highcharts-factory/highcharts-factory.svc.coffee @@ -17,6 +17,15 @@ angular layout: 'vertical' align: 'left' verticalAlign: 'middle' + useHTML: true + plotOptions : + series: + dataLabels: + useHTML: true + labelFormatter: -> + name = this.name + img = "
" + return img + ' ' + name xAxis: startOnTick: false minPadding: 0 From a78b108f20d8b4ad1e6cfdc085bfd4135426f802 Mon Sep 17 00:00:00 2001 From: rheasunshine Date: Sun, 20 Aug 2017 15:16:55 -0400 Subject: [PATCH 2/6] Cash balance widget legend icons --- dist/images/cash-flow.png | Bin 0 -> 348 bytes dist/images/payables.png | Bin 0 -> 125 bytes dist/images/plot-line-icon.svg | 1 + dist/images/projected-cash.png | Bin 0 -> 561 bytes dist/images/receivables.png | Bin 0 -> 125 bytes .../accounts-cash-balance.less | 6 ++++ .../accounts-cash-balance.tmpl.html | 1 + src/images/cash-flow.png | Bin 0 -> 1037 bytes src/images/plot-line-icon.svg | 26 ++++++++++++++++++ src/images/projected-cash.png | Bin 0 -> 1306 bytes .../highcharts-factory.svc.coffee | 2 +- 11 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 dist/images/cash-flow.png create mode 100644 dist/images/payables.png create mode 100644 dist/images/plot-line-icon.svg create mode 100644 dist/images/projected-cash.png create mode 100644 dist/images/receivables.png create mode 100644 src/images/cash-flow.png create mode 100644 src/images/plot-line-icon.svg create mode 100644 src/images/projected-cash.png diff --git a/dist/images/cash-flow.png b/dist/images/cash-flow.png new file mode 100644 index 0000000000000000000000000000000000000000..97942916b220614522429687c2af5adf19504c77 GIT binary patch literal 348 zcmV-i0i*tjP)X0{{R3qN7GK0001)P)t-shQ7>) zzs-oh&5FRzjKR*0!q1Px(38c{l*Q7T$kdz3)tt)JpUc*t%-5jI*P+eWqt4i-&)KTc z+pyK%w%Fje*x|U@;knu3yxZfx+~mL9(S=y(&y~f>F(F+@7U_^ z+UxJ%?(ygH_388W>h$*P_4n=e`1ASt^!fVs`uq6%{QCU;`~Cg={r>;|{|TmF`Tzg` zen~_@R5;6HFd`2yjOrWY`ZNXk6%0t$r!U3Cz`(#Nu0fhUC3XfV;FHI+R7X*SK|n?g zixU};0E?J9lANxxI44wsO;|x2*@@Cj3}}EyP9G$rry{|PCc`DEY6#J$$j*QTu!t&4 u^D<(SVPF=L)k1S3(SU=AVHAu4+yDSf6@Y{C=+&zL0000dC!U(-Ys79Vg2^+ z*KYlO`TGC=|DN9tXaN-{d%8G=Xq->>ILs>~(J|F0F(DyAW-1WYOj_yX<#ozMJ&U1m W6WetQrCTOI \ No newline at end of file diff --git a/dist/images/projected-cash.png b/dist/images/projected-cash.png new file mode 100644 index 0000000000000000000000000000000000000000..a83fbb36ee4dfca6a350840f6f5ad10f9b885b23 GIT binary patch literal 561 zcmV-10?z%3P)X0{{R3qN7GK0003CP)t-s4Sbmz zgPtFTp&*8$FOH`&kf}3}sWp6E8#L$w((VEHCpUl^((c7!i+^y5yuGHPK)!($%;I!A^ zwbF(F+@7U_^+UxM$?eXF7^5O6EGbyL^!MuY z_v`id?)Lfb_xbSm`SSSs^!fYs`uq0!`}h0%`1||${QUa-{rmm>{Qdp>{r>&_{{H^{ z|NsA}Y=0pD007}hL_t(I%VUTj4=@a0eV##N=~H9i_asAKkiEUVLomtu!d-y+^pyNa z)h8nY)MqcmMxs6yRx^-3dvgZeQ0yuKtp(*gz1^IG!;u7o?O}jH!O0hk=QUmIRfQ$( z?PVEx>^xjf>BnsfsOzQ z7pl*cS;F4l(w=w#)n{*PPa0sbCl8G3qpm&xcEaKlx~>-l{0v{`njxgN@xNAp>-<^ literal 0 HcmV?d00001 diff --git a/src/components/widgets/accounts-cash-balance/accounts-cash-balance.less b/src/components/widgets/accounts-cash-balance/accounts-cash-balance.less index 74f7288c..89550c84 100644 --- a/src/components/widgets/accounts-cash-balance/accounts-cash-balance.less +++ b/src/components/widgets/accounts-cash-balance/accounts-cash-balance.less @@ -37,6 +37,12 @@ } } + .plot-line-icon { + width: 16px; + height: 16px; + mask: url(images/plot-line-icon.svg) no-repeat center; + } + .right-panel { display: flex; flex-direction: column; diff --git a/src/components/widgets/accounts-cash-balance/accounts-cash-balance.tmpl.html b/src/components/widgets/accounts-cash-balance/accounts-cash-balance.tmpl.html index 93c5556b..cea2cb30 100644 --- a/src/components/widgets/accounts-cash-balance/accounts-cash-balance.tmpl.html +++ b/src/components/widgets/accounts-cash-balance/accounts-cash-balance.tmpl.html @@ -26,6 +26,7 @@

Widget settings

+
 
diff --git a/src/images/cash-flow.png b/src/images/cash-flow.png new file mode 100644 index 0000000000000000000000000000000000000000..210b30c2c6aefbb5bde4ba9aaf7d334f4f146b59 GIT binary patch literal 1037 zcmeAS@N?(olHy`uVBq!ia0vp^=0GgT!3HF!)@}om3@qu6zK#qG8~eHcB(ehe3dtTp zz6=aiY77hwEes65fIZUImS1A|S46_A;mT9T+xk(-lOY*k^a1Xf`MWP^nDl@!2AO0sR0B76fB zob!uP6-@O^^bC~jxD*r=Y>HCStb$zJpxS{vTcwPWk^(Dz{qpj1y>er{{GxPyLrY6b zeFGzXBO_g)3f4M^0=IX}0cD7Cm4Xuh4H4Ok_L7{VTidjF!# zRG>>i?t!aE7DHDbkda@K4-B=U%w*5JlGGxgWl-HlP}^{;fSP5a5ArxtKtMtnED8)} zJ1!f2c$C?3G2LhYCI-gso-U3d5u9(seEknO2-LPRIc9J^4escC;raB?{4f1K^n0p4 zCnW9hYGIzj+$A*OlcGr1WhoDDkIWUKIlDYB=ar|G->Wv>efrGGgGFj2AW_lnZ0gmv>y zeRi62JX5Jnr#wNbW9mUyu4`74L_aU}z3|@I&^t@$Ldlg~vy>}WHLko|Rm$|mQFTMc znWuLjf69~O+n~W=6lZ#O)u~E=`yl6kxLKf!lFYwsw~yP5-QAtSlT`_Vq3| zW>VI@n)%iJSK{IAjB^rOtg>uZbcwO>xf}A;$#2eD^mTr;?42-a>EMF3n@{?Op5VrLkh0{Z{s= zY(D}7YPI72>b*!=aQjTI + + + +Created by potrace 1.15, written by Peter Selinger 2001-2017 + + + + + diff --git a/src/images/projected-cash.png b/src/images/projected-cash.png new file mode 100644 index 0000000000000000000000000000000000000000..562339ab9ffed0b9aaa608ccd8d74a58076dbcaf GIT binary patch literal 1306 zcmeAS@N?(olHy`uVBq!ia0vp^=0GgT!3HF!)@}om3@qu6zK#qG8~eHcB(ehe3dtTp zz6=aiY77hwEes65fIZUImS1A|S46_A;mT9T+xk(-lOY*k^a1Xf`MWP^nDl@!2AO0sR0B76fB zob!uP6-@O^^bC~jxD*r=Y>HCStb$zJpxS{vTcwPWk^(Dz{qpj1y>er{{GxPyLrY6b zeFGzXBO_g)3f4M^0=IX}0cD7Cm4Xuh4H4Ok_L7{VTidjF!# zRG>>i?t!aE7DHDbkda@K4-B=U%w*5JlGGxgWl-HlP}^{;fSP5a5ArxtKtMtnED8)} zJ1!f2c$C?3G2LhYCI+S>o-U3d5u9(Q$9e=ON*w>6Ze3g~f6mA|l}ps^N|(e*2Nxl& zO?gduOF9;;nC0vr}5n#NU~oS7-GeGqOpLNN5gY4qMo;X6oYnjR`t>jTaBP z7_`J)7x|IGwJB^}`U~sEhXv=d&M|KJT7S&=`jVQ5^LD5eynLzfPR5>N@iHCuzPN%V z-)ERVo_BQFFW&$ykB#e^R9P7B3Ghe%SC5d++OU74oYy6ZjZ+#-G*@e_joOozv03MG z&`Xm)6ZhAKo$!6g>3+1WXOdK`=3?J_-!C`E3(7TS$lR|fzOX97r#Nw=_@PdfxZYif zJL~wDzuVtnen$C(`U6ha={}9$ZpzHRo!&ZUhNPZST{NHnZ%-z#ExD$mQPCyyRvl1h zb@6x^ zjL|k0bN{l%dv7!TKIwcT`__&n%CQcOY-)RUSidFth{Fb#sf@I z+pio9I5z1(eN&nZYtU=v$#E}2v}S01eYCFJ?#q-BQ$?5V>Dy|J&I9f0x{gz~Xm@!lCU0u()X?I`TxU9jpO#fI>k->?hT!#V~>Q%b3=7#C% zR91@p{WHl}LRFV*`gT#H*%8f?XC?&g%0A^8t+?6IQ~SGgH@o~iqqzz4pkm3>)z4*} HQ$iB}!UPau literal 0 HcmV?d00001 diff --git a/src/services/highcharts-factory/highcharts-factory.svc.coffee b/src/services/highcharts-factory/highcharts-factory.svc.coffee index 572a4659..b4bd354d 100644 --- a/src/services/highcharts-factory/highcharts-factory.svc.coffee +++ b/src/services/highcharts-factory/highcharts-factory.svc.coffee @@ -24,7 +24,7 @@ angular useHTML: true labelFormatter: -> name = this.name - img = "
" + img = "
" return img + ' ' + name xAxis: startOnTick: false From cddac9836abcef24f4afb6d339f92b5e81f36a13 Mon Sep 17 00:00:00 2001 From: rheasunshine Date: Sun, 20 Aug 2017 15:28:54 -0400 Subject: [PATCH 3/6] Removing unnecessary images --- src/images/cashflow.png | Bin 1037 -> 0 bytes src/images/projectedcash.png | Bin 1306 -> 0 bytes 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/images/cashflow.png delete mode 100644 src/images/projectedcash.png diff --git a/src/images/cashflow.png b/src/images/cashflow.png deleted file mode 100644 index 210b30c2c6aefbb5bde4ba9aaf7d334f4f146b59..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1037 zcmeAS@N?(olHy`uVBq!ia0vp^=0GgT!3HF!)@}om3@qu6zK#qG8~eHcB(ehe3dtTp zz6=aiY77hwEes65fIZUImS1A|S46_A;mT9T+xk(-lOY*k^a1Xf`MWP^nDl@!2AO0sR0B76fB zob!uP6-@O^^bC~jxD*r=Y>HCStb$zJpxS{vTcwPWk^(Dz{qpj1y>er{{GxPyLrY6b zeFGzXBO_g)3f4M^0=IX}0cD7Cm4Xuh4H4Ok_L7{VTidjF!# zRG>>i?t!aE7DHDbkda@K4-B=U%w*5JlGGxgWl-HlP}^{;fSP5a5ArxtKtMtnED8)} zJ1!f2c$C?3G2LhYCI-gso-U3d5u9(seEknO2-LPRIc9J^4escC;raB?{4f1K^n0p4 zCnW9hYGIzj+$A*OlcGr1WhoDDkIWUKIlDYB=ar|G->Wv>efrGGgGFj2AW_lnZ0gmv>y zeRi62JX5Jnr#wNbW9mUyu4`74L_aU}z3|@I&^t@$Ldlg~vy>}WHLko|Rm$|mQFTMc znWuLjf69~O+n~W=6lZ#O)u~E=`yl6kxLKf!lFYwsw~yP5-QAtSlT`_Vq3| zW>VI@n)%iJSK{IAjB^rOtg>uZbcwO>xf}A;$#2eD^mTr;?42-a>EMF3n@{?Op5VrLkh0{Z{s= zY(D}7YPI72>b*!=aQjTIZUImS1A|S46_A;mT9T+xk(-lOY*k^a1Xf`MWP^nDl@!2AO0sR0B76fB zob!uP6-@O^^bC~jxD*r=Y>HCStb$zJpxS{vTcwPWk^(Dz{qpj1y>er{{GxPyLrY6b zeFGzXBO_g)3f4M^0=IX}0cD7Cm4Xuh4H4Ok_L7{VTidjF!# zRG>>i?t!aE7DHDbkda@K4-B=U%w*5JlGGxgWl-HlP}^{;fSP5a5ArxtKtMtnED8)} zJ1!f2c$C?3G2LhYCI+S>o-U3d5u9(Q$9e=ON*w>6Ze3g~f6mA|l}ps^N|(e*2Nxl& zO?gduOF9;;nC0vr}5n#NU~oS7-GeGqOpLNN5gY4qMo;X6oYnjR`t>jTaBP z7_`J)7x|IGwJB^}`U~sEhXv=d&M|KJT7S&=`jVQ5^LD5eynLzfPR5>N@iHCuzPN%V z-)ERVo_BQFFW&$ykB#e^R9P7B3Ghe%SC5d++OU74oYy6ZjZ+#-G*@e_joOozv03MG z&`Xm)6ZhAKo$!6g>3+1WXOdK`=3?J_-!C`E3(7TS$lR|fzOX97r#Nw=_@PdfxZYif zJL~wDzuVtnen$C(`U6ha={}9$ZpzHRo!&ZUhNPZST{NHnZ%-z#ExD$mQPCyyRvl1h zb@6x^ zjL|k0bN{l%dv7!TKIwcT`__&n%CQcOY-)RUSidFth{Fb#sf@I z+pio9I5z1(eN&nZYtU=v$#E}2v}S01eYCFJ?#q-BQ$?5V>Dy|J&I9f0x{gz~Xm@!lCU0u()X?I`TxU9jpO#fI>k->?hT!#V~>Q%b3=7#C% zR91@p{WHl}LRFV*`gT#H*%8f?XC?&g%0A^8t+?6IQ~SGgH@o~iqqzz4pkm3>)z4*} HQ$iB}!UPau From ef1617fb8386a9874de9473eb0e0e8f771e0dfbb Mon Sep 17 00:00:00 2001 From: rheasunshine Date: Tue, 22 Aug 2017 12:42:40 -0400 Subject: [PATCH 4/6] Refactor legend icons using assets service --- .../accounts-cash-balance.directive.coffee | 11 +++---- .../accounts-cash-balance.less | 3 +- .../accounts-cash-balance.tmpl.html | 6 ++-- .../accounts-cash-projection.less | 2 ++ src/images/area-icon.svg | 18 +++++++++++ src/images/plot-line-icon.svg | 30 +++++++++---------- src/services/assets/assets.svc.coffee | 6 ++++ .../highcharts-factory.svc.coffee | 5 ++-- 8 files changed, 54 insertions(+), 27 deletions(-) create mode 100644 src/images/area-icon.svg diff --git a/src/components/widgets/accounts-cash-balance/accounts-cash-balance.directive.coffee b/src/components/widgets/accounts-cash-balance/accounts-cash-balance.directive.coffee index 93a3176a..5f9fd1e9 100644 --- a/src/components/widgets/accounts-cash-balance/accounts-cash-balance.directive.coffee +++ b/src/components/widgets/accounts-cash-balance/accounts-cash-balance.directive.coffee @@ -1,5 +1,5 @@ module = angular.module('impac.components.widgets.accounts-cash-balance', []) -module.controller('WidgetAccountsCashBalanceCtrl', ($scope, $q, $timeout, $filter, ImpacTheming, HighchartsFactory) -> +module.controller('WidgetAccountsCashBalanceCtrl', ($scope, $q, $timeout, $filter, ImpacTheming, ImpacAssets, HighchartsFactory) -> w = $scope.widget @@ -21,10 +21,8 @@ module.controller('WidgetAccountsCashBalanceCtrl', ($scope, $q, $timeout, $filte # Custom chart legend $scope.groupedTable = w.content.grouped_table - # TODO: theming config for positive/negative hex codes (or move to API) # chartColors = ImpacTheming.get().chartColors - # Set chart accounts series colors by account bias ('positive' / 'negative') setSeriesColors(w.content.chart.series, { positive: '#3FC4FF', negative: '#e50228'}) @@ -34,11 +32,15 @@ module.controller('WidgetAccountsCashBalanceCtrl', ($scope, $q, $timeout, $filte visibility = if serie.visible then false else true serie.setVisible(visibility) - $scope.getLegendItemIcon = (account)-> + $scope.getLegendItemCheckBox = (account)-> serie = $scope.chart? && $scope.chart.hc? && getSerieByAccount($scope.chart.hc.series, account) return 'fa-check-square-o' unless serie if serie.visible then 'fa-check-square-o' else 'fa-square-o' + $scope.getLegendItemIcon = (account)-> + serie = $scope.chart? && $scope.chart.hc? && getSerieByAccount($scope.chart.hc.series, account) + if serie.type == 'area' then ImpacAssets.get('areaLegendIcon') else ImpacAssets.get('plotLineLegendIcon') + $scope.getLegendItemColor = (account)-> serie = $scope.chart? && $scope.chart.hc? && getSerieByAccount($scope.chart.hc.series, account) return '#000' unless serie @@ -74,7 +76,6 @@ module.controller('WidgetAccountsCashBalanceCtrl', ($scope, $q, $timeout, $filte $scope.chart ||= new HighchartsFactory($scope.chartId(), w.content.chart, options) $scope.chart.render(w.content.chart, options) - # Widget is ready: can trigger the "wait for settings to be ready" # -------------------------------------- $scope.widgetDeferred.resolve(settingsPromises) diff --git a/src/components/widgets/accounts-cash-balance/accounts-cash-balance.less b/src/components/widgets/accounts-cash-balance/accounts-cash-balance.less index 89550c84..ee14c60a 100644 --- a/src/components/widgets/accounts-cash-balance/accounts-cash-balance.less +++ b/src/components/widgets/accounts-cash-balance/accounts-cash-balance.less @@ -37,10 +37,9 @@ } } - .plot-line-icon { + .legend-item-icon { width: 16px; height: 16px; - mask: url(images/plot-line-icon.svg) no-repeat center; } .right-panel { diff --git a/src/components/widgets/accounts-cash-balance/accounts-cash-balance.tmpl.html b/src/components/widgets/accounts-cash-balance/accounts-cash-balance.tmpl.html index cea2cb30..f106c6f3 100644 --- a/src/components/widgets/accounts-cash-balance/accounts-cash-balance.tmpl.html +++ b/src/components/widgets/accounts-cash-balance/accounts-cash-balance.tmpl.html @@ -25,8 +25,10 @@

Widget settings

- -
  + +
+ +
 
diff --git a/src/components/widgets/accounts-cash-projection/accounts-cash-projection.less b/src/components/widgets/accounts-cash-projection/accounts-cash-projection.less index c9484108..e2db2904 100644 --- a/src/components/widgets/accounts-cash-projection/accounts-cash-projection.less +++ b/src/components/widgets/accounts-cash-projection/accounts-cash-projection.less @@ -16,6 +16,8 @@ text-align: center; img { text-align: center; + width: 55px; + height: 25px; } } } diff --git a/src/images/area-icon.svg b/src/images/area-icon.svg new file mode 100644 index 00000000..030687a5 --- /dev/null +++ b/src/images/area-icon.svg @@ -0,0 +1,18 @@ + + + + +Created by potrace 1.15, written by Peter Selinger 2001-2017 + + + + + diff --git a/src/images/plot-line-icon.svg b/src/images/plot-line-icon.svg index a3f4b2cc..78413d33 100644 --- a/src/images/plot-line-icon.svg +++ b/src/images/plot-line-icon.svg @@ -2,25 +2,23 @@ -Created by potrace 1.15, written by Peter Selinger 2001-2017 +Created by potrace 1.14, written by Peter Selinger 2001-2017 - - + diff --git a/src/services/assets/assets.svc.coffee b/src/services/assets/assets.svc.coffee index 84bd7df1..1df49a01 100644 --- a/src/services/assets/assets.svc.coffee +++ b/src/services/assets/assets.svc.coffee @@ -15,6 +15,12 @@ angular impacTitleLogo: ':default/impac-title-logo.png' impacDashboardBackground: ':default/impac-dashboard-background.png' currencyConversionsIcon: ':default/currency-conversions.png' + cashFlowLegendIcon: ':default/cash-flow.png' + payablesLegendIcon: ':default/payables.png' + projectedCashLegendIcon: ':default/projected-cash.png' + receivablesLegendIcon: ':default/receivables.png' + plotLineLegendIcon: ':default/plot-line-icon.svg' + areaLegendIcon: ':default/area-icon.svg' #======================================= # Public methods available in config diff --git a/src/services/highcharts-factory/highcharts-factory.svc.coffee b/src/services/highcharts-factory/highcharts-factory.svc.coffee index b4bd354d..1367d95f 100644 --- a/src/services/highcharts-factory/highcharts-factory.svc.coffee +++ b/src/services/highcharts-factory/highcharts-factory.svc.coffee @@ -1,6 +1,6 @@ angular .module('impac.services.highcharts-factory', []) -.factory('HighchartsFactory', ($filter)-> +.factory('HighchartsFactory', ($filter, ImpacAssets)-> templates = line: Object.freeze @@ -24,7 +24,8 @@ angular useHTML: true labelFormatter: -> name = this.name - img = "
" + imgSrc = ImpacAssets.get(_.camelCase(name + 'LegendIcon')) + img = "
" return img + ' ' + name xAxis: startOnTick: false From 4afb835fbdcf771c9ac3353121c16fbaab3474dc Mon Sep 17 00:00:00 2001 From: rheasunshine Date: Wed, 23 Aug 2017 12:19:24 -0400 Subject: [PATCH 5/6] Reviews pull request changes --- .../accounts-cash-balance.tmpl.html | 4 ++-- .../accounts-cash-projection.directive.coffee | 16 ++++++++++++++-- .../highcharts-factory.svc.coffee | 10 ---------- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/components/widgets/accounts-cash-balance/accounts-cash-balance.tmpl.html b/src/components/widgets/accounts-cash-balance/accounts-cash-balance.tmpl.html index f106c6f3..0c30b0b0 100644 --- a/src/components/widgets/accounts-cash-balance/accounts-cash-balance.tmpl.html +++ b/src/components/widgets/accounts-cash-balance/accounts-cash-balance.tmpl.html @@ -25,9 +25,9 @@

Widget settings

- +
- +
 
diff --git a/src/components/widgets/accounts-cash-projection/accounts-cash-projection.directive.coffee b/src/components/widgets/accounts-cash-projection/accounts-cash-projection.directive.coffee index 7358a927..cd7acd81 100644 --- a/src/components/widgets/accounts-cash-projection/accounts-cash-projection.directive.coffee +++ b/src/components/widgets/accounts-cash-projection/accounts-cash-projection.directive.coffee @@ -1,5 +1,5 @@ module = angular.module('impac.components.widgets.accounts-cash-projection', []) -module.controller('WidgetAccountsCashProjectionCtrl', ($scope, $q, $filter, ImpacKpisSvc, HighchartsFactory) -> +module.controller('WidgetAccountsCashProjectionCtrl', ($scope, $q, $filter, ImpacKpisSvc, ImpacAssets, HighchartsFactory) -> w = $scope.widget @@ -64,8 +64,20 @@ module.controller('WidgetAccountsCashProjectionCtrl', ($scope, $q, $filter, Impa thresholds: getThresholds() $scope.chart ||= new HighchartsFactory($scope.chartId(), w.content.chart, options) - $scope.chart.render(w.content.chart, options) + # Extend default chart formatters to add custom legend img icon + defaultFormattersConfig = $scope.chart.formatters() + $scope.chart.formatters = -> + angular.merge(defaultFormattersConfig, { + legend: + useHTML: true + labelFormatter: -> + name = this.name + imgSrc = ImpacAssets.get(_.camelCase(name + 'LegendIcon')) + img = "
" + return img + ' ' + name + }) + $scope.chart.render(w.content.chart, options) $scope.chartDeferred.notify($scope.chart.hc) $scope.chartId = -> diff --git a/src/services/highcharts-factory/highcharts-factory.svc.coffee b/src/services/highcharts-factory/highcharts-factory.svc.coffee index 1367d95f..245644b2 100644 --- a/src/services/highcharts-factory/highcharts-factory.svc.coffee +++ b/src/services/highcharts-factory/highcharts-factory.svc.coffee @@ -17,16 +17,6 @@ angular layout: 'vertical' align: 'left' verticalAlign: 'middle' - useHTML: true - plotOptions : - series: - dataLabels: - useHTML: true - labelFormatter: -> - name = this.name - imgSrc = ImpacAssets.get(_.camelCase(name + 'LegendIcon')) - img = "
" - return img + ' ' + name xAxis: startOnTick: false minPadding: 0 From 64873844d7b7d8e649f87438d0febd18773d0963 Mon Sep 17 00:00:00 2001 From: Rhea Morrison Date: Thu, 24 Aug 2017 06:35:37 -0400 Subject: [PATCH 6/6] Cleanup --- src/services/highcharts-factory/highcharts-factory.svc.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/highcharts-factory/highcharts-factory.svc.coffee b/src/services/highcharts-factory/highcharts-factory.svc.coffee index 245644b2..57dc9b61 100644 --- a/src/services/highcharts-factory/highcharts-factory.svc.coffee +++ b/src/services/highcharts-factory/highcharts-factory.svc.coffee @@ -1,6 +1,6 @@ angular .module('impac.services.highcharts-factory', []) -.factory('HighchartsFactory', ($filter, ImpacAssets)-> +.factory('HighchartsFactory', ($filter)-> templates = line: Object.freeze