// Path: library/src/main/java/com/linheimx/app/library/utils/Utils.java
// public class Utils {
// 
//     public static float dp2px(float dp) {
//         return (int) (dp * Resources.getSystem().getDisplayMetrics().density);
//     }
//     
//     public static float textWidth(Paint paint, String txt) {
//         return paint.measureText(txt);
//     }
// 
//     private static Paint.FontMetrics mFontMetrics = new Paint.FontMetrics();
// 
//     public static int textHeightAsc(Paint paint) {
//         paint.getFontMetrics(mFontMetrics);
//         return (int) (Math.abs(mFontMetrics.ascent));
//     }
// 
//     public static int textHeight(Paint paint) {
//         paint.getFontMetrics(mFontMetrics);
//         return (int) (Math.abs(mFontMetrics.ascent) + Math.abs(mFontMetrics.descent));
//     }
// 
//     /**
//      * 将杂乱的数字变成里程碑。
//      *
//      * @param number
//      * @return
//      */
//     public static float roundNumber2One(double number) {
//         if (Double.isInfinite(number) ||
//                 Double.isNaN(number) ||
//                 number == 0.0)
//             return 0;
// 
//         final float d = (float) Math.ceil((float) Math.log10(number < 0 ? -number : number));//有几位？
//         final int pw = 1 - (int) d;
//         final float magnitude = (float) Math.pow(10, pw);
//         final long shifted = Math.round(number * magnitude);
//         return shifted / magnitude;
//     }
// 
// 
// }


import android.graphics.Color;
import com.linheimx.app.library.utils.Utils;
import java.util.ArrayList;
import java.util.List;
package com.linheimx.app.library.data;




/**
 * Created by Administrator on 2016/11/13.
 */

public class Line {

    private List<Entry> entries = new ArrayList<>();


    private double mYMax = Double.MIN_VALUE;
    private double mYMin = Double.MAX_VALUE;
    private double mXMax = Double.MIN_VALUE;
    private double mXMin = Double.MAX_VALUE;

    private int lineColor = Color.BLACK;
    private int lineWidth = 1;
    private int circleColor = Color.RED;
    private int circleR = 4;

    private boolean isFilled = false;
    private int lineAlpha = 50;

    private boolean isEnable = true;
    private boolean isDrawCircle = true;
    private boolean isDrawLegend = false;
    private int legendWidth = 50;
    private int legendHeight = 17;
    private int legendTextSize = 8;
    private String name = "line";

    private CallBack_OnEntryClick onEntryClick;

    public Line() {
        this(null);
    }

    public Line(List<Entry> entries) {

// Path: library/src/main/java/com/linheimx/app/library/utils/Utils.java
// public class Utils {
// 
//     public static float dp2px(float dp) {
//         return (int) (dp * Resources.getSystem().getDisplayMetrics().density);
//     }
//     
//     public static float textWidth(Paint paint, String txt) {
//         return paint.measureText(txt);
//     }
// 
//     private static Paint.FontMetrics mFontMetrics = new Paint.FontMetrics();
// 
//     public static int textHeightAsc(Paint paint) {
//         paint.getFontMetrics(mFontMetrics);
//         return (int) (Math.abs(mFontMetrics.ascent));
//     }
// 
//     public static int textHeight(Paint paint) {
//         paint.getFontMetrics(mFontMetrics);
//         return (int) (Math.abs(mFontMetrics.ascent) + Math.abs(mFontMetrics.descent));
//     }
// 
//     /**
//      * 将杂乱的数字变成里程碑。
//      *
//      * @param number
//      * @return
//      */
//     public static float roundNumber2One(double number) {
//         if (Double.isInfinite(number) ||
//                 Double.isNaN(number) ||
//                 number == 0.0)
//             return 0;
// 
//         final float d = (float) Math.ceil((float) Math.log10(number < 0 ? -number : number));//有几位？
//         final int pw = 1 - (int) d;
//         final float magnitude = (float) Math.pow(10, pw);
//         final long shifted = Math.round(number * magnitude);
//         return shifted / magnitude;
//     }
// 
// 
// }


// Path: library/src/main/java/com/linheimx/app/library/data/Line.java
import android.graphics.Color;
import com.linheimx.app.library.utils.Utils;
import java.util.ArrayList;
import java.util.List;

package com.linheimx.app.library.data;




/**
 * Created by Administrator on 2016/11/13.
 */

public class Line {

    private List<Entry> entries = new ArrayList<>();


    private double mYMax = Double.MIN_VALUE;
    private double mYMin = Double.MAX_VALUE;
    private double mXMax = Double.MIN_VALUE;
    private double mXMin = Double.MAX_VALUE;

    private int lineColor = Color.BLACK;
    private int lineWidth = 1;
    private int circleColor = Color.RED;
    private int circleR = 4;

    private boolean isFilled = false;
    private int lineAlpha = 50;

    private boolean isEnable = true;
    private boolean isDrawCircle = true;
    private boolean isDrawLegend = false;
    private int legendWidth = 50;
    private int legendHeight = 17;
    private int legendTextSize = 8;
    private String name = "line";

    private CallBack_OnEntryClick onEntryClick;

    public Line() {
        this(null);
    }

    public Line(List<Entry> entries) {

        circleR = (int) Utils.dp2px(circleR);