Team-groupHi / grouphi-mvp-fe

๊ทธ๋ฃจํŒŒ์ด ํ”„๋ก ํŠธ์—”๋“œ ๋ฆฌํฌ์ง€ํ† ๋ฆฌ
https://grouphi.vercel.app/
MIT License
1 stars 2 forks source link

PieChart ์ปดํฌ๋„ŒํŠธ #52

Closed joyswim closed 5 days ago

joyswim commented 2 weeks ago

๐Ÿ“์ž‘์—… ๋‚ด์šฉ

Chart.js ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์„ธ๋ถ€ ๊ฒฐ๊ณผ์— ์‚ฌ์šฉ๋  PieChart ์ปดํฌ๋„ŒํŠธ๋ฅผ ๊ตฌํ˜„ํ•ฉ๋‹ˆ๋‹ค. ํ…Œ์ŠคํŠธ ์ฝ”๋“œ๋ฅผ ์ฐธ๊ณ ํ•˜์—ฌ labels, data๋ฅผ ์ „๋‹ฌํ•ด์ฃผ์„ธ์š”.

๐Ÿ“ท์Šคํฌ๋ฆฐ์ƒท

์Šคํฌ๋ฆฐ์ƒท

๐Ÿงช ํ…Œ์ŠคํŠธ

// page.tsx
import { PieChart } from '@/components/PieChart';

const DUMMY_DATA = {
  labels: ['๊ณ ์–‘์ด', '๊ฐ•์•„์ง€', '๋ฏธ์„ ํƒ'],
  data: [5, 4, 1],
};

export default function Home() {
  return (
    <div className="my-10 flex gap-10">
      <PieChart
        labels={DUMMY_DATA.labels}
        data={DUMMY_DATA.data}
      />
      <PieChart
        labels={[]}
        data={[]}
      />
      <PieChart
        labels={DUMMY_DATA.labels}
        data={DUMMY_DATA.data}
        className="bg-gray-800 w-80"
      />
    </div>
  );
}

โœจPR Point