本文整理汇总了Java中com.github.mikephil.charting.data.LineDataSet.Mode方法的典型用法代码示例。如果您正苦于以下问题:Java LineDataSet.Mode方法的具体用法?Java LineDataSet.Mode怎么用?Java LineDataSet.Mode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.mikephil.charting.data.LineDataSet
的用法示例。
在下文中一共展示了LineDataSet.Mode方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getReactionTimeInPercentageLineData
import com.github.mikephil.charting.data.LineDataSet; //导入方法依赖的package包/类
/**
* Get combined line data to be displayed in the line chart
*
* @return combined line data to be displayed in the line chart
*/
@NonNull
private LineData getReactionTimeInPercentageLineData() {
// get selected user
String userId = Global.getSelectedUser();
UtilsRG.debug("selected user!: " + userId);
// get percentage medians by user
final Double[] reactionTimesInPercentage = getReactionGameMedians(userId);
// get predicted median in percentage
final Double[] reactionTimesForecastInPercentage = getNextForecastReactionMedianInPercentage();
// fill reaction times
List<Entry> entries = new ArrayList<>();
for (int i = 0; i < reactionTimesInPercentage.length; i++) {
entries.add(new Entry(i, reactionTimesInPercentage[i].intValue()));
}
// fill forecast
List<Entry> entriesForecast = new ArrayList<>();
entriesForecast.add(new Entry(reactionTimesInPercentage.length - 1, reactionTimesInPercentage[reactionTimesInPercentage.length - 1].intValue()));
for (int i = 0; i < reactionTimesForecastInPercentage.length; i++) {
entriesForecast.add(new Entry(reactionTimesInPercentage.length + i, reactionTimesForecastInPercentage[i].intValue()));
}
// curved line
LineDataSet.Mode lineMode = LineDataSet.Mode.HORIZONTAL_BEZIER;
// reaction time in percentage data set
LineDataSet dataSet = new LineDataSet(entries, Strings.getStringByRId(R.string.forecast_performance));
dataSet.setMode(lineMode);
dataSet = setLineDataStyling(dataSet, R.color.colorPrimary);
// reaction time forecast in percentage data set
LineDataSet dataSetForecast = new LineDataSet(entriesForecast, Strings.getStringByRId(R.string.forecast_performance));
dataSetForecast.setMode(lineMode);
dataSetForecast = setLineDataStyling(dataSetForecast, R.color.colorPrimaryLight);
dataSetForecast.enableDashedLine(10, 10, 1000);
// combine data sets
LineData lineData = new LineData(dataSet, dataSetForecast);
lineData.setValueFormatter(new BarChartPercentFormatter());
lineData.setValueTextSize(15f);
return lineData;
}
示例2: getMode
import com.github.mikephil.charting.data.LineDataSet; //导入方法依赖的package包/类
/**
* Returns the drawing mode for this line dataset
*
* @return
*/
LineDataSet.Mode getMode();
示例3: getMode
import com.github.mikephil.charting.data.LineDataSet; //导入方法依赖的package包/类
/**
* Returns the drawing mode for this line dataset
*
* @return
*/
@Override
public LineDataSet.Mode getMode() {
return mMode;
}
示例4: setMode
import com.github.mikephil.charting.data.LineDataSet; //导入方法依赖的package包/类
/**
* Returns the drawing mode for this line dataset
*
* @return
*/
public void setMode(LineDataSet.Mode mode) {
mMode = mode;
}