Is it possible to plot both a horizontal line and a vertical line on an Excel chart?
<p>I have some scatterplot values that serve as my primary data series, say:</p>
<blockquote>
<p>Zinc(ppm), X Values: 20, 50, 60, 70, ...</p>
<p>Iron(ppm), Y Values: 30, 51, 10, 90, ...</p>
</blockquote>
<p>Zinc and Iron both have upper threshold limits on how high they can be, say 50 ppm for Iron and 100 ppm for Zinc. I would like these to be displayed visually with a horizontal line for Iron and a vertical line for Zinc.</p>
<p>Displaying either a horizontal line or a vertical line on a secondary X-axis or secondary Y-axis respectively is easy enough (see Peltier's blog, thousands of threads on Stack Overflow, etc.). But, displaying both at the same time seems impossible. To display a vertical line for example, you would dictate a new data series to be a &quot;Scatter with Straight Lines&quot; chart type, set two X values to 100, and set two Y values as 0 and 1. Voila!</p>
<p>The root problem with displaying <em>both a vertical and a horizontal line</em> seems to be that you cannot split the X values and Y values of a single data series between a primary and a secondary axis. The X and Y values of a single data series have to be either both on the primary axis or both on the secondary axis. This becomes problematic when introducing a horizontal line into my example because this would require me adjusting the secondary X-axis which would affect how the 100 is displayed in the vertical line data series.</p>
<p>I'm currently controlling my graph through VBA, but a solution either by VBA or Excel proper would be appreciated!</p>
<p>Thanks.</p>