title: plotly line graph iterate over columns and loop trace
body: <p>Taking this post <a href="https://stackoverflow.com/questions/55809312/plot-multiple-columns-on-line-graph-using-dash-plotly">Plot multiple columns on line graph using Dash/Plotly</a> as a reference, I'm looking to plot similar dataframe into line graph using plotly. What makes me stuck is how to put trace into a loop so that all item will be plot as difference trace data.</p>
  
  <pre><code>data = {'year':['2018','2019'],
      'jan':[20009,49599],
      'feb':[13000,22000],
      'mac':[23345,45888],
      'apr':[23399,23399]}
  
   df=pd.DataFrame(data).set_index('year')
  
          apr     feb     jan     mac
   year               
   2018   23399   13000   20009   23345
   2019   23399   22000   49599   45888
  </code></pre>
  
  <p>This is the closest code manage to get </p>
  
  <pre><code>     month = ['January', 'February', 'March', 'April']
       res=[]
       for item in df.index:
            res=go.Scatter(
                x=month,
                y=df.values.tolist(),
                mode='lines',
                name='df.index',
                )
       data=[res]
       layout = dict(title = 'Budget Monthly',
            xaxis= dict(title= 'month',ticklen= 5,zeroline= False)
           )
       fig = go.Figure(data=data, layout=layout)
       py.iplot(fig, filename='line')
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/vOTof.png" rel="nofollow noreferrer">Line plot but no separate trace </a></p>
  
  <p>Any help is very appreciated. Tq</p>