-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adds charts back to the portfolio card with random data for now * Patches LWC to bring in the latest release, which allows for curved charts
- Loading branch information
Showing
23 changed files
with
32,167 additions
and
202 deletions.
There are no files selected for viewing
81 changes: 81 additions & 0 deletions
81
apps/ui/app/components/Portfolios/PortfolioCard/portfolio-card-chart.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import { AreaChart } from '@baggers/ui-components'; | ||
import { useState } from 'react'; | ||
import { Theme, useTheme } from '~/components/theme'; | ||
|
||
const POINTS = [ | ||
{ time: `2018-12-22`, value: 32.51 }, | ||
{ time: `2018-12-23`, value: 31.11 }, | ||
{ time: `2018-12-24`, value: 27.02 }, | ||
{ time: `2018-12-25`, value: 27.32 }, | ||
{ time: `2018-12-26`, value: 25.17 }, | ||
{ time: `2018-12-27`, value: 28.89 }, | ||
{ time: `2018-12-28`, value: 25.46 }, | ||
{ time: `2018-12-29`, value: 23.92 }, | ||
{ time: `2018-12-30`, value: 22.68 }, | ||
{ time: `2018-12-31`, value: 22.67 }, | ||
{ time: `2019-01-01`, value: 22.67 }, | ||
{ time: `2019-01-02`, value: 22.67 }, | ||
{ time: `2019-01-03`, value: 22.67 }, | ||
{ time: `2019-01-04`, value: 22.67 }, | ||
{ time: `2019-01-05`, value: 22.67 }, | ||
{ time: `2019-01-07`, value: 22.67 }, | ||
]; | ||
export const PortfolioCardChart = () => { | ||
const [chartData] = useState( | ||
POINTS.map((point) => ({ ...point, value: Math.random() * 30 })) | ||
); | ||
|
||
return ( | ||
<AreaChart | ||
fitContent | ||
className="h-[400px]" | ||
options={{ | ||
layout: { | ||
background: { | ||
color: 'transparent', | ||
}, | ||
}, | ||
handleScale: false, | ||
handleScroll: false, | ||
watermark: { | ||
visible: false, | ||
}, | ||
crosshair: { | ||
horzLine: { | ||
visible: false, | ||
}, | ||
mode: undefined, | ||
|
||
vertLine: { | ||
visible: false, | ||
}, | ||
}, | ||
rightPriceScale: { | ||
visible: false, | ||
}, | ||
timeScale: { | ||
visible: false, | ||
}, | ||
grid: { | ||
vertLines: { | ||
visible: false, | ||
}, | ||
horzLines: { | ||
visible: false, | ||
}, | ||
}, | ||
}} | ||
seriesOptions={{ | ||
lineColor: 'rgba(116, 47, 246, 0.8)', | ||
lineWidth: 3, | ||
|
||
topColor: 'rgba(154, 106, 255, 0.55)', | ||
bottomColor: 'rgba(84, 116, 254, 0.01)', | ||
|
||
crosshairMarkerVisible: false, | ||
lineType: 2, | ||
}} | ||
data={chartData} | ||
/> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.