Finding cause and effect correlation in a dataset
Identifying correlation in data is possible with standard statistical tools, and it can be done programmatically. Correlation requires a representative sample, so in a case like the single graph that you show it wouldn't work: you'd probably need at least 20-30 such graphs in order to have a chance to confidently show correlation.
Identifying causation (cause and effect) is much harder. To the best of my knowledge it cannot be done from raw data without any additional knowledge. This is simply because with any dataset, there's no way to know if some external variable plays a causative role in the observations.
The way causation is proved is through a specific experimental setting, i.e. it's the design of the experiment which allows collecting data susceptible to prove causation. A/B testing is a method used for this kind of experiment. Example: suppose we want to test whether new drug A has an effect on outcome B. Design the experiment to observe the response variable B on a representative sample of patients. Randomly split the sample into two subsets: the first one is the control group, they are given a placebo. The second is given drug A. At the end of the experiment one can prove causation if and only if the second group shows a significantly different outcome compared to the control group.