
import { Bar } from "react-chartjs-2";
import {
  Chart as ChartJS,
  CategoryScale,
  LinearScale,
  BarElement,
  Title,
  Tooltip,
  Legend,
} from "chart.js";
// import { BiBorderRadius } from "react-icons/bi";

// ✅ Register the required components
ChartJS.register(CategoryScale, LinearScale, BarElement, Title, Tooltip, Legend);

const BarChart = () => {
  // 📊 Chart Data
  const data = {
    labels: ["Jan", "Jan", "Jan", "Jan", "Jan","Jan", "Jan", "Jan"],
    datasets: [
      {
        label: "Sales ($)",
        data: [1, 2, 3, 5, 4,6,5,8],
        backgroundColor: "#6976EB", // Light blue color
        borderColor: "#6976EB",
        borderWidth: 1,
        borderRadius:4
      },
    ],
  };

  // ⚙️ Chart Options
  const options = {
    responsive: true,
    plugins: {
      legend: { display: false },
      title: { display: false, text: "Monthly Sales Data" },
    },
  };

  return (
    <div>
      <Bar data={data} options={options} />
    </div>
  );
};

export default BarChart;
