本文整理匯總了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;
}