import React from 'react';
import { useEffect } from 'react';
import { useRef } from 'react';
import { BasicChart } from '../index';

const Demo = () => {
  const ref = useRef();
  const option = {
    xAxis: {
      type: 'category',
      data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
    },
    yAxis: {
      type: 'value',
    },
    series: [
      {
        data: [150, 230, 224, 218, 135, 147, 260],
        type: 'line',
      },
    ],
  };

  useEffect(() => {
    console.log(ref.current);
  }, []);

  return (
    <div style={{ height: 300 }}>
      <BasicChart ref={ref} option={option} />
    </div>
  );
};

export default Demo;
