diff --git a/components/chart/chart.js b/components/chart/chart.js index ddd8d007b890ebd6c9cb6cae9e01ccf0d174d241..5fb03da23b45d4c28f10162ed60e8900790d6189 100644 --- a/components/chart/chart.js +++ b/components/chart/chart.js @@ -33,7 +33,7 @@ export default class CycleChart extends Component { const height = nativeEvent.layout.height this.setState({ chartHeight: height }) this.reCalculateChartInfo = () => { - this.setState({ columns: this.makeColumnInfo(nfpLines(height)) }) + this.setState({ columns: this.makeColumnInfo(nfpLines()) }) } this.cycleDaysSortedByDate.addListener(this.reCalculateChartInfo) @@ -104,7 +104,7 @@ export default class CycleChart extends Component { dateString, y: temp ? normalizeToScale(temp, columnHeight) : null, symptoms, - ...getFhmAndLtlInfo(dateString, temp) + ...getFhmAndLtlInfo(dateString, temp, columnHeight) } }) diff --git a/components/chart/day-column.js b/components/chart/day-column.js index 7f3fe5f1ed5d195ad25f9cb8d72a26c16318e6f7..47c412695879fd985cf61e911a3f02f2b56fb414 100644 --- a/components/chart/day-column.js +++ b/components/chart/day-column.js @@ -67,7 +67,7 @@ export default class DayColumn extends Component { x2={x} y2={columnHeight} {...styles.nfpLine} - key='ltl' + key='fhm' />) columnElements.push(fhmLine) } diff --git a/components/chart/nfp-lines.js b/components/chart/nfp-lines.js index ded95e8197e1e28cba34a8fa05b3383a1a2412eb..51842d577ca8928b07e5ff941a1e8552db00786a 100644 --- a/components/chart/nfp-lines.js +++ b/components/chart/nfp-lines.js @@ -1,7 +1,7 @@ import { getCycleStatusForDay } from '../../lib/sympto-adapter' import { normalizeToScale } from './y-axis' -export default function (chartHeight) { +export default function () { const cycle = { status: null } @@ -49,7 +49,7 @@ export default function (chartHeight) { ) } - return function(dateString, temperature) { + return function(dateString, temperature, columnHeight) { const ret = { drawLtlAt: null, drawFhmLine: false @@ -71,7 +71,7 @@ export default function (chartHeight) { dateIsInPeriOrPostPhase(dateString) && isInTempMeasuringPhase(temperature, dateString) ) { - ret.drawLtlAt = normalizeToScale(tempShift.ltl, chartHeight) + ret.drawLtlAt = normalizeToScale(tempShift.ltl, columnHeight) } }