diff --git a/components/chart/chart-legend.js b/components/chart/chart-legend.js new file mode 100644 index 0000000..df6f8a6 --- /dev/null +++ b/components/chart/chart-legend.js @@ -0,0 +1,27 @@ +import React from 'react' +import { View } from 'react-native' + +import AppText from '../app-text' +import DripHomeIcon from '../../assets/drip-home-icons' + +import styles from './styles' +import { cycleDayColor } from '../../styles' + +import { shared as labels } from '../../i18n/en/labels' + +const ChartLegend = () => { + return ( + + + + {labels.date.toLowerCase()} + + + ) +} + +export default ChartLegend diff --git a/components/chart/styles.js b/components/chart/styles.js index d95f51d..d830782 100644 --- a/components/chart/styles.js +++ b/components/chart/styles.js @@ -131,6 +131,10 @@ const styles = { alignItems: 'center', justifyContent: 'center', }, + chartLegend: { + alignItems: 'center', + justifyContent: 'center', + }, horizontalGrid: { position:'absolute', borderStyle: 'solid', diff --git a/components/chart/y-axis.js b/components/chart/y-axis.js index 5402570..ab3a4d3 100644 --- a/components/chart/y-axis.js +++ b/components/chart/y-axis.js @@ -6,13 +6,10 @@ import config from '../../config' import { scaleObservable, unitObservable } from '../../local-storage' import AppText from '../app-text' -import DripHomeIcon from '../../assets/drip-home-icons' import SymptomIcon from './symptom-icon' +import ChartLegend from './chart-legend' import styles from './styles' -import { cycleDayColor } from '../../styles' - -import { shared as labels } from '../../i18n/en/labels' export function makeYAxisLabels(columnHeight) { const units = unitObservable.value @@ -99,16 +96,7 @@ const YAxis = ({ height, symptomsToDisplay, symptomsSectionHeight }) => { })} {makeYAxisLabels(height)} - - - - {labels.date.toLowerCase()} - - + ) }