Esempio n. 1
0
 /**
  * This method sets the automatically computed labels for the legend. Use setCustom(...) to set
  * custom labels.
  *
  * @param labels
  */
 public void setComputedLabels(List<String> labels) {
   if (mLabels != null && mLabels.length == labels.size()) {
     Utils.copyStrings(labels, mLabels);
   } else {
     mLabels = Utils.convertStrings(labels);
   }
 }
Esempio n. 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);
    }
  }