Charting Details Fixed
This commit is contained in:
1 parent
8cdf22f956
commit
bc9c3d15fa
2 files changed
+23
-24
No files matched your search
+20
-20
@@ -445,9 +445,8 @@
|
||||
|
||||
if (
|
||||
(candle.begin >= leftDate.valueOf() && candle.end <= rightDate.valueOf()) &&
|
||||
(candle.begin >= coordinateSystem.min.x && candle.end <= coordinateSystem.max.x)
|
||||
)
|
||||
{
|
||||
(candle.begin >= coordinateSystem.min.x && candle.end <= coordinateSystem.max.x)
|
||||
) {
|
||||
|
||||
candles.push(candle);
|
||||
|
||||
@@ -479,6 +478,10 @@
|
||||
|
||||
if (candles.length > 0) {
|
||||
|
||||
/* On screen candles */
|
||||
let onScreenCandles = []
|
||||
let mouseCandle
|
||||
|
||||
/* Now we calculate all the points. */
|
||||
for (let i = 0; i < candles.length; i++) {
|
||||
|
||||
@@ -514,6 +517,15 @@
|
||||
candle.candlePoint3 = transformThisPoint(candle.candlePoint3, thisObject.container);
|
||||
candle.candlePoint4 = transformThisPoint(candle.candlePoint4, thisObject.container);
|
||||
|
||||
/* Skip the first candle with zero at open */
|
||||
if (candle.open === 0) { continue }
|
||||
|
||||
if (candle.candlePoint2.x < canvas.chartingSpace.viewport.visibleArea.bottomLeft.x || candle.candlePoint1.x > canvas.chartingSpace.viewport.visibleArea.bottomRight.x) {
|
||||
continue
|
||||
}
|
||||
|
||||
addToOnScreenCandles(candle)
|
||||
|
||||
candle.stickPoint1 = {
|
||||
x: candle.begin + timeFrame / 7 * 3.2,
|
||||
y: candle.max
|
||||
@@ -591,23 +603,11 @@
|
||||
candle.stickPoint2 = thisObject.fitFunction(candle.stickPoint2);
|
||||
candle.stickPoint3 = thisObject.fitFunction(candle.stickPoint3);
|
||||
candle.stickPoint4 = thisObject.fitFunction(candle.stickPoint4);
|
||||
|
||||
}
|
||||
|
||||
/* On screen candles */
|
||||
let onScreenCandles = []
|
||||
let mouseCandle
|
||||
|
||||
for (let i = 0; i < candles.length; i++) {
|
||||
|
||||
candle = candles[i];
|
||||
|
||||
/* Skip the first candle with zero at open */
|
||||
if (candle.open === 0) { continue }
|
||||
|
||||
if (candle.candlePoint2.x < canvas.chartingSpace.viewport.visibleArea.bottomLeft.x || candle.candlePoint1.x > canvas.chartingSpace.viewport.visibleArea.bottomRight.x) {
|
||||
continue
|
||||
}
|
||||
function addToOnScreenCandles(candle) {
|
||||
|
||||
/* Contributing to Auto-Scale*/
|
||||
coordinateSystem.reportYValue(candle.max)
|
||||
@@ -615,7 +615,7 @@
|
||||
|
||||
|
||||
//if (onScreenCandles.length < 15000) {
|
||||
onScreenCandles.push(candle)
|
||||
onScreenCandles.push(candle)
|
||||
//}
|
||||
|
||||
if (userPositionDate >= candle.begin && userPositionDate <= candle.end) {
|
||||
@@ -641,7 +641,7 @@
|
||||
if (lowResolution === false) {
|
||||
browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.DARK + ', 1)';
|
||||
browserCanvasContext.fill();
|
||||
|
||||
|
||||
browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.LIGHT + ', 1)';
|
||||
browserCanvasContext.lineWidth = 1;
|
||||
browserCanvasContext.setLineDash([0, 0])
|
||||
@@ -697,7 +697,7 @@
|
||||
|
||||
elementsPlotted++
|
||||
}
|
||||
|
||||
|
||||
browserCanvasContext.closePath();
|
||||
|
||||
if (lowResolution === false) {
|
||||
@@ -716,7 +716,7 @@
|
||||
browserCanvasContext.lineWidth = 1;
|
||||
browserCanvasContext.setLineDash([0, 0])
|
||||
browserCanvasContext.stroke();
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* Draw mouse candel and Raise Event. */
|
||||
|
||||
+3
-4
@@ -128,7 +128,7 @@
|
||||
/* Get ready for plotting. */
|
||||
|
||||
recalculate();
|
||||
|
||||
|
||||
dimmensionsChangedEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('Dimmensions Changed', function () {
|
||||
recalculate();
|
||||
})
|
||||
@@ -567,7 +567,6 @@
|
||||
volumePointB2 = transformThisPoint(volumePointB2, thisObject.container);
|
||||
volumePointB3 = transformThisPoint(volumePointB3, thisObject.container);
|
||||
volumePointB4 = transformThisPoint(volumePointB4, thisObject.container);
|
||||
|
||||
}
|
||||
|
||||
calculateSells(coordinateSystem, thisObject.container.frame.height); // We try to see if it fits in the visible area.
|
||||
@@ -661,7 +660,7 @@
|
||||
browserCanvasContext.lineWidth = 1;
|
||||
browserCanvasContext.setLineDash([0, 0])
|
||||
browserCanvasContext.stroke();
|
||||
|
||||
|
||||
browserCanvasContext.beginPath();
|
||||
|
||||
browserCanvasContext.moveTo(volumePointB1.x, volumePointB1.y);
|
||||
@@ -686,7 +685,7 @@
|
||||
browserCanvasContext.lineWidth = 1;
|
||||
browserCanvasContext.setLineDash([0, 0])
|
||||
browserCanvasContext.stroke();
|
||||
|
||||
|
||||
if (userPositionDate >= volume.begin && userPositionDate <= volume.end) {
|
||||
|
||||
let buyInfo = {
|
||||
|
||||
Reference in new issue
Block a user