本文整理汇总了Java中com.jjoe64.graphview.series.BarGraphSeries.setDrawValuesOnTop方法的典型用法代码示例。如果您正苦于以下问题:Java BarGraphSeries.setDrawValuesOnTop方法的具体用法?Java BarGraphSeries.setDrawValuesOnTop怎么用?Java BarGraphSeries.setDrawValuesOnTop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jjoe64.graphview.series.BarGraphSeries
的用法示例。
在下文中一共展示了BarGraphSeries.setDrawValuesOnTop方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.jjoe64.graphview.series.BarGraphSeries; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_activity_reporte);
dbHelper = new DBHelper(this);
Intent intent = getIntent();
_id_reclutador =intent.getStringExtra("id_reclutador");
fecha = intent.getStringExtra("fecha");
fecha2 = intent.getStringExtra("fecha2");
GraphView graph = (GraphView) findViewById(R.id.graph);
BarGraphSeries<DataPoint> series = new BarGraphSeries<DataPoint>(new DataPoint[] {
new DataPoint(0, getEmpresaCount("BOSCH", fecha, fecha2)),
new DataPoint(1, getEmpresaCount("HONEYWELL", fecha, fecha2)),
new DataPoint(2, getEmpresaCount("UTC", fecha, fecha2)),
new DataPoint(3, getEmpresaCount("SKYWORKS", fecha, fecha2)),
});
graph.addSeries(series);
// styling
series.setValueDependentColor(new ValueDependentColor<DataPoint>() {
@Override
public int get(DataPoint data) {
return Color.rgb((int) data.getX() * 255 / 4, (int) Math.abs(data.getY() * 255 / 6), 100);
}
});
series.setSpacing(10);
series.setTitle("Reporte de Fecha #1 a Fecha #2");
// draw values on top
series.setDrawValuesOnTop(true);
series.setValuesOnTopColor(Color.RED);
//series.setValuesOnTopSize(50);
txtEmpresas = (TextView) findViewById(R.id.txtEmpresas);
txtEmpresas.setText("1.- BOSCH\n2.- HONEYWELL\n3.- UTC\n4.- SKYWORKS");
}
示例2: onCreate
import com.jjoe64.graphview.series.BarGraphSeries; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_activity_reporte);
dbHelper = new DBHelper(this);
Intent intent = getIntent();
_id_reclutador =intent.getStringExtra("id_reclutador");
fecha = intent.getStringExtra("fecha");
fecha2 = intent.getStringExtra("fecha2");
GraphView graph = (GraphView) findViewById(R.id.graph);
BarGraphSeries<DataPoint> series = new BarGraphSeries<DataPoint>(new DataPoint[] {
new DataPoint(0, getEmpresaCount("BOSCH", fecha, fecha2)),
new DataPoint(1, getEmpresaCount("Chromalloy", fecha, fecha2)),
new DataPoint(2, getEmpresaCount("UTC", fecha, fecha2))
});
graph.addSeries(series);
// styling
series.setValueDependentColor(new ValueDependentColor<DataPoint>() {
@Override
public int get(DataPoint data) {
return Color.rgb((int) data.getX() * 255 / 4, (int) Math.abs(data.getY() * 255 / 6), 100);
}
});
series.setSpacing(10);
series.setTitle("Reporte de Fecha #1 a Fecha #2");
// draw values on top
series.setDrawValuesOnTop(true);
series.setValuesOnTopColor(Color.RED);
//series.setValuesOnTopSize(50);
txtEmpresas = (TextView) findViewById(R.id.txtEmpresas);
txtEmpresas.setText("1.- BOSCH\n2.- Honeywell\n3.- UTC\n4.- Chromalloy\n5.- ManPower\n6.- Skyworks\n7.- Pilkington");
}