diff --git a/components/chart.js b/components/chart.js
index ad850aa..d13ca87 100644
--- a/components/chart.js
+++ b/components/chart.js
@@ -1,5 +1,5 @@
import React, { Component } from 'react'
-import { View, FlatList } from 'react-native'
+import { Text as ReactNativeText, View, FlatList } from 'react-native'
import range from 'date-range'
import Svg,{
G,
@@ -17,6 +17,7 @@ import config from './config'
const getCycleDayNumber = getCycleDayNumberModule()
+const yAxis = makeYAxis(config)
export default class CycleChart extends Component {
constructor(props) {
@@ -112,34 +113,10 @@ export default class CycleChart extends Component {
)
}
- placeTicksForYAxis() {
- const scaleMin = config.temperatureScale.low
- const scaleMax = config.temperatureScale.high
- const numberOfTicks = (scaleMax - scaleMin) * 2
- const tickDistance = config.chartHeight / numberOfTicks
- const ticks = []
- const labelStyle = styles.column.label.date
- for (let i = 0; i < numberOfTicks; i++) {
- const y = tickDistance * i
- ticks.push(
-
-
- {scaleMax - i * 0.5}
-
- )
- }
- return ticks
- }
-
render() {
return (
-
+ {yAxis.labels}
+ {scaleMax - i * 0.5}
+
+ )
+ tickPositions.push(y)
+ }
+
+ return {labels, tickPositions}
+}
diff --git a/components/styles.js b/components/styles.js
index cddb675..f570d37 100644
--- a/components/styles.js
+++ b/components/styles.js
@@ -50,7 +50,13 @@ const styles = {
yAxis: {
height: config.chartHeight,
width: config.columnWidth,
- stroke: 'grey'
+ },
+ yAxisLabel: {
+ position: 'absolute',
+ right: 3,
+ color: 'grey',
+ fontSize: 12,
+ fontWeight: 'bold'
}
}