title: Create a stacked graph or bar graph using plotly in python
body: <p>I have data like this :</p>
  
  <pre><code>[ ('2018-04-09', '10:18:11',['s1',10],['s2',15],['s3',5])
  
  ('2018-04-09', '10:20:11',['s4',8],['s2',20],['s1',10])
  
  ('2018-04-10', '10:30:11',['s4',10],['s5',6],['s6',3]) ]
  </code></pre>
  
  <p>I want to plot a stacked graph preferably of this data.</p>
  
  <p>X-axis will be time, 
  it should be like  this 
  <a href="https://i.stack.imgur.com/vOWa4.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vOWa4.jpg" alt="enter image description here"></a></p>
  
  <p>I created this image in paint just to show. 
  X axis will show time like normal graph does( 10:00 ,April 3,2018).</p>
  
  <p>I am stuck because the string value (like 's1',or 's2' ) will change in differnt bar graph.</p>
  
  <p>Just to hard code and verify,I try this:</p>
  
  <pre><code>import plotly
  import plotly.graph_objs as go
  import matplotlib.pyplot as plt
  import matplotlib
  plotly.offline.init_notebook_mode()
  
  def createPage():
  
      graph_data = []
  
      l1=[('com.p1',1),('com.p2',2)('com.p3',3)]
  
      l2=[('com.p1',1),('com.p4',2)('com.p5',3)]
  
      l3=[('com.p2',8),('com.p3',2)('com.p6',30)]
  
      trace_temp = go.Bar(
                  x='2018-04-09 10:18:11',
                  y=l1[0],
                  name = 'top',
                  )
  
      graph_data.append(trace_temp)
  
  
      plotly.offline.plot(graph_data, filename='basic-scatter3.html')
  
  createPage()
  </code></pre>
  
  <p>Error I am getting is <code>Tuple Object is not callable</code>.</p>
  
  <p>So can someone please suggest some code for how I can plot such data.
  If needed,I may store data in some other form which may be helpful in plotting.</p>
  
  <p>Edit :
  I used the approach suggested in accepted answer and succeed in plotting using plotly like this</p>
  
  <pre><code>fig=df.iplot(kin='bar',barmode='stack',asFigure=True)
  
  plotly.offline.plt(fig,filename="stack1.html)
  </code></pre>
  
  <p>However I faced one error:</p>
  
  <p>1.When Time intervals are very close,Data overlaps on graph.
  Is there a way to overcome it.</p>