diff --git a/components/chart/config.js b/components/chart/config.js index a83eafc697bdbed7218602aac679e219754718e0..ec3509ef3d24b6cbb17d962a6703a40e357b6089 100644 --- a/components/chart/config.js +++ b/components/chart/config.js @@ -1,9 +1,10 @@ const config = { chartHeight: 350, - columnWidth: 30, + columnWidth: 25, temperatureScale: { low: 35, - high: 38 + high: 38, + units: 0.1 } } diff --git a/components/chart/day-column.js b/components/chart/day-column.js index e1f5b91f44e4f15b826b237e951364d3a10298c6..1717c426792d585e24ab92b6a38205ff3a1e4486 100644 --- a/components/chart/day-column.js +++ b/components/chart/day-column.js @@ -104,7 +104,7 @@ export default class DayColumn extends Component { onPress: () => { this.passDateToDayView(dateString) }, - activeOpacity: 0.8 + activeOpacity: 1 }, columnElements ) diff --git a/components/chart/styles.js b/components/chart/styles.js index 7a25adfb1905fe45309ce8884569c7090c42152d..0dc569dbc2ec63a53b261cd3803651fbe5daad7f 100644 --- a/components/chart/styles.js +++ b/components/chart/styles.js @@ -72,10 +72,10 @@ const styles = { }, yAxisLabel: { position: 'absolute', - right: 3, + left: 3, color: 'grey', - fontSize: 12, - fontWeight: 'bold' + fontSize: 11, + textAlign: 'left' }, horizontalGrid: { position:'absolute', diff --git a/components/chart/y-axis.js b/components/chart/y-axis.js index 052aa5f595a371a57cebb43fa219db5e1420b048..ccc9404bb13a808e0fcd439ce32a7ca6d2ee10ec 100644 --- a/components/chart/y-axis.js +++ b/components/chart/y-axis.js @@ -4,9 +4,10 @@ import config from './config' import styles from './styles' function makeYAxis() { - const scaleMin = config.temperatureScale.low - const scaleMax = config.temperatureScale.high - const numberOfTicks = (scaleMax - scaleMin) * 2 + const scale = config.temperatureScale + const scaleMin = scale.low + const scaleMax = scale.high + const numberOfTicks = (scaleMax - scaleMin) * (1 / scale.units) const tickDistance = config.chartHeight / numberOfTicks const tickPositions = [] @@ -23,7 +24,7 @@ function makeYAxis() { <Text style={{...style}} key={i}> - {scaleMax - i * 0.5} + {scaleMax - i * scale.units} </Text> ) tickPositions.push(y)