mirror of
https://github.com/dylanbenzi/yellowbird.git
synced 2026-11-27 01:07:01 +00:00
more customizable charts
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
import {
|
||||
heatmapData,
|
||||
newsData,
|
||||
portfolioData,
|
||||
indexData,
|
||||
winnerMovers,
|
||||
loserMovers,
|
||||
} from "@/app/MockData/MockData";
|
||||
import HomepageModule from "./HomepageModuleCard";
|
||||
import PortfolioChart, {
|
||||
AreaSeriesPartialOptionsWithData,
|
||||
LineSeriesPartialOptionsWithData,
|
||||
} from "../charts/Chart";
|
||||
import MarketHeatmap from "../charts/MarketHeatmap";
|
||||
@@ -16,18 +15,30 @@ import { ArrowRight } from "lucide-react";
|
||||
import { NewsTable } from "../charts/news/NewsTable";
|
||||
import { newsColumns } from "../charts/news/newsColumns";
|
||||
import Chart from "../charts/Chart";
|
||||
import {
|
||||
LineData,
|
||||
LineStyle,
|
||||
LineType,
|
||||
WhitespaceData,
|
||||
} from "lightweight-charts";
|
||||
import { globalColors, smaFunc } from "@/lib/utils";
|
||||
import { seriesOne } from "@/app/MockData/seriesOne";
|
||||
import { seriesThree } from "@/app/MockData/seriesThree";
|
||||
import { seriesFive } from "@/app/MockData/seriesFive";
|
||||
|
||||
export const PortfolioModule = () => {
|
||||
const portfolioLine: LineSeriesPartialOptionsWithData = {
|
||||
type: "line",
|
||||
data: portfolioData,
|
||||
data: seriesThree,
|
||||
color: "white",
|
||||
lineType: LineType.Curved,
|
||||
};
|
||||
|
||||
const indexLine: LineSeriesPartialOptionsWithData = {
|
||||
type: "line",
|
||||
data: indexData,
|
||||
color: "yellow",
|
||||
data: seriesFive,
|
||||
color: globalColors.yellow,
|
||||
lineType: LineType.Curved,
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -120,28 +131,45 @@ export const MoversModule = () => {
|
||||
};
|
||||
|
||||
export const MarketsModule = () => {
|
||||
// const chartSeries: chartSeries[] = [
|
||||
// {
|
||||
// options: {color: "yellow"},
|
||||
// type: "line",
|
||||
// data: portfolioData,
|
||||
// },
|
||||
// {
|
||||
// type: "line",
|
||||
// data:
|
||||
// }
|
||||
// ];
|
||||
const sp500IndexLine: LineSeriesPartialOptionsWithData = {
|
||||
type: "line",
|
||||
data: seriesOne,
|
||||
color: "white",
|
||||
lineType: LineType.Curved,
|
||||
priceLineVisible: false,
|
||||
};
|
||||
|
||||
const sma5Line: LineSeriesPartialOptionsWithData = {
|
||||
type: "line",
|
||||
data: smaFunc(seriesOne, 20),
|
||||
color: globalColors.yellow,
|
||||
lineType: LineType.Curved,
|
||||
priceLineVisible: false,
|
||||
};
|
||||
|
||||
return (
|
||||
<HomepageModule title="Markets">
|
||||
<div className="w-full h-full">
|
||||
<div className="w-1/2"></div>
|
||||
<div className="w-1/2 border-blue-200 border">
|
||||
{/* <Chart
|
||||
series={chartSeries}
|
||||
backgroundColor={"transparent"}
|
||||
textColor={"white"}
|
||||
/> */}
|
||||
<div className="flex h-full">
|
||||
<div className="w-1/2">content</div>
|
||||
<div className="h-full w-1/2 relative">
|
||||
<div className="absolute">S&P 500</div>
|
||||
<Chart
|
||||
series={[sp500IndexLine, sma5Line]}
|
||||
colors={{
|
||||
backgroundColor: "transparent",
|
||||
textColor: "white",
|
||||
}}
|
||||
options={{
|
||||
grid: {
|
||||
horzLines: {
|
||||
visible: false,
|
||||
},
|
||||
vertLines: {
|
||||
visible: false,
|
||||
},
|
||||
},
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</HomepageModule>
|
||||
|
||||
Reference in New Issue
Block a user