import * as echarts from "echarts";
function initChart(chartDom, option) {
  const myChart = echarts.init(chartDom);
  option && myChart.setOption(option);
  return myChart;
}
function updatedChartOption(myChart, option) {
  option && myChart.setOption(option, true);
}
function destroyChart(myChart) {
  myChart.dispose();
}
function tooltipAnimationFunc(myChart, curIndex, lastIndex) {
  myChart.dispatchAction({
    type: "downplay",
    seriesIndex: 0,
    dataIndex: lastIndex
  });
  myChart.dispatchAction({
    type: "showTip",
    seriesIndex: 0,
    dataIndex: curIndex
  });
  myChart.dispatchAction({
    type: "highlight",
    dataIndex: curIndex
  });
}
export { destroyChart, initChart, tooltipAnimationFunc, updatedChartOption };
