Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CryptoMetrics_L02_GRP15
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
L02_GRP15
CryptoMetrics_L02_GRP15
Commits
aed9141d
Commit
aed9141d
authored
3 years ago
by
Aggarwal Himanshu
Browse files
Options
Downloads
Patches
Plain Diff
Add and configure crypto line chart
parent
f4e93160
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!7
Merge develop to main
,
!6
Add a Table View for Cryptocurrencies
,
!4
Improve Table UI and make it more modular
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/cryptometrics/components/charts/CryptoRowLineChart.js
+20
-0
20 additions, 0 deletions
src/cryptometrics/components/charts/CryptoRowLineChart.js
src/cryptometrics/constants/constants.js
+71
-0
71 additions, 0 deletions
src/cryptometrics/constants/constants.js
with
91 additions
and
0 deletions
src/cryptometrics/components/charts/CryptoRowLineChart.js
0 → 100644
+
20
−
0
View file @
aed9141d
import
React
,
{
useRef
}
from
"
react
"
;
import
ReactECharts
from
"
echarts-for-react
"
;
import
{
cryptoLineChartOptions
}
from
"
../../constants
"
;
import
{
useCryptoTimeSeriesData
}
from
"
../../queries
"
;
function
CryptoRowLineChart
({
currencyId
,
color
})
{
const
cryptoQuery
=
useCryptoTimeSeriesData
(
currencyId
,
1
,
"
hourly
"
);
const
chartRef
=
useRef
(
null
);
return
(
<
ReactECharts
ref
=
{
chartRef
}
option
=
{
cryptoLineChartOptions
(
cryptoQuery
.
data
?.
prices
,
color
)}
style
=
{{
height
:
"
100%
"
,
}}
/
>
);
}
export
default
CryptoRowLineChart
;
This diff is collapsed.
Click to expand it.
src/cryptometrics/constants/constants.js
+
71
−
0
View file @
aed9141d
...
...
@@ -65,6 +65,77 @@ export const cryptoChartOptions = (colors = [], dark = false) => {
};
};
export
const
cryptoLineChartOptions
=
(
seriesData
=
[],
color
=
"
#3590F3
"
)
=>
{
return
{
grid
:
{
bottom
:
10
,
right
:
10
,
top
:
10
,
left
:
10
,
},
xAxis
:
{
show
:
false
,
type
:
"
time
"
,
silent
:
false
,
splitLine
:
{
show
:
false
,
},
splitArea
:
{
show
:
false
,
},
},
yAxis
:
{
show
:
false
,
type
:
"
value
"
,
splitArea
:
{
show
:
false
,
},
splitLine
:
{
show
:
false
,
},
min
:
"
dataMin
"
,
max
:
"
dataMax
"
,
},
series
:
[
{
type
:
"
line
"
,
data
:
seriesData
,
name
:
"
Solana
"
,
smooth
:
true
,
symbol
:
"
none
"
,
lineStyle
:
{
width
:
3
,
shadowOffsetY
:
-
1
,
color
:
color
,
shadowColor
:
color
,
shadowOffsetX
:
0
,
shadowBlur
:
5
,
cap
:
"
round
"
,
opacity
:
1
,
},
animation
:
false
,
},
{
type
:
"
scatter
"
,
data
:
seriesData
.
slice
(
-
1
),
name
:
"
ABC
"
,
smooth
:
true
,
symbol
:
"
circle
"
,
symbolSize
:
20
,
itemStyle
:
{
shadowOffsetY
:
0
,
color
:
color
,
shadowColor
:
color
,
shadowOffsetX
:
0
,
shadowBlur
:
15
,
opacity
:
0.1
,
},
animation
:
false
,
},
],
};
};
export
const
cryptocurrencies
=
[
{
id
:
"
bitcoin
"
,
...
...
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