change chart to drag chart,add some logic