How can I draw a graph like this in a computer program?

Solution 1:

This can be easily accomplished in Excel. All you need to do is use your data to create an XY/Scatter Chart and then format as appropriate. Using the Scatter Chart, your horizontal values will be proportionally accurate. You can also use vertical error bars to replace your markers (dots). And Excel now allows you to use a range of cells for labels, so you can have your Event labels (or whatever else you choose) as part of the chart. You can also completely remove the vertical axis if you'd like (since it's redundant).

  1. Create your data table (i.e. an Excel table, created using Insert>Tables>Table).
    enter image description here

  2. Create a blank XY/Scatter chart (do this by Insert>Charts>Scatter while you have a blank cell on the worksheet selected)

  3. Select data for your chart (with chart selected, right-click and choose Select Data from context menu). Name: Anything you like
    Series X: your X column
    Series Y: your Y column

  4. Format as desired. To match your sample, I did the following: Changed Y axis (removed labels, changed max value)
    Changed X axis (removed labels)
    Changed series (add data labels, add vertical error bars (for lines), turn off markers)

  5. Here's the final version: enter image description here

Solution 2:

Could you provide a sample about your problem?

In Excel Chart, you can use Data Labels to help display values: enter image description here