title: How do I add a target line for each bar in a bar chart with Plotly?
body: <p>I am using the Plotly Panel plugin for Grafana and would like to plot a the Setpoint and Actual values for several variables.</p>
  <p>I am able to generate a graph as below:</p>
  <p><a href="https://i.stack.imgur.com/auGP3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/auGP3.png" alt="grouped bar chart" /></a></p>
  <p>using the following script:</p>
  <pre class="lang-js prettyprint-override"><code>var trace0 = {
      x: ['A', 'B', 'C'],
      y: [100, 40, 130],
      type: 'bar',
      name: 'Setpoint'
      };
  var trace1 = {
      x: ['A', 'B', 'C'],
      y: [87, 46, 112],
      type: 'bar',
      name: 'Actual'
  };
  
  return {data:[trace0, trace1],layout:{title:'Control'}};
  </code></pre>
  <p>This works. However, I think that having the &quot;Setpoint&quot; as a line over each &quot;Actual&quot; bar would be more compact while also making the graph more intuitive.
  Here is the Mockup of the chart I did with Google Sheets + Paint:
  <a href="https://i.stack.imgur.com/VQyo5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VQyo5.png" alt="Mockup of desired chart" /></a></p>
  <p>I also had a look at the bullet chart to see if I could use it for this purpose but couldn't figure out how.</p>