本文整理汇总了Java中lecho.lib.hellocharts.view.LineChartView.setZoomType方法的典型用法代码示例。如果您正苦于以下问题:Java LineChartView.setZoomType方法的具体用法?Java LineChartView.setZoomType怎么用?Java LineChartView.setZoomType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lecho.lib.hellocharts.view.LineChartView
的用法示例。
在下文中一共展示了LineChartView.setZoomType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupCharts
import lecho.lib.hellocharts.view.LineChartView; //导入方法依赖的package包/类
private void setupCharts() {
dateButton1.setText(dateFormatter.format(date1.getTime()));
Calendar endDate = (GregorianCalendar) date1.clone();
endDate.add(Calendar.DATE, noDays);
int numValues = noDays * (60 / 2) * 24; // LimiTTer sample rate 1 per 2 minutes
BgGraphBuilder bgGraphBuilder = new BgGraphBuilder(this, date1.getTimeInMillis(), endDate.getTimeInMillis(), numValues, false);
chart = (LineChartView) findViewById(R.id.chart);
chart.setZoomType(ZoomType.HORIZONTAL);
previewChart = (PreviewLineChartView) findViewById(R.id.chart_preview);
previewChart.setZoomType(ZoomType.HORIZONTAL);
chart.setLineChartData(bgGraphBuilder.lineData());
chart.setOnValueTouchListener(bgGraphBuilder.getOnValueSelectTooltipListener(this));
previewChart.setLineChartData(bgGraphBuilder.previewLineData(chart.getLineChartData()));
previewChart.setViewportCalculationEnabled(true);
chart.setViewportCalculationEnabled(true);
previewChart.setViewportChangeListener(new ViewportListener());
chart.setViewportChangeListener(new ChartViewPortListener());
setupStatistics(date1.getTimeInMillis(), endDate.getTimeInMillis());
}
示例2: setupCharts
import lecho.lib.hellocharts.view.LineChartView; //导入方法依赖的package包/类
private void setupCharts() {
dateButton1.setText(dateFormatter.format(date1.getTime()));
Calendar endDate = (GregorianCalendar) date1.clone();
endDate.add(Calendar.DATE, noDays);
int numValues = noDays * (60 / 5) * 24;
BgGraphBuilder bgGraphBuilder = new BgGraphBuilder(this, date1.getTimeInMillis(), endDate.getTimeInMillis(), numValues);
chart = (LineChartView) findViewById(R.id.chart);
chart.setZoomType(ZoomType.HORIZONTAL);
previewChart = (PreviewLineChartView) findViewById(R.id.chart_preview);
previewChart.setZoomType(ZoomType.HORIZONTAL);
chart.setLineChartData(bgGraphBuilder.lineData());
chart.setOnValueTouchListener(bgGraphBuilder.getOnValueSelectTooltipListener());
previewChart.setLineChartData(bgGraphBuilder.previewLineData());
previewChart.setViewportCalculationEnabled(true);
chart.setViewportCalculationEnabled(true);
previewChart.setViewportChangeListener(new ViewportListener());
chart.setViewportChangeListener(new ChartViewPortListener());
}
示例3: setupCharts
import lecho.lib.hellocharts.view.LineChartView; //导入方法依赖的package包/类
public void setupCharts() {
bgGraphBuilder = new BgGraphBuilder(this);
updateStuff = false;
chart = (LineChartView) findViewById(R.id.chart);
chart.setZoomType(ZoomType.HORIZONTAL);
previewChart = (PreviewLineChartView) findViewById(R.id.chart_preview);
previewChart.setZoomType(ZoomType.HORIZONTAL);
chart.setLineChartData(bgGraphBuilder.lineData());
previewChart.setLineChartData(bgGraphBuilder.previewLineData());
updateStuff = true;
previewChart.setViewportCalculationEnabled(true);
chart.setViewportCalculationEnabled(true);
previewChart.setViewportChangeListener(new ViewportListener());
chart.setViewportChangeListener(new ChartViewPortListener());
setViewport();
}
示例4: setupChart
import lecho.lib.hellocharts.view.LineChartView; //导入方法依赖的package包/类
private static void setupChart(Context context, LineChartView chart, List<AxisValue> xAxisValues, String yAxisLabel, List<Line> lines) {
Axis xAxis = new Axis(xAxisValues);
ChartUtils.setupXAxis(context, xAxis);
Axis yAxis = new Axis();
ChartUtils.setupYAxis(context, yAxisLabel, yAxis);
LineChartData lineChartData = new LineChartData();
lineChartData.setAxisXBottom(xAxis);
lineChartData.setAxisYLeft(yAxis);
lineChartData.setLines(lines);
chart.setZoomEnabled(true);
chart.setZoomType(ZoomType.HORIZONTAL);
chart.setLineChartData(lineChartData);
resetViewport(chart);
}
示例5: setupCharts
import lecho.lib.hellocharts.view.LineChartView; //导入方法依赖的package包/类
private void setupCharts() {
bgGraphBuilder = new BgGraphBuilder(this);
updateStuff = false;
chart = (LineChartView) findViewById(R.id.chart);
chart.setZoomType(ZoomType.HORIZONTAL);
//Transmitter Battery Level
final Sensor sensor = Sensor.currentSensor();
if (sensor != null && sensor.latest_battery_level != 0 && sensor.latest_battery_level <= Constants.TRANSMITTER_BATTERY_LOW && ! mPreferences.getBoolean("disable_battery_warning", false)) {
Drawable background = new Drawable() {
@Override
public void draw(Canvas canvas) {
DisplayMetrics metrics = getApplicationContext().getResources().getDisplayMetrics();
int px = (int) (30 * (metrics.densityDpi / 160f));
Paint paint = new Paint();
paint.setTextSize(px);
paint.setAntiAlias(true);
paint.setColor(Color.parseColor("#FFFFAA"));
paint.setStyle(Paint.Style.STROKE);
paint.setAlpha(100);
canvas.drawText("transmitter battery", 10, chart.getHeight() / 3 - (int) (1.2 * px), paint);
if(sensor.latest_battery_level <= Constants.TRANSMITTER_BATTERY_EMPTY){
paint.setTextSize((int)(px*1.5));
canvas.drawText("VERY LOW", 10, chart.getHeight() / 3, paint);
} else {
canvas.drawText("low", 10, chart.getHeight() / 3, paint);
}
}
@Override
public void setAlpha(int alpha) {}
@Override
public void setColorFilter(ColorFilter cf) {}
@Override
public int getOpacity() {return 0;}
};
chart.setBackground(background);
}
previewChart = (PreviewLineChartView) findViewById(R.id.chart_preview);
previewChart.setZoomType(ZoomType.HORIZONTAL);
chart.setLineChartData(bgGraphBuilder.lineData());
chart.setOnValueTouchListener(bgGraphBuilder.getOnValueSelectTooltipListener());
previewChart.setLineChartData(bgGraphBuilder.previewLineData());
updateStuff = true;
previewChart.setViewportCalculationEnabled(true);
chart.setViewportCalculationEnabled(true);
previewChart.setViewportChangeListener(new ViewportListener());
chart.setViewportChangeListener(new ChartViewPortListener());
setViewport();
}