Make columnsize a bit smaller and style y axis

This commit is contained in:
Julia Friesel
2018-08-14 13:20:10 +02:00
parent 92ac6525ed
commit 8df3e74127
4 changed files with 12 additions and 10 deletions
+3 -2
View File
@@ -1,9 +1,10 @@
const config = { const config = {
chartHeight: 350, chartHeight: 350,
columnWidth: 30, columnWidth: 25,
temperatureScale: { temperatureScale: {
low: 35, low: 35,
high: 38 high: 38,
units: 0.1
} }
} }
+1 -1
View File
@@ -104,7 +104,7 @@ export default class DayColumn extends Component {
onPress: () => { onPress: () => {
this.passDateToDayView(dateString) this.passDateToDayView(dateString)
}, },
activeOpacity: 0.8 activeOpacity: 1
}, },
columnElements columnElements
) )
+3 -3
View File
@@ -72,10 +72,10 @@ const styles = {
}, },
yAxisLabel: { yAxisLabel: {
position: 'absolute', position: 'absolute',
right: 3, left: 3,
color: 'grey', color: 'grey',
fontSize: 12, fontSize: 11,
fontWeight: 'bold' textAlign: 'left'
}, },
horizontalGrid: { horizontalGrid: {
position:'absolute', position:'absolute',
+5 -4
View File
@@ -4,9 +4,10 @@ import config from './config'
import styles from './styles' import styles from './styles'
function makeYAxis() { function makeYAxis() {
const scaleMin = config.temperatureScale.low const scale = config.temperatureScale
const scaleMax = config.temperatureScale.high const scaleMin = scale.low
const numberOfTicks = (scaleMax - scaleMin) * 2 const scaleMax = scale.high
const numberOfTicks = (scaleMax - scaleMin) * (1 / scale.units)
const tickDistance = config.chartHeight / numberOfTicks const tickDistance = config.chartHeight / numberOfTicks
const tickPositions = [] const tickPositions = []
@@ -23,7 +24,7 @@ function makeYAxis() {
<Text <Text
style={{...style}} style={{...style}}
key={i}> key={i}>
{scaleMax - i * 0.5} {scaleMax - i * scale.units}
</Text> </Text>
) )
tickPositions.push(y) tickPositions.push(y)