com.github.mikephil.charting.data.filter.Approximator Java Examples

The following examples show how to use com.github.mikephil.charting.data.filter.Approximator. 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: ApproximatorTest.java    From StockChart-MPAndroidChart with MIT License 6 votes vote down vote up
@Test
public void testApproximation() {

    float[] points = new float[]{
            10, 20,
            20, 30,
            25, 25,
            30, 28,
            31, 31,
            33, 33,
            40, 40,
            44, 40,
            48, 23,
            50, 20,
            55, 20,
            60, 25};

    assertEquals(24, points.length);

    Approximator a = new Approximator();

    float[] reduced = a.reduceWithDouglasPeucker(points, 2);

    assertEquals(18, reduced.length);
}
 
Example #2
Source File: ApproximatorTest.java    From Ticket-Analysis with MIT License 6 votes vote down vote up
@Test
public void testApproximation() {

    float[] points = new float[]{
            10, 20,
            20, 30,
            25, 25,
            30, 28,
            31, 31,
            33, 33,
            40, 40,
            44, 40,
            48, 23,
            50, 20,
            55, 20,
            60, 25};

    assertEquals(24, points.length);

    Approximator a = new Approximator();

    float[] reduced = a.reduceWithDouglasPeucker(points, 2);

    assertEquals(18, reduced.length);
}
 
Example #3
Source File: ApproximatorTest.java    From android-kline with Apache License 2.0 6 votes vote down vote up
@Test
public void testApproximation() {

    float[] points = new float[]{
            10, 20,
            20, 30,
            25, 25,
            30, 28,
            31, 31,
            33, 33,
            40, 40,
            44, 40,
            48, 23,
            50, 20,
            55, 20,
            60, 25};

    assertEquals(24, points.length);

    Approximator a = new Approximator();

    float[] reduced = a.reduceWithDouglasPeucker(points, 2);

    assertEquals(18, reduced.length);
}
 
Example #4
Source File: BarLineChartBase.java    From iMoney with Apache License 2.0 2 votes vote down vote up
/**
 * Enables data filtering for the chart data, filtering will use the user
 * customized Approximator handed over to this method.
 * 
 * @param a
 */
public void enableFiltering(Approximator a) {
    mFilterData = true;
    // mApproximator = a;
}
 
Example #5
Source File: BarLineChartBase.java    From Notification-Analyser with MIT License 2 votes vote down vote up
/**
 * Enables data filtering for the chart data, filtering will use the user
 * customized Approximator handed over to this method.
 * 
 * @param a
 */
public void enableFiltering(Approximator a) {
    mFilterData = true;
    // mApproximator = a;
}