Displaying calendar event count onto a bar chart

I’m trying to keep count of how many times a user either jogs and/or walks in a month. On the calendar the event will display, example - ‘jogged (x) miles’ and the event color will be ‘brown’, and for example- ‘walked (x) miles’ the color will be ‘green’. Is there a way to store walked and jogged quantities in a placeholder by either a count or color type and then display those amounts per month on a bar chart? I went over the lesson video but it only shows how to display these data points when a user inputs them into input elements. I have one input box for miles and two buttons a. walk, b. jog, with the colors listed above, that when pressed will store the input and corresponding color on the calendar. Thanks.