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) {
const cycleDayNumber = getCycleDayNumber(dateString)
const labelProps = styles.column.label
const label = styles.column.label
const dateLabel = dateString.split('-').slice(1).join('-')
return (
<G key={dateString} onPress={() => this.passDateToDayView(dateString)}>
<Rect {...styles.column.rect} />
<Text {...labelProps} y={config.cycleDayNumberRowY}>{cycleDayNumber}</Text>
<Text {...labelProps} y={config.dateRowY}>{dateLabel}</Text>
<Text {...label.number} y={config.cycleDayNumberRowY}>{cycleDayNumber}</Text>
<Text {...label.date} y={config.dateRowY}>{dateLabel}</Text>
{cycleDay && cycleDay.bleeding ?
<Path {...styles.bleedingIcon}
+10 -3
View File
@@ -11,9 +11,16 @@ const styles = {
},
column: {
label: {
stroke: 'grey',
fontSize: 10,
x: 0
date: {
stroke: 'grey',
fontSize: 10,
x: 2
},
number: {
stroke: 'purple',
fontSize: 13,
x: config.columnMiddle - 1
}
},
rect: {
fill: '#f9f9f9',