Visualizing open tasks
In this section, we will create a line chart component using Chartist, which will display the open task progress of projects over time. To do this, we'll use a line chart with a specific interpolation that provides quantized steps, rather than lines with directly connected points.
We will also provide some interactivity, so that the user will be able to switch the displayed timeframe by using a toggle button. This will allow us to reuse the toggle UI component that we created in Chapter 2, Ready, Set, Go!
Preparing task data
First, let's look at the data that we have available in our system, when it comes to project tasks. The created
attribute is set to the timestamp at the moment when the task was created. If a task is marked as done, however, we currently don't save the timestamp of that moment. In order to produce the chart that we're looking for, we will need to know when a task was completed.
Let's introduce a new property on our task model for this purpose. Open...