Group bar chart with secondary y axis in plotly by python

Thanks for you reply.

bar_data = go.Bar(
          x = compa1.index,
          y = sales1.groupby('PRODUCTLINE')['SALES'].sum(),
          name = 'Total Sales',
          text = sales1.groupby('PRODUCTLINE')['SALES'].sum(),
          texttemplate = '%{text:.2s}',
          textposition = 'inside',
          marker = dict(color='rgb(214, 137, 16)'),
          yaxis = 'y1',
          offsetgroup=1
)

line_data = go.Bar(
          x = compa1.index,
          y = sales1.groupby('PRODUCTLINE')['QUANTITYORDERED'].sum(),
          name = 'Total Quantity Ordered',
          text = sales1.groupby('PRODUCTLINE')['QUANTITYORDERED'].sum(),
          texttemplate = '%{text:.2s}',
          textposition = 'inside',
          marker = dict(color='rgb(112, 123, 124)'),
          yaxis = 'y2',
          offsetgroup=2
) 

Now this code work correctly by adding two properties in two bar data.
offsetgroup=1
offsetgroup=2