code: function partitionValueToIndex (partition, value) {
    var group;
  
    if (!partition) {
      // no(sub)partitioning return first element
      return 0;
    }
  
    // with (sub)partitioning
    group = partition.groups.get(value, 'value');
  
    if (group) {
      // string in partition
      return group.groupIndex;
    } else {
      // string not in partition
      return -1;
    }
  }
docs: Get the index in chartjs datastructures from the group value
  with proper fallbacks
  @params {Partition} partition (optional)
  @params {Object} value value
  @returns {number|null} index