Refactor line chart to use base chart pattern