refactored chartConfig into an injectable servive