rate scale improved
This commit is contained in:
1 parent
2b5abf1a61
commit
d68a82812e
2 files changed
+14
-1
No files matched your search
@@ -445,13 +445,23 @@ function newRateScale () {
|
||||
rate = coordinateSystem.max.y
|
||||
}
|
||||
|
||||
let label = (rate - Math.trunc(rate)).toFixed(2)
|
||||
let decimals = 2
|
||||
if (rate < 1) { decimals = 4 }
|
||||
if (Math.trunc(rate * 100) < 1) { decimals = 6 }
|
||||
if (Math.trunc(rate * 10000) < 1) { decimals = 8 }
|
||||
if (Math.trunc(rate * 1000000) < 1) { decimals = 10 }
|
||||
let label = (rate - Math.trunc(rate)).toFixed(decimals)
|
||||
let labelArray = label.split('.')
|
||||
let label1 = thisObject.payload.node.payload.parentNode.name
|
||||
let label2 = (Math.trunc(rate)).toLocaleString()
|
||||
let label3 = labelArray[1]
|
||||
if (label3 === undefined) { label3 = '00' }
|
||||
|
||||
if (rate < 1) {
|
||||
label2 = label
|
||||
label3 = ''
|
||||
}
|
||||
|
||||
let icon1 = canvas.designSpace.iconByUiObjectType.get(thisObject.payload.node.payload.parentNode.type)
|
||||
let icon2 = canvas.designSpace.iconByUiObjectType.get(thisObject.payload.node.type)
|
||||
|
||||
|
||||
@@ -602,6 +602,9 @@
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user