๐ด Introduction
โช React ๋ฟ๋ง ์๋๋ผ, Vanilla js, Angular, Vue ํ๋ ์์ํฌ์์ ์ง์๋๋ Chart๋ฅผ ๊ทธ๋ฆฌ๋ ๋ผ์ด๋ธ๋ฌ๋ฆฌ
๐ Official
Installation & Getting Started – ApexCharts.js
Integrating ApexCharts is as simple as it can get with extensive API docs and 100+ samples ready to be used. Check out all the options of ApexCharts
apexcharts.com
๐ก Install

npm i react-apexcharts apexcharts
๐ข Usage

// [ Usage Component ]
import ApexChart from "react-apexcharts";
const Chart = () => {
return (
<ApexChart
type="line"
series={[
{
name: "Price",
data: data?.map((price) => price.close) ?? [],
},
]}
options={{
theme: {
mode: isDark ? "dark" : "light",
},
chart: {
height: 300,
width: 500,
toolbar: {
show: false,
},
background: "transparent",
},
grid: { show: false },
stroke: {
curve: "smooth",
width: 4,
},
yaxis: {
show: false,
},
xaxis: {
axisBorder: { show: false },
axisTicks: { show: false },
labels: {
show: false,
datetimeFormatter: {
month: "MMM 'yy",
},
},
type: "datetime",
categories: data?.map((price) => price.time_close),
},
fill: {
type: "gradient",
gradient: { gradientToColors: [theme.chartStart], stops: [0, 100] },
},
colors: [theme.chartEnd],
tooltip: {
y: {
formatter: (value) => `$${value.toFixed(2)}`,
},
},
}}
/>
);
}
'React > Library' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[ React ] react-helmet (0) | 2022.07.30 |
---|---|
[ React ] recoil (0) | 2022.07.30 |
[ React ] @tanstack/react-query (0) | 2022.07.30 |
[ React ] axios (0) | 2022.07.30 |
[ React ] styled-components (0) | 2022.07.18 |