Adding additional data points to a line graph to create a vertical join

I have created the below chart in a vb.net windows form and I am exporting to Excel.  All works fine except the green and blue lines that are vertical do not go vertically in the Excel spreadsheet, the go diagonally to the next entry point (as you would expect for a line graph). 

I would like to know if it is possible to add additional data points to the Excel chart to enable me to re-create the vertical lines shown in the screenshot?

Just to clarify, I am referring to a vertical line for the plotted data (blue and green in my screenshot), not the StripLine object(in pink on my screenshot).

Sorry if I haven't explained this very well but if you need any more info please let me know.

Thanks
Garry

February 11th, 2015 6:31pm

Hello,

if the X axis labels of a line axis are numeric, you can format the axis to be a date axis instead of a text axis. 

A text axis plots each value in a new category, on a date axis the numeric values are slotted with regards to their actual value. Compare text axis (above) and date axis (below). Both charts are line charts. 


You can, of course use a Scatter Chart instead of a line chart. Format the series to have only lines, no markers. 

Free Windows Admin Tool Kit Click here and download it now
February 11th, 2015 7:01pm

Hi Teylyn,

I have changed the axis type to Date but the line does not replicate the vertical pattern shown in your second screenshot, am I doing something wrong?


Also, I would need the red line to continue to be displayed as it is in my first screenshot (i.e. not be vertical).  Would this change affect all data lines?

Thanks for your help
Garry


February 13th, 2015 4:17pm

For a vertical line you need two different Y values at the same X position. See the sample data in my screenshot above.
Free Windows Admin Tool Kit Click here and download it now
February 13th, 2015 4:48pm

Teylyn, you're a chart legend!

It's now working perfectly, thanks for your help (and hope you got the chart legend pun!)

Thanks
Garry

  • Marked as answer by ResourceBox 10 hours 39 minutes ago
February 13th, 2015 8:14pm

Thanks for the feedback. You marked you "thank you" comment as the answer. Can you please undo that and mark my post as the answer? Thanks. 
Free Windows Admin Tool Kit Click here and download it now
February 13th, 2015 8:16pm

Hi Teylyn,

I have changed the axis type to Date but the line does not replicate the vertical pattern shown in your second screenshot, am I doing something wrong?


Also, I would need the red line to continue to be displayed as it is in my first screenshot (i.e. not be vertical).  Would this change affect all data lines?

Thanks for your help
Garry


  • Edited by ResourceBox Friday, February 13, 2015 9:17 PM typo
February 14th, 2015 12:16am

Teylyn, you're a chart legend!

It's now working perfectly, thanks for your help (and hope you got the chart legend pun!)

Thanks
Garry

  • Marked as answer by ResourceBox Saturday, February 14, 2015 1:13 AM
Free Windows Admin Tool Kit Click here and download it now
February 14th, 2015 4:13am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics