Fixed silly syntax error
Extracted the method for calculation of origin point
Added the simplest possible logging facilities to the program.

Now it's clear that program halts on the rendering of the chart.