Style x axis labels a bit nicer

This commit is contained in:
Julia Friesel
2018-06-25 16:36:37 +02:00
parent d31783d293
commit a205f432ed
2 changed files with 13 additions and 6 deletions
+3 -3
View File
@@ -45,14 +45,14 @@ export default class CycleChart extends Component {
makeDayColumn({ dateString, cycleDay, y }, index) { makeDayColumn({ dateString, cycleDay, y }, index) {
const cycleDayNumber = getCycleDayNumber(dateString) const cycleDayNumber = getCycleDayNumber(dateString)
const labelProps = styles.column.label const label = styles.column.label
const dateLabel = dateString.split('-').slice(1).join('-') const dateLabel = dateString.split('-').slice(1).join('-')
return ( return (
<G key={dateString} onPress={() => this.passDateToDayView(dateString)}> <G key={dateString} onPress={() => this.passDateToDayView(dateString)}>
<Rect {...styles.column.rect} /> <Rect {...styles.column.rect} />
<Text {...labelProps} y={config.cycleDayNumberRowY}>{cycleDayNumber}</Text> <Text {...label.number} y={config.cycleDayNumberRowY}>{cycleDayNumber}</Text>
<Text {...labelProps} y={config.dateRowY}>{dateLabel}</Text> <Text {...label.date} y={config.dateRowY}>{dateLabel}</Text>
{cycleDay && cycleDay.bleeding ? {cycleDay && cycleDay.bleeding ?
<Path {...styles.bleedingIcon} <Path {...styles.bleedingIcon}
+8 -1
View File
@@ -11,9 +11,16 @@ const styles = {
}, },
column: { column: {
label: { label: {
date: {
stroke: 'grey', stroke: 'grey',
fontSize: 10, fontSize: 10,
x: 0 x: 2
},
number: {
stroke: 'purple',
fontSize: 13,
x: config.columnMiddle - 1
}
}, },
rect: { rect: {
fill: '#f9f9f9', fill: '#f9f9f9',