Make chart a class directive