example to plot a dynamic line chart