crude working version with a start to making chart a reusable component
fix error where data was accumulating in error.bar.js