Exemple #1
0
 /**
  * This method sets the automatically computed colors for the legend. Use setCustom(...) to set
  * custom colors.
  *
  * @param colors
  */
 public void setComputedColors(List<Integer> colors) {
   if (mColors != null && colors.size() == mColors.length) {
     Utils.copyIntegers(colors, mColors);
   } else {
     mColors = Utils.convertIntegers(colors);
   }
 }
Exemple #2
0
  /**
   * Colors and labels that will be appended to the end of the auto calculated colors and labels
   * arrays after calculating the legend. (if the legend has already been calculated, you will need
   * to call notifyDataSetChanged() to let the changes take effect)
   */
  public void setExtra(List<Integer> colors, List<String> labels) {
    if (mExtraColors != null && mExtraColors.length == colors.size()) {
      Utils.copyIntegers(colors, mExtraColors);
    } else {
      this.mExtraColors = Utils.convertIntegers(colors);
    }

    if (mExtraLabels != null && mExtraLabels.length == labels.size()) {
      Utils.copyStrings(labels, mExtraLabels);
    } else {
      this.mExtraLabels = Utils.convertStrings(labels);
    }
  }