Use settings from observable in chart

This commit is contained in:
Julia Friesel
2018-08-22 08:43:41 +02:00
parent d5f9e6c639
commit c597a654d8
4 changed files with 53 additions and 54 deletions
+4 -4
View File
@@ -2,13 +2,12 @@ import React, { Component } from 'react'
import { View, FlatList } from 'react-native'
import range from 'date-range'
import { LocalDate } from 'js-joda'
import { yAxis, normalizeToScale, horizontalGrid } from './y-axis'
import { makeYAxisLabels, normalizeToScale, makeHorizontalGrid } from './y-axis'
import setUpFertilityStatusFunc from './nfp-lines'
import DayColumn from './day-column'
import { getCycleDay, cycleDaysSortedByDate, getAmountOfCycleDays } from '../../db'
import styles from './styles'
const yAxisView = <View {...styles.yAxis}>{yAxis.labels}</View>
export default class CycleChart extends Component {
constructor(props) {
@@ -25,6 +24,7 @@ export default class CycleChart extends Component {
/>
)
}
this.yAxisView = <View {...styles.yAxis}>{makeYAxisLabels()}</View>
this.reCalculateChartInfo = (function(Chart) {
return function() {
@@ -42,8 +42,8 @@ export default class CycleChart extends Component {
render() {
return (
<View style={{ flexDirection: 'row', marginTop: 50 }}>
{yAxisView}
{horizontalGrid}
{this.yAxisView}
{makeHorizontalGrid()}
{<FlatList
horizontal={true}
inverted={true}