chart.apis.google.com/chart gives a security certificate error

Use https://chart.googleapis.com/chart instead, with the same parameters.