var chartDom = document.getElementById('main');
var myChart = echarts.init(chartDom);
// 指定图表的配置项和数据
var option = {
    xAxis: {
        type: 'category',
        data: [1,2,3,4,5,6]
    },
    yAxis: {
        type: 'value'
    },
    tooltip:{
        trigger:'axis'
    },
    dataZoom:[{
        type:"inside"         //详细配置可见echarts官网
    }],
    series: [
        {
            name: 'DN',
            data: [150, 230, 224, 218, 135, 147, 260],
            type: 'line'
        }
    ]
};

option.xAxis.data=xx;
option.series[0].data=yy;
option
myChart.setOption(option);