From time series to complex networks: The visibility graph