本文整理汇总了Java中com.db.chart.view.LineChartView类的典型用法代码示例。如果您正苦于以下问题:Java LineChartView类的具体用法?Java LineChartView怎么用?Java LineChartView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LineChartView类属于com.db.chart.view包,在下文中一共展示了LineChartView类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: populateChart
import com.db.chart.view.LineChartView; //导入依赖的package包/类
private void populateChart(String[] labels, float[] values, LineChartView graphView) {
LineSet dataSet = new LineSet(labels, values);
int maxValue = detailBreakDownPresenter.getMaxHeight(values);
dataSet.setColor(ContextCompat.getColor(context, R.color.colorGrey))
.setFill(ContextCompat.getColor(context, android.R.color.transparent))
.setDotsColor(ContextCompat.getColor(context, R.color.colorGrey))
.setThickness(4)
.setDashed(new float[] { 10f, 10f })
.beginAt(0);
// Chart
graphView.setBorderSpacing(Tools.fromDpToPx(15))
.setYLabels(AxisRenderer.LabelPosition.NONE)
.setLabelsColor(ContextCompat.getColor(context, R.color.colorGrey))
.setXAxis(false)
.setAxisBorderValues(0, maxValue, 2)
.setYAxis(false);
graphView.reset();
graphView.addData(dataSet);
graphView.animate();
graphView.show();
}
开发者ID:riteshakya037,项目名称:Subs,代码行数:22,代码来源:DetailBreakDownFragment.java
示例2: StatsGraph
import com.db.chart.view.LineChartView; //导入依赖的package包/类
public StatsGraph(Fragment f, ProgressBar prog) {
mLineChart = (LineChartView)f.getActivity().findViewById(R.id.rockStats);
mLineChart.setOnEntryClickListener(lineEntryListener);
mLineChart.setOnClickListener(lineClickListener);
mLineGridPaint = new Paint();
mLineGridPaint.setColor(LINES);
mLineGridPaint.setPathEffect(new DashPathEffect(new float[] {5,0}, 0));
mLineGridPaint.setStyle(Paint.Style.STROKE);
mLineGridPaint.setAntiAlias(true);
mLineGridPaint.setStrokeWidth(Tools.fromDpToPx(.75f));
this.prog = prog;
this.range = WEEK;
this.column = POINTS;
this.stats = new HashMap<Long, Stat>();
this.dbh = new DatabaseHelper(f.getActivity(), null);
this.db = dbh.getReadableDatabase();
refresh();
}
开发者ID:JFrei86,项目名称:rockkeeper,代码行数:23,代码来源:StatsGraph.java
示例3: temperatureGraph
import com.db.chart.view.LineChartView; //导入依赖的package包/类
private void temperatureGraph() {
LineChartView lineChartView = (LineChartView) findViewById(R.id.graph_temperature);
// Data
LineSet dataset = new LineSet();
for (int i = 0; i < weatherList.size(); i++) {
float temperature = UnitConvertor.convertTemperature(Float.parseFloat(weatherList.get(i).getTemperature()), sp);
if (temperature < minTemp) {
minTemp = temperature;
}
if (temperature > maxTemp) {
maxTemp = temperature;
}
dataset.addPoint(getDateLabel(weatherList.get(i), i), (float) ((Math.ceil(temperature / 2)) * 2));
}
dataset.setSmooth(false);
dataset.setColor(Color.parseColor("#FF5722"));
dataset.setThickness(4);
lineChartView.addData(dataset);
// Grid
Paint paint = new Paint();
paint.setStyle(Paint.Style.STROKE);
paint.setAntiAlias(true);
paint.setColor(Color.parseColor("#333333"));
paint.setPathEffect(new DashPathEffect(new float[]{10, 10}, 0));
paint.setStrokeWidth(1);
lineChartView.setGrid(ChartView.GridType.HORIZONTAL, paint);
lineChartView.setBorderSpacing(Tools.fromDpToPx(10));
lineChartView.setAxisBorderValues((int) minTemp - 2, (int) maxTemp + 2);
lineChartView.setStep(2);
lineChartView.setXAxis(false);
lineChartView.setYAxis(false);
lineChartView.show();
}
开发者ID:hichemcesar24,项目名称:Weather-Android,代码行数:41,代码来源:GraphActivity.java
示例4: rainGraph
import com.db.chart.view.LineChartView; //导入依赖的package包/类
private void rainGraph() {
LineChartView lineChartView = (LineChartView) findViewById(R.id.graph_rain);
// Data
LineSet dataset = new LineSet();
for (int i = 0; i < weatherList.size(); i++) {
float rain = Float.parseFloat(weatherList.get(i).getRain());
if (rain < minRain) {
minRain = rain;
}
if (rain > maxRain) {
maxRain = rain;
}
dataset.addPoint(getDateLabel(weatherList.get(i), i), rain);
}
dataset.setSmooth(false);
dataset.setColor(Color.parseColor("#2196F3"));
dataset.setThickness(4);
lineChartView.addData(dataset);
// Grid
Paint paint = new Paint();
paint.setStyle(Paint.Style.STROKE);
paint.setAntiAlias(true);
paint.setColor(Color.parseColor("#333333"));
paint.setPathEffect(new DashPathEffect(new float[]{10, 10}, 0));
paint.setStrokeWidth(1);
lineChartView.setGrid(ChartView.GridType.HORIZONTAL, paint);
lineChartView.setBorderSpacing(Tools.fromDpToPx(10));
lineChartView.setAxisBorderValues((int) minRain - 1, (int) maxRain + 2);
lineChartView.setStep(1);
lineChartView.setXAxis(false);
lineChartView.setYAxis(false);
lineChartView.show();
}
开发者ID:hichemcesar24,项目名称:Weather-Android,代码行数:41,代码来源:GraphActivity.java
示例5: pressureGraph
import com.db.chart.view.LineChartView; //导入依赖的package包/类
private void pressureGraph() {
LineChartView lineChartView = (LineChartView) findViewById(R.id.graph_pressure);
// Data
LineSet dataset = new LineSet();
for (int i = 0; i < weatherList.size(); i++) {
float pressure = UnitConvertor.convertPressure(Float.parseFloat(weatherList.get(i).getPressure()), sp);
if (pressure < minPressure) {
minPressure = pressure;
}
if (pressure > maxPressure) {
maxPressure = pressure;
}
dataset.addPoint(getDateLabel(weatherList.get(i), i), pressure);
}
dataset.setSmooth(true);
dataset.setColor(Color.parseColor("#4CAF50"));
dataset.setThickness(4);
lineChartView.addData(dataset);
// Grid
Paint paint = new Paint();
paint.setStyle(Paint.Style.STROKE);
paint.setAntiAlias(true);
paint.setColor(Color.parseColor("#333333"));
paint.setPathEffect(new DashPathEffect(new float[]{10, 10}, 0));
paint.setStrokeWidth(1);
lineChartView.setGrid(ChartView.GridType.HORIZONTAL, paint);
lineChartView.setBorderSpacing(Tools.fromDpToPx(10));
lineChartView.setAxisBorderValues((int) minPressure - 1, (int) maxPressure + 1);
lineChartView.setStep(2);
lineChartView.setXAxis(false);
lineChartView.setYAxis(false);
lineChartView.show();
}
开发者ID:hichemcesar24,项目名称:Weather-Android,代码行数:41,代码来源:GraphActivity.java
示例6: onCreate
import com.db.chart.view.LineChartView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_bot_details);
Bundle extras = getIntent().getExtras();
for (int i = 0; i < 7; i++) {
arr[i] = 0;
DateFormat dateFormat = new SimpleDateFormat("MM_dd");
Date date = new Date();
date.setTime(date.getTime() - (6 - i) * 24 * 60 * 60 * 1000);
labels[i] = dateFormat.format(date);
}
if (extras != null) {
gid = extras.getString("data");
} else if (savedInstanceState != null) {
gid = savedInstanceState.getString("data");
arr = savedInstanceState.getIntArray("graph");
msgProcessed = savedInstanceState.getLong("msgprocessed");
}
toolbar = (Toolbar) findViewById(R.id.details_toolbar);
toolbar.setSubtitle("0 Message processed");
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getLoaderManager().initLoader(CURSOR_LOADER_ID, null, this);
lineChartView = (LineChartView) findViewById(R.id.details_linechart);
lineChartView.reset();
refreshLineChart();
}
开发者ID:arunrajora,项目名称:Chit-Chat,代码行数:31,代码来源:BotDetailsActivity.java
示例7: onCreate
import com.db.chart.view.LineChartView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_line_graph);
currency = getIntent().getStringExtra(TAG_STOCK_SYMBOL);
setTitle(currency);
lineChartView = (LineChartView) findViewById(R.id.linechart);
getSupportLoaderManager().initLoader(STOCKS_LOADER, null, this);
}
开发者ID:vycius,项目名称:udacity-stock-hawk,代码行数:13,代码来源:StockDetailActivity.java
示例8: temperatureGraph
import com.db.chart.view.LineChartView; //导入依赖的package包/类
private void temperatureGraph() {
LineChartView lineChartView = (LineChartView) findViewById(R.id.graph_temperature);
// Data
LineSet dataset = new LineSet();
for (int i = 0; i < weatherList.size(); i++) {
float temperature = UnitConvertor.convertTemperature(Float.parseFloat(weatherList.get(i).getTemperature()), sp);
if (temperature < minTemp) {
minTemp = temperature;
}
if (temperature > maxTemp) {
maxTemp = temperature;
}
dataset.addPoint(getDateLabel(weatherList.get(i), i), (float) temperature);
}
dataset.setSmooth(false);
dataset.setColor(Color.parseColor("#FF5722"));
dataset.setThickness(4);
lineChartView.addData(dataset);
// Grid
Paint paint = new Paint();
paint.setStyle(Paint.Style.STROKE);
paint.setAntiAlias(true);
paint.setColor(Color.parseColor("#333333"));
paint.setPathEffect(new DashPathEffect(new float[]{10, 10}, 0));
paint.setStrokeWidth(1);
lineChartView.setGrid(ChartView.GridType.HORIZONTAL, paint);
lineChartView.setBorderSpacing(Tools.fromDpToPx(10));
lineChartView.setAxisBorderValues((int) (Math.round(minTemp)) - 1, (int) (Math.round(maxTemp)) + 1);
lineChartView.setStep(2);
lineChartView.setXAxis(false);
lineChartView.setYAxis(false);
lineChartView.show();
}
开发者ID:martykan,项目名称:forecastie,代码行数:41,代码来源:GraphActivity.java
示例9: rainGraph
import com.db.chart.view.LineChartView; //导入依赖的package包/类
private void rainGraph() {
LineChartView lineChartView = (LineChartView) findViewById(R.id.graph_rain);
// Data
LineSet dataset = new LineSet();
for (int i = 0; i < weatherList.size(); i++) {
float rain = Float.parseFloat(weatherList.get(i).getRain());
if (rain < minRain) {
minRain = rain;
}
if (rain > maxRain) {
maxRain = rain;
}
dataset.addPoint(getDateLabel(weatherList.get(i), i), rain);
}
dataset.setSmooth(false);
dataset.setColor(Color.parseColor("#2196F3"));
dataset.setThickness(4);
lineChartView.addData(dataset);
// Grid
Paint paint = new Paint();
paint.setStyle(Paint.Style.STROKE);
paint.setAntiAlias(true);
paint.setColor(Color.parseColor("#333333"));
paint.setPathEffect(new DashPathEffect(new float[]{10, 10}, 0));
paint.setStrokeWidth(1);
lineChartView.setGrid(ChartView.GridType.HORIZONTAL, paint);
lineChartView.setBorderSpacing(Tools.fromDpToPx(10));
lineChartView.setAxisBorderValues(0, (int) (Math.round(maxRain)) + 1);
lineChartView.setStep(1);
lineChartView.setXAxis(false);
lineChartView.setYAxis(false);
lineChartView.show();
}
开发者ID:martykan,项目名称:forecastie,代码行数:41,代码来源:GraphActivity.java
示例10: setUpStatistics
import com.db.chart.view.LineChartView; //导入依赖的package包/类
private void setUpStatistics(){
cData = cDb.getData();
transactionLineChart = (LineChartView) findViewById(R.id.transaction_linechart);
creditLineChart = (LineChartView) findViewById(R.id.credit_linechart);
averageBarChart = (BarChartView) findViewById(R.id.average_barchart);
setUpTransactionLineChart();
setUpCreditLineChart();
setUpAverageBarChart();
setUpAllTimeSpendings();
}
开发者ID:ueman,项目名称:CampusCardReader,代码行数:11,代码来源:MainActivity.java
示例11: initUI
import com.db.chart.view.LineChartView; //导入依赖的package包/类
private void initUI(){
root = (RelativeLayout)view.findViewById(R.id.root);
tv_title = (TextView)view.findViewById(R.id.tv_title);
cv_graph = (CardView)view.findViewById(R.id.cv_graph);
cv_graph.setVisibility(View.GONE);
mChart = (LineChartView)view.findViewById(R.id.chart_weight);
tv_title.setText(title);
tv_msg = (TextView)view.findViewById(R.id.tv_msg);
tv_msg.setVisibility(View.GONE);
mLinearLayoutManager = new LinearLayoutManager(context);
mLinearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
rv = (RecyclerView) view.findViewById(R.id.rv);
rv.setHasFixedSize(true);
rv.setLayoutManager(mLinearLayoutManager);
// rv.addItemDecoration(new DividerItemDecoration(context, DividerItemDecoration.VERTICAL_LIST));
loading = (AVLoadingIndicatorView)view.findViewById(R.id.loading);
}
开发者ID:pooi,项目名称:Nearby,代码行数:26,代码来源:InquiryVitalSignFragment.java
注:本文中的com.db.chart.view.LineChartView类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论