refactoring charts to js, some specs