Murphy Logo Murphy

Price Chart

The PriceChart component is a chart that displays the price of a token over time.

PriceChart

$WIF
$WIF Price
$WIF price over time

Installation

Install Murphy TokenIcon

pnpm dlx shadcn@canary add https://www.murphyai.dev/r/token-icon.json

Install Murphy PriceChart

pnpm dlx shadcn@canary add https://www.murphyai.dev/r/price-chart.json

Basic Usage

import { PriceChart } from "@/components/ui/murphy/price-chart";
<PriceChart
  asset={wifAsset}
  description="$WIF price over time"
  data={chartData}
  timeScale={timestamps[dateRange].timeScale}
  onDateRangeChange={(value) => setDateRange(value as DateRangeKey)}
  dateRangeOptions={["1D", "1W", "1M", "1Y"]}
  defaultDateRange={dateRange}
/>  

Props

NameTypeDefault
assetSolAssetundefined
descriptionstring
datadata: {timestamp: number; price: number; }[];[]
timeScale"time" | "day" | "date" | "month""time"
titlestring
onDateRangeChange(value: DateRangeKey) => void
dateRangeOptionsstring[]
defaultDateRangestring

On this page

How are you feeling?

Join Our Community