import { reactive } from 'vue'
import { EchartsDataset } from './interface'

export function useDataset() {
    const dataset = reactive<EchartsDataset>({
        line: {
            dimensions: ['date', 'price'],
            source: {
                date: [],
                price: [],
            },
        }
    })

    // 清空数据
    const clearData = () => {
        dataset.line.source = {
            date: [],
            price: [],
        };
    }

    return {
        dataset,
        clearData,
    }
}