Java Code Examples for com.github.mikephil.charting.utils.Utils#convertIntegers()

The following examples show how to use com.github.mikephil.charting.utils.Utils#convertIntegers() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Legend.java    From iMoney with Apache License 2.0 6 votes vote down vote up
/**
 * Constructor. Provide colors and labels for the legend.
 * 
 * @param colors
 * @param labels
 */
public Legend(List<Integer> colors, List<String> labels) {
    this();

    if (colors == null || labels == null) {
        throw new IllegalArgumentException("colors array or labels array is NULL");
    }

    if (colors.size() != labels.size()) {
        throw new IllegalArgumentException(
                "colors array and labels array need to be of same size");
    }

    this.mColors = Utils.convertIntegers(colors);
    this.mLabels = Utils.convertStrings(labels);
}
 
Example 2
Source File: Legend.java    From Stayfit with Apache License 2.0 6 votes vote down vote up
/**
 * Constructor. Provide colors and labels for the legend.
 * 
 * @param colors
 * @param labels
 */
public Legend(List<Integer> colors, List<String> labels) {
    this();

    if (colors == null || labels == null) {
        throw new IllegalArgumentException("colors array or labels array is NULL");
    }

    if (colors.size() != labels.size()) {
        throw new IllegalArgumentException(
                "colors array and labels array need to be of same size");
    }

    this.mColors = Utils.convertIntegers(colors);
    this.mLabels = Utils.convertStrings(labels);
}
 
Example 3
Source File: Legend.java    From NetKnight with Apache License 2.0 6 votes vote down vote up
/**
 * Constructor. Provide colors and labels for the legend.
 * 
 * @param colors
 * @param labels
 */
public Legend(List<Integer> colors, List<String> labels) {
    this();

    if (colors == null || labels == null) {
        throw new IllegalArgumentException("colors array or labels array is NULL");
    }

    if (colors.size() != labels.size()) {
        throw new IllegalArgumentException(
                "colors array and labels array need to be of same size");
    }

    this.mColors = Utils.convertIntegers(colors);
    this.mLabels = Utils.convertStrings(labels);
}
 
Example 4
Source File: Chart.java    From StockChart-MPAndroidChart with MIT License 5 votes vote down vote up
public void setDescriptionCustom(List<Integer> colors, List<String> labels) {

        if (colors.size() != labels.size()) {
            throw new IllegalArgumentException(
                    "colors array and labels array need to be of same size");
        }

        mDescriptionColors = Utils.convertIntegers(colors);
        mDescriptionLabels = Utils.convertStrings(labels);
        mIsDescriptionCustom = true;
    }
 
Example 5
Source File: Legend.java    From iMoney with Apache License 2.0 5 votes vote down vote up
/**
 * Sets a custom legend's labels and colors arrays. The colors count should
 * match the labels count. * Each color is for the form drawn at the same
 * index. * A null label will start a group. * A ColorTemplate.COLOR_SKIP
 * color will avoid drawing a form This will disable the feature that
 * automatically calculates the legend labels and colors from the datasets.
 * Call resetCustom() to re-enable automatic calculation (and then
 * notifyDataSetChanged() is needed to auto-calculate the legend again)
 */
public void setCustom(List<Integer> colors, List<String> labels) {

    if (colors.size() != labels.size()) {
        throw new IllegalArgumentException(
                "colors array and labels array need to be of same size");
    }

    mColors = Utils.convertIntegers(colors);
    mLabels = Utils.convertStrings(labels);
    mIsLegendCustom = true;
}
 
Example 6
Source File: Legend.java    From Stayfit with Apache License 2.0 5 votes vote down vote up
/**
 * Sets a custom legend's labels and colors arrays. The colors count should
 * match the labels count. * Each color is for the form drawn at the same
 * index. * A null label will start a group. * A ColorTemplate.COLOR_SKIP
 * color will avoid drawing a form This will disable the feature that
 * automatically calculates the legend labels and colors from the datasets.
 * Call resetCustom() to re-enable automatic calculation (and then
 * notifyDataSetChanged() is needed to auto-calculate the legend again)
 */
public void setCustom(List<Integer> colors, List<String> labels) {

    if (colors.size() != labels.size()) {
        throw new IllegalArgumentException(
                "colors array and labels array need to be of same size");
    }

    mColors = Utils.convertIntegers(colors);
    mLabels = Utils.convertStrings(labels);
    mIsLegendCustom = true;
}
 
Example 7
Source File: Legend.java    From NetKnight with Apache License 2.0 5 votes vote down vote up
/**
 * Sets a custom legend's labels and colors arrays. The colors count should
 * match the labels count. * Each color is for the form drawn at the same
 * index. * A null label will start a group. * A ColorTemplate.COLOR_SKIP
 * color will avoid drawing a form This will disable the feature that
 * automatically calculates the legend labels and colors from the datasets.
 * Call resetCustom() to re-enable automatic calculation (and then
 * notifyDataSetChanged() is needed to auto-calculate the legend again)
 */
public void setCustom(List<Integer> colors, List<String> labels) {

    if (colors.size() != labels.size()) {
        throw new IllegalArgumentException(
                "colors array and labels array need to be of same size");
    }

    mColors = Utils.convertIntegers(colors);
    mLabels = Utils.convertStrings(labels);
    mIsLegendCustom = true;
}
 
Example 8
Source File: Legend.java    From Ticket-Analysis with MIT License 4 votes vote down vote up
@Deprecated
public Legend(List<Integer> colors, List<String> labels) {
    this(Utils.convertIntegers(colors), Utils.convertStrings(labels));
}
 
Example 9
Source File: Legend.java    From android-kline with Apache License 2.0 4 votes vote down vote up
@Deprecated
public Legend(List<Integer> colors, List<String> labels) {
    this(Utils.convertIntegers(colors), Utils.convertStrings(labels));
}
 
Example 10
Source File: Legend.java    From iMoney with Apache License 2.0 2 votes vote down vote up
/**
 * This method sets the automatically computed colors for the legend. Use setCustom(...) to set custom colors.
 * @param colors
 */
public void setComputedColors(List<Integer> colors) {
    mColors = Utils.convertIntegers(colors);
}
 
Example 11
Source File: Legend.java    From iMoney with Apache License 2.0 2 votes vote down vote up
/**
 * 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) {
    this.mExtraColors = Utils.convertIntegers(colors);
    this.mExtraLabels = Utils.convertStrings(labels);
}
 
Example 12
Source File: Legend.java    From Stayfit with Apache License 2.0 2 votes vote down vote up
/**
 * This method sets the automatically computed colors for the legend. Use setCustom(...) to set custom colors.
 * @param colors
 */
public void setComputedColors(List<Integer> colors) {
    mColors = Utils.convertIntegers(colors);
}
 
Example 13
Source File: Legend.java    From Stayfit with Apache License 2.0 2 votes vote down vote up
/**
 * 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) {
    this.mExtraColors = Utils.convertIntegers(colors);
    this.mExtraLabels = Utils.convertStrings(labels);
}
 
Example 14
Source File: Legend.java    From NetKnight with Apache License 2.0 2 votes vote down vote up
/**
 * This method sets the automatically computed colors for the legend. Use setCustom(...) to set custom colors.
 * @param colors
 */
public void setComputedColors(List<Integer> colors) {
    mColors = Utils.convertIntegers(colors);
}
 
Example 15
Source File: Legend.java    From NetKnight with Apache License 2.0 2 votes vote down vote up
/**
 * 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) {
    this.mExtraColors = Utils.convertIntegers(colors);
    this.mExtraLabels = Utils.convertStrings(labels);
}