本文整理汇总了Java中com.github.mikephil.charting.charts.ScatterChart.setDescription方法的典型用法代码示例。如果您正苦于以下问题:Java ScatterChart.setDescription方法的具体用法?Java ScatterChart.setDescription怎么用?Java ScatterChart.setDescription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.mikephil.charting.charts.ScatterChart
的用法示例。
在下文中一共展示了ScatterChart.setDescription方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateView
import com.github.mikephil.charting.charts.ScatterChart; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.frag_simple_scatter, container, false);
mChart = (ScatterChart) v.findViewById(R.id.scatterChart1);
mChart.setDescription("");
Typeface tf = Typeface.createFromAsset(getActivity().getAssets(),"OpenSans-Light.ttf");
MyMarkerView mv = new MyMarkerView(getActivity(), R.layout.custom_marker_view);
mChart.setMarkerView(mv);
mChart.setDrawGridBackground(false);
mChart.setData(generateScatterData(6, 10000, 200));
XAxis xAxis = mChart.getXAxis();
xAxis.setEnabled(true);
xAxis.setPosition(XAxisPosition.BOTTOM);
YAxis leftAxis = mChart.getAxisLeft();
leftAxis.setTypeface(tf);
YAxis rightAxis = mChart.getAxisRight();
rightAxis.setTypeface(tf);
rightAxis.setDrawGridLines(false);
Legend l = mChart.getLegend();
l.setWordWrapEnabled(true);
l.setTypeface(tf);
l.setFormSize(14f);
l.setTextSize(9f);
// increase the space between legend & bottom and legend & content
l.setYOffset(13f);
mChart.setExtraBottomOffset(16f);
return v;
}
示例2: initScatter
import com.github.mikephil.charting.charts.ScatterChart; //导入方法依赖的package包/类
private void initScatter() {
final ScatterChart scatterChart = getScatterChart();
if(scatterChart == null) {
return;
}
scatterChart.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Show
AlertDialog.Builder builder = new AlertDialog.Builder(CalibrationLinearityActivity.this);
builder.setTitle(CalibrationLinearityActivity.this.getText(R.string.calibration_select_frequency));
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(CalibrationLinearityActivity.this,
R.array.calibrate_type_list_array, android.R.layout.simple_selectable_list_item);
builder.setAdapter(adapter,
new ItemActionOnClickListener(CalibrationLinearityActivity.this, scatterChart));
builder.show();
}
});
scatterChart.setDescription("");
scatterChart.setDrawGridBackground(false);
scatterChart.setMaxVisibleValueCount(200);
Legend l = scatterChart.getLegend();
l.setPosition(Legend.LegendPosition.RIGHT_OF_CHART);
l.setTextColor(Color.WHITE);
YAxis yl = scatterChart.getAxisLeft();
yl.setTextColor(Color.WHITE);
yl.setGridColor(Color.WHITE);
scatterChart.getAxisRight().setEnabled(false);
XAxis xl = scatterChart.getXAxis();
xl.setDrawGridLines(false);
xl.setTextColor(Color.WHITE);
xl.setGridColor(Color.WHITE);
}
示例3: onCreate
import com.github.mikephil.charting.charts.ScatterChart; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_scatterchart);
tvX = (TextView) findViewById(R.id.tvXMax);
tvY = (TextView) findViewById(R.id.tvYMax);
mSeekBarX = (SeekBar) findViewById(R.id.seekBar1);
mSeekBarX.setOnSeekBarChangeListener(this);
mSeekBarY = (SeekBar) findViewById(R.id.seekBar2);
mSeekBarY.setOnSeekBarChangeListener(this);
mChart = (ScatterChart) findViewById(R.id.chart1);
mChart.setDescription("");
tf = Typeface.createFromAsset(getAssets(), "OpenSans-Regular.ttf");
mChart.setOnChartValueSelectedListener(this);
mChart.setDrawGridBackground(false);
mChart.setTouchEnabled(true);
// enable scaling and dragging
mChart.setDragEnabled(true);
mChart.setScaleEnabled(true);
mChart.setMaxVisibleValueCount(200);
mChart.setPinchZoom(true);
mSeekBarX.setProgress(45);
mSeekBarY.setProgress(100);
Legend l = mChart.getLegend();
l.setPosition(LegendPosition.RIGHT_OF_CHART);
l.setTypeface(tf);
YAxis yl = mChart.getAxisLeft();
yl.setTypeface(tf);
yl.setAxisMinValue(0f); // this replaces setStartAtZero(true)
mChart.getAxisRight().setEnabled(false);
XAxis xl = mChart.getXAxis();
xl.setTypeface(tf);
xl.setDrawGridLines(false);
}