Vanilla js for the chart option