Refactored switchableLineChart