From 2adb75350f9844900e73343023afa8920a71e128 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sun, 22 Apr 2018 10:37:12 +0200 Subject: [PATCH] Profile Picture being shown --- .vs/Plotters-Trading/v15/.suo | Bin 26112 -> 26624 bytes History.js | 28 ++++++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/.vs/Plotters-Trading/v15/.suo b/.vs/Plotters-Trading/v15/.suo index c22a93075ddbc25135582d54f4ab3803a02c8dd1..756b29c887ca32abee0c3f07134156d2b842a9f5 100644 GIT binary patch delta 1575 zcmb_bO-~bH5bnFXrAyr{3oW!lg_agtTbe8yh47J7S`$=gOJX2JNJ@eqKcF5kfZ)M+ z;6Qf{UOXW2tk8`YgYh6oO={%i!FV zgbUGH;o9(YBhDa#h}=XFHbkL5j6VIQN8c8cESC}T)^#S|MD`ZqHsT281ZOTYrb#iG zF(iy<%G;0%64k^bC{LM`Q&RQRiPVeolUfo}b5)7gHXWSS6hnaw!%EXz5(;GPDT(%I zsS4GLc8SwMafy~j!upvbl!REQ7gSDQU*WJhz%Ia3i%+7hQxF*yY@SDA4{{^dARZpl zT1G_@jd2UvmOar>T)AmyQf2~%&}xh@Gu8AM4jZrjR`HtV8Wm|lMkHiiSeK($FZxpq z;&#1Ak3TVXvBtlMGn0d=6pF-fH{VNxn3>TBp>SqMr6yJg6 z^b#Z{T<~Skqwin$Ff;vQJg|^{V3Y$l#=9VsP+@Caf%XX>6ZA_{Zy4Cp(=tibFdNt= zAL1i+&0o?|P1DzlfdVVFP+n7cQF?J$;_@TW`aevJ{nE!t4Rec&x^1YFLFe%2&1nuc zCc97WpEW?PZw6*&p0Ve!I&~jj_o@EAvw{7W+pGPNSJCe;+<`~bvQeLLqIP<;Sw&Z- f4@%Pgrx~8pBSU`_H@Pw*n>&P;s}Vj7&}n{)5)oO|v$_s%Tm+43e^ z8{(J?8n}Qn|KaP!sn1(1U^1CvKDf)Bg>`$FO~Q9h5gJf*Bak1LA!$vid|iVB=jDii z_z*wx1D~>@wZZ#w&&pLV+gTa$G#^A&LMT%satLWcT96QO80j!p2#z35nvpQF^J=7r zsoYSp%=An7$(c`EtO{Kv$}|rPRF8y_dff%9#43tg3{W@ZwHK`yZ6)GFT*wakJZP&C z5vf5az7}mAA|q`^G7(k<-hBjxR-_(jN3iZema(N7^*^WD`^!uWW!l3yMSEVLBcuWh z!JW!DONN_&hdYL0qd5cxk5a~XROv2^MBW_qOJPXXr?e_gtx527r-rNMBTt(_ChC|Kw#;9%Q*&e-W!W7%Xyiovqqm31|}W;{jdDF<*Mz_w4>-OZnpjc)9EHyBHg zdTM=78^dg0Wo8R~`Mp(C55k5Rf~2UQAcQ!ceS;MlRbMZx%5kzLHw8KqcfY{z@6xQh;@mO?v%LO3y?e3nhlJa8HC32TAVUx5;1G(6&$Nv?6|qG zv~(|gJRXj8b%xtd)6u~5?q1calyMWS-dbmF*!4P{c>VvAvrfs z3EC#6jz%V6t@Du{nC_Ng?#de6h&b8bwaUEN6yGIeznm;*|F=$L5aa}yjXo&usWEf5 sujefTWwaKh^X?aV`Nr!Rnh4yAKGv?8Gt&-cp?YTAOA+0ZmnR2LJ#7 diff --git a/History.js b/History.js index b540a3ed8..227de904e 100644 --- a/History.js +++ b/History.js @@ -9,7 +9,14 @@ getContainer: getContainer, setTimePeriod: setTimePeriod, setDatetime: setDatetime, - draw: draw + draw: draw, + profile: { + position: { + x: 0, + y: 0, + }, + visible: false + } }; /* this is part of the module template */ @@ -119,6 +126,7 @@ } thisObject.container.eventHandler.raiseEvent("History Changed", history); + } function recalculateScale() { @@ -166,11 +174,13 @@ function plotChart() { + let point; + for (let i = 0; i < history.length; i++) { record = history[i]; - let point = { + point = { x: record.date, y: record.sellAvgRate }; @@ -258,7 +268,21 @@ browserCanvasContext.fill(); } browserCanvasContext.stroke(); + + /* Since there is at least some point plotted, then the profile should be visible. */ + + thisObject.profile.visible = true; } + + /* + + We replace the coordinate of the profile point so that whoever has a reference to it, gets the new position. + We will use the last point plotted on screen as the profilePoint. + + */ + + thisObject.profile.position.x = point.x; + thisObject.profile.position.y = point.y; } function onZoomChanged(event) {