• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Plotting a vertical line with positive/negative numbers

In the attached file, I'm trying to plot 3 vertical lines. One would be dynamic, the other two would be fixed. For now, I used the lines from Insert > Shapes to show what it would look like.

1. Column E has the stock price. This would be dynamic since the user can change the price by clicking the spin button. The line would extend to the top of the graph (500) and to the bottom of the graph (-500).

2. Column F is called "Short Strike." This would be fixed. The line would extend to the top of the graph (500) and to the bottom of the graph (-500). This would have a data label called "Short Put."

3. Column G is called "Long Strike." This would be fixed. The line would extend to the top of the graph (500) and to the bottom of the graph (-500). This would have a data label called "Long Put."

For any given price, I can't figure out how to arrange the table so I can plot the high and low values.

I would also like to display the x-axis at the very bottom of the graph below the Y-value of -500.
 

Attachments

  • Chandoo.org - Plot Vertical Lines.xlsx
    18.4 KB · Views: 2
Something like this?

After studying your solution for a while, I was able to implement your suggestions. I added some additional features such as two data series (red and green) displayed as an area chart.

There are two issues at this point and I believe they are related somehow to the primary and secondary axis.

1. The black P&L line is bent between 85 and 90. How can I straighten that out like it was before? Changing the chart type from Scatter with Straight Lines to a Line chart doesn't make a difference.

2. The horizontal blue line is the stock price. I can't get that to display vertically from +/- 300 like I did before.
 

Attachments

  • Chandoo.org - Area Chart.xlsx
    740.5 KB · Views: 2
1. You gotta find better value for cell B6,1 which gives 'straight line'
... and after that ... do something with those areas.
BUT ... x-axes should be values with 2.5 steps
With Scatter, this would be smoother!
Why You skipped to write that You 'need' those 'areas' too?
It's always more smoother for Your to send realistic file at once.

2. You should use same logic as You've used with those 85 & 90-lines.
Is this again some homework?
 
Back
Top