fix evaluating of chart margin