本文整理汇总了Java中com.jjoe64.graphview.series.LineGraphSeries.setDataPointsRadius方法的典型用法代码示例。如果您正苦于以下问题:Java LineGraphSeries.setDataPointsRadius方法的具体用法?Java LineGraphSeries.setDataPointsRadius怎么用?Java LineGraphSeries.setDataPointsRadius使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jjoe64.graphview.series.LineGraphSeries
的用法示例。
在下文中一共展示了LineGraphSeries.setDataPointsRadius方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.jjoe64.graphview.series.LineGraphSeries; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_graph2);
GraphView graph = (GraphView) findViewById(R.id.graph);
LineGraphSeries<DataPoint> series = new LineGraphSeries<>(new DataPoint[] {
new DataPoint(0, 4),
new DataPoint(1, 5),
new DataPoint(2, 3),
new DataPoint(3, 2),
new DataPoint(4, 6),
new DataPoint(5, 3),
new DataPoint(6, 1)
});
series.setColor(Color.parseColor("#b485f2"));
series.setDrawDataPoints(true);
series.setDataPointsRadius(10);
series.setThickness(5);
graph.addSeries(series);
graph.getGridLabelRenderer().setHorizontalLabelsColor(Color.parseColor("#777777"));
graph.getGridLabelRenderer().setVerticalLabelsColor(Color.parseColor("#777777"));
graph.getGridLabelRenderer().setTextSize(30);
graph.getViewport().setXAxisBoundsManual(true);
graph.getViewport().setMaxX(6);
}
示例2: onCreate
import com.jjoe64.graphview.series.LineGraphSeries; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_graph);
GraphView graph = (GraphView) findViewById(R.id.graph);
LineGraphSeries<DataPoint> series = new LineGraphSeries<>(new DataPoint[] {
new DataPoint(0, 4),
new DataPoint(1, 5),
new DataPoint(2, 3),
new DataPoint(3, 2),
new DataPoint(4, 6),
new DataPoint(5, 3),
new DataPoint(6, 1)
});
series.setColor(Color.parseColor("#b485f2"));
series.setDrawDataPoints(true);
series.setDataPointsRadius(10);
series.setThickness(5);
graph.addSeries(series);
graph.getGridLabelRenderer().setHorizontalLabelsColor(Color.parseColor("#777777"));
graph.getGridLabelRenderer().setVerticalLabelsColor(Color.parseColor("#777777"));
graph.getGridLabelRenderer().setTextSize(30);
graph.getViewport().setXAxisBoundsManual(true);
graph.getViewport().setMaxX(6);
}
示例3: onPageVisible
import com.jjoe64.graphview.series.LineGraphSeries; //导入方法依赖的package包/类
public void onPageVisible(final DataPoint[] datapoints, DataPoint[] averages) {
if(datapoints != null && averages != null) {
progressBar.setVisibility(View.GONE);
graphView.removeAllSeries();
DataPoint[] list = Arrays.copyOfRange(datapoints, Math.max(0, datapoints.length - period.getDays()), datapoints.length);
LineGraphSeries<DataPoint> datapointsSerie = new LineGraphSeries<>(list);
datapointsSerie.setDrawDataPoints(true);
datapointsSerie.setColor(getContext().getResources().getColor(R.color.green));
datapointsSerie.setTitle(getContext().getResources().getString(R.string.daily_average));
datapointsSerie.setOnDataPointTapListener(this);
graphView.addSeries(datapointsSerie);
LineGraphSeries<DataPoint> averageSerie = new LineGraphSeries<>(Arrays.copyOfRange(averages, Math.max(0, averages.length - period.getDays()), averages.length));
averageSerie.setColor(getContext().getResources().getColor(R.color.orange));
averageSerie.setTitle(getContext().getResources().getString(R.string.trend));
averageSerie.setDrawDataPoints(true);
averageSerie.setDataPointsRadius(6f);
averageSerie.setOnDataPointTapListener(this);
graphView.addSeries(averageSerie);
graphView.getViewport().setMinX(datapointsSerie.getLowestValueX());
graphView.getViewport().setMaxX(datapointsSerie.getHighestValueX());
graphView.getViewport().setXAxisBoundsManual(true);
graphView.getGridLabelRenderer().setNumHorizontalLabels(period.getNbLabels());
graphView.getGridLabelRenderer().setNumVerticalLabels(10);
graphView.getLegendRenderer().setVisible(true);
graphView.getLegendRenderer().setBackgroundColor(getContext().getResources().getColor(R.color.grand_exchange_legend));
graphView.getLegendRenderer().setAlign(LegendRenderer.LegendAlign.TOP);
graphView.getGridLabelRenderer().setHumanRounding(false, true);
graphView.setVisibility(View.VISIBLE);
}
}