import type { Meta, StoryObj } from "@storybook/react"
import { Chart } from "./Chart"

const meta: Meta<typeof Chart> = {
  component: Chart,
  title: "Charts / Chart",
  // argTypes allows you to define the behavior of the args in each story
  argTypes: {},
}

export default meta

type Story = StoryObj<typeof meta>

export const Default: Story = {
  args: {
    initOptions: {
      devicePixelRatio: window.devicePixelRatio,
      height: 400,
      width: 600,
    },
    instanceOptions: {
      xAxis: {
        type: "category",
        data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
      },
      yAxis: {
        type: "value",
      },
      series: [
        {
          data: [23, 12, 26, 38, 94, 15, 62],
          type: "line",
        },
      ],
    },
    "data-testid": "default",
  },
  render: ({ ...args }) => {
    return <Chart {...args} />
  },
}
