本文整理汇总了Java中com.github.mikephil.charting.animation.Easing类的典型用法代码示例。如果您正苦于以下问题:Java Easing类的具体用法?Java Easing怎么用?Java Easing使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Easing类属于com.github.mikephil.charting.animation包,在下文中一共展示了Easing类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: spin
import com.github.mikephil.charting.animation.Easing; //导入依赖的package包/类
/**
* Applys a spin animation to the Chart.
*
* @param durationmillis
* @param fromangle
* @param toangle
*/
@SuppressLint("NewApi")
public void spin(int durationmillis, float fromangle, float toangle, Easing.EasingOption easing) {
if (android.os.Build.VERSION.SDK_INT < 11)
return;
setRotationAngle(fromangle);
ObjectAnimator spinAnimator = ObjectAnimator.ofFloat(this, "rotationAngle", fromangle,
toangle);
spinAnimator.setDuration(durationmillis);
spinAnimator.setInterpolator(Easing.getEasingFunctionFromOption(easing));
spinAnimator.addUpdateListener(new AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
postInvalidate();
}
});
spinAnimator.start();
}
示例2: setData
import com.github.mikephil.charting.animation.Easing; //导入依赖的package包/类
private void setData() {
RealmResults<RealmDemoData> result = mRealm.where(RealmDemoData.class).findAll();
RealmLineDataSet<RealmDemoData> set = new RealmLineDataSet<RealmDemoData>(result, "xValue", "yValue");
set.setMode(LineDataSet.Mode.CUBIC_BEZIER);
set.setLabel("Realm LineDataSet");
set.setDrawCircleHole(false);
set.setColor(ColorTemplate.rgb("#FF5722"));
set.setCircleColor(ColorTemplate.rgb("#FF5722"));
set.setLineWidth(1.8f);
set.setCircleRadius(3.6f);
ArrayList<ILineDataSet> dataSets = new ArrayList<ILineDataSet>();
dataSets.add(set); // add the dataset
// create a data object with the dataset list
LineData data = new LineData(dataSets);
styleData(data);
// set data
mChart.setData(data);
mChart.animateY(1400, Easing.EasingOption.EaseInOutQuart);
}
示例3: setData
import com.github.mikephil.charting.animation.Easing; //导入依赖的package包/类
private void setData() {
RealmResults<RealmDemoData> result = mRealm.where(RealmDemoData.class).findAll();
RealmBubbleDataSet<RealmDemoData> set = new RealmBubbleDataSet<RealmDemoData>(result, "xValue", "yValue", "bubbleSize");
set.setLabel("Realm BubbleDataSet");
set.setColors(ColorTemplate.COLORFUL_COLORS, 110);
ArrayList<IBubbleDataSet> dataSets = new ArrayList<IBubbleDataSet>();
dataSets.add(set); // add the dataset
// create a data object with the dataset list
BubbleData data = new BubbleData(dataSets);
styleData(data);
// set data
mChart.setData(data);
mChart.animateY(1400, Easing.EasingOption.EaseInOutQuart);
}
示例4: setData
import com.github.mikephil.charting.animation.Easing; //导入依赖的package包/类
private void setData() {
RealmResults<RealmDemoData> result = mRealm.where(RealmDemoData.class).findAll();
//RealmBarDataSet<RealmDemoData> set = new RealmBarDataSet<RealmDemoData>(result, "stackValues", "xIndex"); // normal entries
RealmBarDataSet<RealmDemoData> set = new RealmBarDataSet<RealmDemoData>(result, "xValue", "stackValues", "floatValue"); // stacked entries
set.setColors(new int[]{ColorTemplate.rgb("#8BC34A"), ColorTemplate.rgb("#FFC107"), ColorTemplate.rgb("#9E9E9E")});
set.setLabel("Mobile OS distribution");
set.setStackLabels(new String[]{"iOS", "Android", "Other"});
ArrayList<IBarDataSet> dataSets = new ArrayList<IBarDataSet>();
dataSets.add(set); // add the dataset
// create a data object with the dataset list
BarData data = new BarData(dataSets);
styleData(data);
data.setValueTextColor(Color.WHITE);
// set data
mChart.setData(data);
mChart.animateY(1400, Easing.EasingOption.EaseInOutQuart);
}
示例5: setData
import com.github.mikephil.charting.animation.Easing; //导入依赖的package包/类
private void setData() {
RealmResults<RealmDemoData> result = mRealm.where(RealmDemoData.class).findAll();
RealmCandleDataSet<RealmDemoData> set = new RealmCandleDataSet<RealmDemoData>(result, "xValue", "high", "low", "open", "close");
set.setLabel("Realm CandleDataSet");
set.setShadowColor(Color.DKGRAY);
set.setShadowWidth(0.7f);
set.setDecreasingColor(Color.RED);
set.setDecreasingPaintStyle(Paint.Style.FILL);
set.setIncreasingColor(Color.rgb(122, 242, 84));
set.setIncreasingPaintStyle(Paint.Style.STROKE);
set.setNeutralColor(Color.BLUE);
ArrayList<ICandleDataSet> dataSets = new ArrayList<ICandleDataSet>();
dataSets.add(set); // add the dataset
// create a data object with the dataset list
CandleData data = new CandleData(dataSets);
styleData(data);
// set data
mChart.setData(data);
mChart.animateY(1400, Easing.EasingOption.EaseInOutQuart);
}
示例6: setData
import com.github.mikephil.charting.animation.Easing; //导入依赖的package包/类
private void setData() {
RealmResults<RealmDemoData> result = mRealm.where(RealmDemoData.class).findAll();
RealmScatterDataSet<RealmDemoData> set = new RealmScatterDataSet<RealmDemoData>(result, "xValue", "yValue");
set.setLabel("Realm ScatterDataSet");
set.setScatterShapeSize(9f);
set.setColor(ColorTemplate.rgb("#CDDC39"));
set.setScatterShape(ScatterChart.ScatterShape.CIRCLE);
ArrayList<IScatterDataSet> dataSets = new ArrayList<IScatterDataSet>();
dataSets.add(set); // add the dataset
// create a data object with the dataset list
ScatterData data = new ScatterData(dataSets);
styleData(data);
// set data
mChart.setData(data);
mChart.animateY(1400, Easing.EasingOption.EaseInOutQuart);
}
示例7: setData
import com.github.mikephil.charting.animation.Easing; //导入依赖的package包/类
private void setData() {
RealmResults<RealmDemoData> result = mRealm.where(RealmDemoData.class).findAll();
//RealmBarDataSet<RealmDemoData> set = new RealmBarDataSet<RealmDemoData>(result, "stackValues", "xIndex"); // normal entries
RealmBarDataSet<RealmDemoData> set = new RealmBarDataSet<RealmDemoData>(result, "xValue", "yValue"); // stacked entries
set.setColors(new int[] {ColorTemplate.rgb("#FF5722"), ColorTemplate.rgb("#03A9F4")});
set.setLabel("Realm BarDataSet");
ArrayList<IBarDataSet> dataSets = new ArrayList<IBarDataSet>();
dataSets.add(set); // add the dataset
// create a data object with the dataset list
BarData data = new BarData(dataSets);
styleData(data);
// set data
mChart.setData(data);
mChart.setFitBars(true);
mChart.animateY(1400, Easing.EasingOption.EaseInOutQuart);
}
示例8: bindActivityChart
import com.github.mikephil.charting.animation.Easing; //导入依赖的package包/类
private void bindActivityChart() {
LineData lineData = generateActivityLineData();
lineChart.setData(lineData);
int maxYData = (int) (Math.ceil(lineData.getYMax()) + 7200);
lineChart.getAxisLeft().setAxisMaximum(maxYData);
long referenceTime = new DateTime(stats.endDate).minusDays(6).getMillis();
lineChart.getXAxis()
.setValueFormatter(new FormatUtils().getBarXAxisValueFormatterInstance(referenceTime));
CustomMarkerView customMarkerView = new CustomMarkerView(context, R.layout.marker_view, referenceTime);
lineChart.setMarker(customMarkerView);
customMarkerView.setChartView(lineChart);
lineChart.animateX(1500, Easing.EasingOption.Linear);
}
示例9: updateChart
import com.github.mikephil.charting.animation.Easing; //导入依赖的package包/类
/**
* Called when the chart statistics loader has completed loading the chart data. The loader
* listens for changes to the data and this method will be called each time the display of the
* chart needs to be refreshed. If this fragment has no view, no update will be attempted.
*
* @param chartStats The chart statistics populated by the loader.
*/
private void updateChart(ChartStatistics chartStats) {
if (DEBUG_ME) Log.d(TAG, "updateChart()");
if (getView() == null) {
// Must have arrived after "onDestroyView" was called, so do nothing.
return;
}
// Add all times line, best times line, average-of-N times lines (with highlighted
// best AoN times) and mean limit line and identify them all using a custom legend.
chartStats.applyTo(lineChartView);
// Animate and refresh the chart.
lineChartView.animateY(700, Easing.EasingOption.EaseInOutSine);
}
示例10: setData
import com.github.mikephil.charting.animation.Easing; //导入依赖的package包/类
private void setData() {
RealmResults<RealmDemoData> result = mRealm.allObjects(RealmDemoData.class);
RealmLineDataSet<RealmDemoData> set = new RealmLineDataSet<RealmDemoData>(result, "value", "xIndex");
// set.setDrawCubic(false);
set.setLabel("次数");
// set.setDrawCircleHole(false);
set.setColor(getResourcesColor(R.color.gold));
set.setCircleColor(getResourcesColor(R.color.gold));
set.setHighLightColor(Color.WHITE);
set.setLineWidth(1.8f);
set.setCircleSize(3.6f);
set.setValueTextColor(Color.WHITE);
ArrayList<ILineDataSet> dataSets = new ArrayList<ILineDataSet>();
dataSets.add(set); // add the dataset
// create a data object with the dataset list
RealmLineData data = new RealmLineData(result, "xValue", dataSets);
styleData(data);
// set data
mChart.setData(data);
mChart.animateY(1400, Easing.EasingOption.EaseInOutQuart);
}
示例11: initLine
import com.github.mikephil.charting.animation.Easing; //导入依赖的package包/类
/**
* 初始化线
*/
private void initLine() {
RealmResults<RealmDemoData> result = mRealm.allObjects(RealmDemoData.class);
RealmLineDataSet<RealmDemoData> set = new RealmLineDataSet<RealmDemoData>(result, "value", "xIndex");
set.setLabel("次数");
set.setColor(getResourcesColor(R.color.gold));
set.setCircleColor(getResourcesColor(R.color.gold));
set.setHighLightColor(Color.WHITE);
set.setLineWidth(1.8f);
set.setCircleSize(3.6f);
set.setValueTextColor(Color.WHITE);
ArrayList<ILineDataSet> dataSets = new ArrayList<ILineDataSet>();
dataSets.add(set); // add the dataset
RealmLineData data = new RealmLineData(result, "xValue", dataSets);
styleData(data);
mChart.setData(data);
mChart.animateY(1400, Easing.EasingOption.EaseInOutQuart);
}
示例12: spin
import com.github.mikephil.charting.animation.Easing; //导入依赖的package包/类
/**
* Applys a spin animation to the Chart.
*
* @param durationmillis
* @param fromangle
* @param toangle
*/
@SuppressLint("NewApi")
public void spin(int durationmillis, float fromangle, float toangle, Easing.EasingOption easing) {
if (android.os.Build.VERSION.SDK_INT < 11)
return;
setRotationAngle(fromangle);
ObjectAnimator spinAnimator = ObjectAnimator.ofFloat(this, "rotationAngle", fromangle,
toangle);
spinAnimator.setDuration(durationmillis);
spinAnimator.setInterpolator(Easing.getEasingFunctionFromOption(easing));
spinAnimator.addUpdateListener(new AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
postInvalidate();
}
});
spinAnimator.start();
}
示例13: setData
import com.github.mikephil.charting.animation.Easing; //导入依赖的package包/类
private void setData() {
RealmResults<RealmDemoData> result = mRealm.allObjects(RealmDemoData.class);
RealmLineDataSet<RealmDemoData> set = new RealmLineDataSet<RealmDemoData>(result, "value", "xIndex");
set.setDrawCubic(false);
set.setLabel("Realm LineDataSet");
set.setDrawCircleHole(false);
set.setColor(ColorTemplate.rgb("#FF5722"));
set.setCircleColor(ColorTemplate.rgb("#FF5722"));
set.setLineWidth(1.8f);
set.setCircleSize(3.6f);
ArrayList<ILineDataSet> dataSets = new ArrayList<ILineDataSet>();
dataSets.add(set); // add the dataset
// create a data object with the dataset list
RealmLineData data = new RealmLineData(result, "xValue", dataSets);
styleData(data);
// set data
mChart.setData(data);
mChart.animateY(1400, Easing.EasingOption.EaseInOutQuart);
}
示例14: setData
import com.github.mikephil.charting.animation.Easing; //导入依赖的package包/类
private void setData() {
RealmResults<RealmDemoData> result = mRealm.allObjects(RealmDemoData.class);
RealmBubbleDataSet<RealmDemoData> set = new RealmBubbleDataSet<RealmDemoData>(result, "value", "xIndex", "bubbleSize");
set.setLabel("Realm BubbleDataSet");
set.setColors(ColorTemplate.COLORFUL_COLORS, 110);
ArrayList<IBubbleDataSet> dataSets = new ArrayList<IBubbleDataSet>();
dataSets.add(set); // add the dataset
// create a data object with the dataset list
RealmBubbleData data = new RealmBubbleData(result, "xValue", dataSets);
styleData(data);
// set data
mChart.setData(data);
mChart.animateY(1400, Easing.EasingOption.EaseInOutQuart);
}
示例15: setData
import com.github.mikephil.charting.animation.Easing; //导入依赖的package包/类
private void setData() {
RealmResults<RealmDemoData> result = mRealm.allObjects(RealmDemoData.class);
//RealmBarDataSet<RealmDemoData> set = new RealmBarDataSet<RealmDemoData>(result, "stackValues", "xIndex"); // normal entries
RealmBarDataSet<RealmDemoData> set = new RealmBarDataSet<RealmDemoData>(result, "stackValues", "xIndex", "floatValue"); // stacked entries
set.setColors(new int[]{ColorTemplate.rgb("#8BC34A"), ColorTemplate.rgb("#FFC107"), ColorTemplate.rgb("#9E9E9E")});
set.setLabel("Mobile OS distribution");
set.setStackLabels(new String[]{"iOS", "Android", "Other"});
ArrayList<IBarDataSet> dataSets = new ArrayList<IBarDataSet>();
dataSets.add(set); // add the dataset
// create a data object with the dataset list
RealmBarData data = new RealmBarData(result, "xValue", dataSets);
styleData(data);
data.setValueTextColor(Color.WHITE);
// set data
mChart.setData(data);
mChart.animateY(1400, Easing.EasingOption.EaseInOutQuart);
}