Fix chart dots and lines

This commit is contained in:
Sofiya Tepikin
2021-01-03 12:36:37 +00:00
parent 17266d46dd
commit 2fb20c0031
4 changed files with 20 additions and 11 deletions
+6 -3
View File
@@ -7,8 +7,11 @@ import { getCycleDay, getAmountOfCycleDays } from '../../db'
//YAxis helpers
export function normalizeToScale(temp, columnHeight) {
const scale = scaleObservable.value
const valueRelativeToScale = (scale.max - temp) / (scale.max - scale.min)
const unit = unitObservable.value
//Add 1 tick above the max value to display on chart
const scaleMax = scaleObservable.value.max + unit
const scaleMin = scaleObservable.value.min - unit
const valueRelativeToScale = (scaleMax - temp) / (scaleMax - scaleMin)
return getAbsoluteValue(valueRelativeToScale, columnHeight)
}
@@ -286,4 +289,4 @@ export function nfpLines() {
return ret
}
}
}