本文整理匯總了Java中com.github.mikephil.charting.data.LineDataSet.setValueTextSize方法的典型用法代碼示例。如果您正苦於以下問題:Java LineDataSet.setValueTextSize方法的具體用法?Java LineDataSet.setValueTextSize怎麽用?Java LineDataSet.setValueTextSize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.github.mikephil.charting.data.LineDataSet
的用法示例。
在下文中一共展示了LineDataSet.setValueTextSize方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: generateLineData
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private LineData generateLineData() {
LineData d = new LineData();
ArrayList<Entry> entries = new ArrayList<Entry>();
for (int index = 0; index < itemcount; index++)
entries.add(new Entry(index + 0.5f, getRandom(15, 5)));
LineDataSet set = new LineDataSet(entries, "Line DataSet");
set.setColor(Color.rgb(240, 238, 70));
set.setLineWidth(2.5f);
set.setCircleColor(Color.rgb(240, 238, 70));
set.setCircleRadius(5f);
set.setFillColor(Color.rgb(240, 238, 70));
set.setMode(LineDataSet.Mode.CUBIC_BEZIER);
set.setDrawValues(true);
set.setValueTextSize(10f);
set.setValueTextColor(Color.rgb(240, 238, 70));
set.setAxisDependency(YAxis.AxisDependency.LEFT);
d.addDataSet(set);
return d;
}
示例2: createSet
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private LineDataSet createSet() {
LineDataSet set = new LineDataSet(null, "Dynamic Data");
set.setAxisDependency(AxisDependency.LEFT);
set.setColor(ColorTemplate.getHoloBlue());
set.setCircleColor(Color.WHITE);
set.setLineWidth(2f);
set.setCircleRadius(4f);
set.setFillAlpha(65);
set.setFillColor(ColorTemplate.getHoloBlue());
set.setHighLightColor(Color.rgb(244, 117, 117));
set.setValueTextColor(Color.WHITE);
set.setValueTextSize(9f);
set.setDrawValues(false);
return set;
}
示例3: addMainDataSets
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
/**
* Adds the main data set for all times and the data set for the progression of record best
* times among all times. The progression of best times are marked in a different color to the
* main line of all time using circles lined with a dashed line. This will appear to connect
* the lowest troughs along the main line of all times.
*
* @param chartData The chart data to which to add the new data sets.
* @param allLabel The label of the all-times line.
* @param allColor The color of the all-times line.
* @param bestLabel The label of the best-times line.
* @param bestColor The color of the best-times line.
*/
private void addMainDataSets(LineData chartData, String allLabel, int allColor,
String bestLabel, int bestColor) {
// Main data set for all solve times.
chartData.addDataSet(createDataSet(allLabel, allColor));
// Data set to show the progression of best times along the main line of all times.
final LineDataSet bestDataSet = createDataSet(bestLabel, bestColor);
bestDataSet.enableDashedLine(3f, 6f, 0f);
bestDataSet.setDrawCircles(true);
bestDataSet.setCircleRadius(BEST_TIME_CIRCLE_RADIUS_DP);
bestDataSet.setCircleColor(bestColor);
bestDataSet.setDrawValues(false);
bestDataSet.setValueTextColor(bestColor);
bestDataSet.setValueTextSize(BEST_TIME_VALUES_TEXT_SIZE_DP);
bestDataSet.setValueFormatter(new TimeChartValueFormatter());
chartData.addDataSet(bestDataSet);
}
示例4: createSet
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private LineDataSet createSet() {
LineDataSet set = new LineDataSet(null, getString(R.string.app_name));
set.setAxisDependency(YAxis.AxisDependency.LEFT);
set.setColor(ColorTemplate.getHoloBlue());
set.setCircleColor(Color.WHITE);
set.setLineWidth(1f);
set.setCircleRadius(1.5f);
set.setFillAlpha(65);
set.setFillColor(ColorTemplate.getHoloBlue());
set.setHighLightColor(Color.rgb(244, 117, 117));
set.setValueTextColor(Color.WHITE);
set.setValueTextSize(9f);
set.setDrawValues(false);
return set;
}
示例5: generateLineData
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private LineData generateLineData() {
LineData d = new LineData();
ArrayList<Entry> entries = new ArrayList<Entry>();
for (int index = 0; index < itemcount; index++)
entries.add(new Entry(getRandom(15, 10), index));
LineDataSet set = new LineDataSet(entries, "Line DataSet");
set.setColor(Color.rgb(240, 238, 70));
set.setLineWidth(2.5f);
set.setCircleColor(Color.rgb(240, 238, 70));
set.setCircleRadius(5f);
set.setFillColor(Color.rgb(240, 238, 70));
set.setDrawCubic(true);
set.setDrawValues(true);
set.setValueTextSize(10f);
set.setValueTextColor(Color.rgb(240, 238, 70));
set.setAxisDependency(YAxis.AxisDependency.LEFT);
d.addDataSet(set);
return d;
}
示例6: createSet
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private LineDataSet createSet() {
LineDataSet set = new LineDataSet(null, "BG Data");
set.setAxisDependency(YAxis.AxisDependency.LEFT);
set.setColor(ColorTemplate.getHoloBlue());
set.setCircleColor(Color.WHITE);
set.setLineWidth(2f);
set.setCircleRadius(3f);
set.setFillAlpha(65);
set.setFillColor(ColorTemplate.getHoloBlue());
set.setHighLightColor(Color.rgb(244, 117, 117));
set.setValueTextColor(Color.WHITE);
set.setValueTextSize(9f);
set.setDrawValues(false);
//set.setColors(ColorTemplate.COLORFUL_COLORS);
//set.setColors(ColorTemplate.VORDIPLOM_COLORS);
//set.setColors(ColorTemplate.JOYFUL_COLORS);
//set.setColors(ColorTemplate.LIBERTY_COLORS);
//set.setColors(ColorTemplate.PASTEL_COLORS);
//set.setDrawCubic(chartcubic);
return set;
}
示例7: getLineData
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private LineData getLineData(List<String> xVals, List<Entry> lineEntries) {
final LineDataSet dataSet = new LineDataSet(lineEntries, getContext().getString(R.string.moving_average));
final int color = ContextCompat.getColor(getContext(), R.color.brown);
dataSet.setColor(color);
dataSet.setLineWidth(2.5f);
dataSet.setCircleColor(color);
dataSet.setFillColor(color);
dataSet.setDrawValues(true);
dataSet.setValueTextSize(12);
dataSet.setValueTextColor(color);
// Format the value labels to two decimal places
dataSet.setValueFormatter(new LineChartValueFormatter());
return new LineData(xVals, dataSet);
}
示例8: generateLineData
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private LineData generateLineData() {
LineData d = new LineData();
ArrayList<Entry> entries = new ArrayList<Entry>();
for (int index = 0; index < 3; index++)
entries.add(new Entry(index + 0.5f, UtilsRG.getRandomNumberInRange(0, 1)));
LineDataSet set = new LineDataSet(entries, "Line DataSet");
set.setColor(R.color.colorPrimaryLight);
set.setLineWidth(2.5f);
set.setCircleColor(R.color.colorPrimaryLight);
set.setCircleRadius(5f);
set.setFillColor(R.color.colorPrimaryLight);
set.setMode(LineDataSet.Mode.CUBIC_BEZIER);
set.setDrawValues(true);
set.setValueTextSize(10f);
set.setValueTextColor(R.color.colorPrimaryLight);
set.setAxisDependency(YAxis.AxisDependency.LEFT);
d.addDataSet(set);
return d;
}
示例9: createSet
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private LineDataSet createSet() {
LineDataSet set = new LineDataSet(null, "Dynamic Data");
set.setAxisDependency(YAxis.AxisDependency.LEFT);
set.setColor(ColorTemplate.getHoloBlue());
set.setCircleColor(Color.WHITE);
set.setLineWidth(2f);
set.setCircleRadius(4f);
set.setFillAlpha(65);
set.setFillColor(ColorTemplate.getHoloBlue());
set.setHighLightColor(Color.rgb(244, 117, 117));
set.setValueTextColor(Color.WHITE);
set.setValueTextSize(9f);
set.setDrawValues(false);
return set;
}
示例10: addDataSet
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private void addDataSet() {
LineData data = mChart.getData();
if (data != null) {
int count = (data.getDataSetCount() + 1);
ArrayList<Entry> yVals = new ArrayList<Entry>();
for (int i = 0; i < data.getEntryCount(); i++) {
yVals.add(new Entry(i, (float) (Math.random() * 50f) + 50f * count));
}
LineDataSet set = new LineDataSet(yVals, "DataSet " + count);
set.setLineWidth(2.5f);
set.setCircleRadius(4.5f);
int color = mColors[count % mColors.length];
set.setColor(color);
set.setCircleColor(color);
set.setHighLightColor(color);
set.setValueTextSize(10f);
set.setValueTextColor(color);
data.addDataSet(set);
data.notifyDataChanged();
mChart.notifyDataSetChanged();
mChart.invalidate();
}
}
示例11: createSet
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private LineDataSet createSet() {
LineDataSet set = new LineDataSet(null, "DataSet 1");
set.setLineWidth(2.5f);
set.setCircleRadius(4.5f);
set.setColor(Color.rgb(240, 99, 99));
set.setCircleColor(Color.rgb(240, 99, 99));
set.setHighLightColor(Color.rgb(190, 190, 190));
set.setAxisDependency(AxisDependency.LEFT);
set.setValueTextSize(10f);
return set;
}
示例12: setData
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private void setData() {
List<Entry> entries = data.getList();
for(Entry e: entries){
Date d= new Date((long) e.getX());
Log.d(Const.TAG2, "Next Entry is "+d.toString()+" , "+e.getY());
}
LineDataSet dataSet = new LineDataSet(entries, "Hourly Weather report");
dataSet.setColor(Color.rgb(184, 235, 161));
dataSet.setDrawCircleHole(false);
dataSet.setCircleColor(Color.CYAN);
dataSet.setValueTextColor(Color.WHITE);
dataSet.setValueTextSize(15);
dataSet.setDrawFilled(true);
dataSet.setFillColor(Color.LTGRAY);
dataSet.setDrawValues(true);
dataSet.setMode(LineDataSet.Mode.CUBIC_BEZIER);
dataSet.setValueFormatter(new IValueFormatter() {
@Override
public String getFormattedValue(float value, Entry entry, int dataSetIndex, ViewPortHandler viewPortHandler) {
int newValue = (int) value;
return newValue + Const.DEGREE;
}
});
LineData lineData = new LineData(dataSet);
lineChart.setData(lineData);
lineChart.invalidate();//refresh
}
示例13: addDataSet
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private void addDataSet() {
LineData data = mChart.getData();
if(data != null) {
int count = (data.getDataSetCount() + 1);
// create 10 y-vals
ArrayList<Entry> yVals = new ArrayList<Entry>();
if(data.getXValCount() == 0) {
// add 10 x-entries
for (int i = 0; i < 10; i++) {
data.addXValue("" + (i+1));
}
}
for (int i = 0; i < data.getXValCount(); i++) {
yVals.add(new Entry((float) (Math.random() * 50f) + 50f * count, i));
}
LineDataSet set = new LineDataSet(yVals, "DataSet " + count);
set.setLineWidth(2.5f);
set.setCircleRadius(4.5f);
int color = mColors[count % mColors.length];
set.setColor(color);
set.setCircleColor(color);
set.setHighLightColor(color);
set.setValueTextSize(10f);
set.setValueTextColor(color);
data.addDataSet(set);
mChart.notifyDataSetChanged();
mChart.invalidate();
}
}
示例14: generateOceanHiLo
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
/**
* Prepare LineData object
* @param open - float
* @param close - float
* @param seriesName - String
* @return LineData
*/
private LineData generateOceanHiLo(float open, float close, String seriesName){
LineData d = new LineData();
ArrayList<Entry> entries = new ArrayList<>();
entries.add(new Entry(1.5f, open));
LineDataSet set = new LineDataSet(entries, seriesName);
set.setDrawValues(false);
set.setColor(Color.BLACK);
set.setValueTextSize(10f);
d.addDataSet(set);
return d;
}
示例15: configureWeatherChart
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
/**
* Configure styles of weather charts.
*
* @param entries chart data.
* @param formatter value formatter.
* @param minVal min value to show.
* @param maxVal max value to show.
* @return chart formatted.
*/
private LineDataSet configureWeatherChart(
LineChart chart, int chartName, int colorLineTempChart, int colorFillTempChart,
List<Entry> entries, IAxisValueFormatter formatter, double minVal, double maxVal) {
LineDataSet lineDataSet = new LineDataSet(entries, getString(chartName));
lineDataSet.setMode(LineDataSet.Mode.HORIZONTAL_BEZIER);
lineDataSet.setDrawValues(false);
lineDataSet.setValueTextSize(10f);
lineDataSet.setDrawCircles(false);
lineDataSet.setLineWidth(1.8f);
lineDataSet.setColor(ContextCompat.getColor(getContext(), colorLineTempChart));
lineDataSet.setLineWidth(2f);
lineDataSet.setDrawFilled(true);
lineDataSet.setFillColor(ContextCompat.getColor(getContext(), colorFillTempChart));
lineDataSet.setFillAlpha(255);
// General setup
chart.setDrawGridBackground(false);
chart.setDrawBorders(false);
chart.setViewPortOffsets(0, 0, 0, 0);
chart.getDescription().setEnabled(false);
chart.getLegend().setEnabled(false);
chart.setTouchEnabled(false);
// X axis setup
XAxis xAxis = chart.getXAxis();
xAxis.setEnabled(false);
xAxis.setAxisMinimum(0);
xAxis.setAxisMaximum(lastTimestamp);
// Y axis setup
YAxis leftAxis = chart.getAxisLeft();
leftAxis.setEnabled(false);
leftAxis.setAxisMaximum((float) (maxVal));
leftAxis.setAxisMinimum((float) (minVal));
YAxis rightAxis = chart.getAxisRight();
rightAxis.setAxisMaximum((float) (maxVal));
rightAxis.setAxisMinimum((float) (minVal));
rightAxis.setPosition(YAxis.YAxisLabelPosition.INSIDE_CHART);
rightAxis.setValueFormatter(formatter);
return lineDataSet;
}