Make columnsize a bit smaller and style y axis
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
const config = {
|
||||
chartHeight: 350,
|
||||
columnWidth: 30,
|
||||
columnWidth: 25,
|
||||
temperatureScale: {
|
||||
low: 35,
|
||||
high: 38
|
||||
high: 38,
|
||||
units: 0.1
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ export default class DayColumn extends Component {
|
||||
onPress: () => {
|
||||
this.passDateToDayView(dateString)
|
||||
},
|
||||
activeOpacity: 0.8
|
||||
activeOpacity: 1
|
||||
},
|
||||
columnElements
|
||||
)
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user