update
This commit is contained in:
@@ -10,7 +10,7 @@ import {
|
||||
} from "@chakra-ui/react";
|
||||
import { TbArrowBadgeRightFilled } from "react-icons/tb";
|
||||
|
||||
function ChartsTabs({ selectedValue, setSelectedValue }) {
|
||||
function ChartsTabs({ selectedValue, setSelectedValue, days }) {
|
||||
|
||||
const { colorMode } = useColorMode();
|
||||
// This function represents the RadioCard part
|
||||
@@ -49,7 +49,7 @@ function ChartsTabs({ selectedValue, setSelectedValue }) {
|
||||
}
|
||||
|
||||
// Setting defaultValue to '24 DayusHrs'
|
||||
const options = ["24 Hrs", "30 Days", "12 Months"];
|
||||
const options = ["24 Hrs", `${days} Days`, "12 Months"];
|
||||
|
||||
const { getRootProps, getRadioProps } = useRadioGroup({
|
||||
name: "framework",
|
||||
|
||||
@@ -41,7 +41,7 @@ const LineChart = () => {
|
||||
Math.floor(Math.random() * 5000 + 1000)
|
||||
);
|
||||
setDataset(dailyData);
|
||||
} else if (selectedValue === "30 Days") {
|
||||
} else if (selectedValue === `${dayjs().daysInMonth()} Days`) {
|
||||
// Create labels for the current month (days)
|
||||
const daysInMonth = dayjs().daysInMonth();
|
||||
const days = Array.from(
|
||||
@@ -167,6 +167,7 @@ const LineChart = () => {
|
||||
<ChartsTabs
|
||||
setSelectedValue={setSelectedValue}
|
||||
selectedValue={selectedValue}
|
||||
days={dayjs().daysInMonth()}
|
||||
/>
|
||||
</Box>
|
||||
<Line data={data} options={options} />
|
||||
|
||||
Reference in New Issue
Block a user