code: function (value, legend) {
              for (var i = 0; i < legend.slices.length; ++i) {
                  if ((legend.slices[i].sliceValue !== undefined && value === legend.slices[i].sliceValue) ||
                      ((legend.slices[i].sliceValue === undefined) &&
                          (legend.slices[i].min === undefined || value >= legend.slices[i].min) &&
                          (legend.slices[i].max === undefined || value <= legend.slices[i].max))
                  ) {
                      return legend.slices[i];
                  }
              }
              return {};
          }
docs: /*
  Get the legend conf matching with the value
  @param value the value to match with a slice in the legend
  @param legend the legend params object
  @return the legend slice matching with the value