Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Drip
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
backup
Drip
Commits
3598dd5b
Commit
3598dd5b
authored
5 years ago
by
mashazyu
Committed by
Sofiya Tepikin
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Introduces ChartLegend component
parent
270b823c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
components/chart/chart-legend.js
+27
-0
27 additions, 0 deletions
components/chart/chart-legend.js
components/chart/styles.js
+4
-0
4 additions, 0 deletions
components/chart/styles.js
components/chart/y-axis.js
+2
-14
2 additions, 14 deletions
components/chart/y-axis.js
with
33 additions
and
14 deletions
components/chart/chart-legend.js
0 → 100644
+
27
−
0
View file @
3598dd5b
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
(
<
View
style
=
{[
styles
.
yAxis
,
styles
.
chartLegend
]}
>
<
DripHomeIcon
name
=
"
circle
"
size
=
{
styles
.
yAxis
.
width
-
7
}
color
=
{
cycleDayColor
}
/
>
<
AppText
style
=
{
styles
.
yAxisLabels
.
dateLabel
}
>
{
labels
.
date
.
toLowerCase
()}
<
/AppText
>
<
/View
>
)
}
export
default
ChartLegend
This diff is collapsed.
Click to expand it.
components/chart/styles.js
+
4
−
0
View file @
3598dd5b
...
...
@@ -131,6 +131,10 @@ const styles = {
alignItems
:
'
center
'
,
justifyContent
:
'
center
'
,
},
chartLegend
:
{
alignItems
:
'
center
'
,
justifyContent
:
'
center
'
,
},
horizontalGrid
:
{
position
:
'
absolute
'
,
borderStyle
:
'
solid
'
,
...
...
This diff is collapsed.
Click to expand it.
components/chart/y-axis.js
+
2
−
14
View file @
3598dd5b
...
...
@@ -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 }) => {
})}
<
/View
>
<
View
style
=
{[
styles
.
yAxis
,
{
height
}]}
>
{
makeYAxisLabels
(
height
)}
<
/View
>
<
View
style
=
{[
styles
.
yAxis
,
{
alignItems
:
'
center
'
,
justifyContent
:
'
center
'
}]}
>
<
DripHomeIcon
name
=
"
circle
"
size
=
{
styles
.
yAxis
.
width
-
7
}
color
=
{
cycleDayColor
}
/
>
<
AppText
style
=
{[
styles
.
yAxisLabels
.
dateLabel
]}
>
{
labels
.
date
.
toLowerCase
()}
<
/AppText
>
<
/View
>
<
ChartLegend
/>
<
/View
>
)
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment