code: function cleanData(data) {
              hasQuantities = data.filter(hasQuantity).length === data.length;
  
              return data
                  .reduce((acc, d) => {
                      if (d.quantity !== undefined && d.quantity !== null) {
                          d.quantity = +d.quantity;
                      }
                      d.name = String(d.name);
                      d.id = +d.id;
  
                      return [...acc, d];
                  }, []);
          }
docs: Makes sure the types of the data are right and checks if it has quantities
  @param {LegendChartData} data
  @private