Java源码示例:com.github.mikephil.charting.data.filter.Approximator
示例1
@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);
}
示例2
@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);
}
示例3
@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);
}
示例4
/**
* 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;
}
示例5
/**
* 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;
}