本文整理汇总了Java中lecho.lib.hellocharts.view.PreviewLineChartView类的典型用法代码示例。如果您正苦于以下问题:Java PreviewLineChartView类的具体用法?Java PreviewLineChartView怎么用?Java PreviewLineChartView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PreviewLineChartView类属于lecho.lib.hellocharts.view包,在下文中一共展示了PreviewLineChartView类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onCreateView
import lecho.lib.hellocharts.view.PreviewLineChartView; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
setHasOptionsMenu(true);
View rootView = inflater.inflate(R.layout.fragment_preview_line_chart, container, false);
chart = (LineChartView) rootView.findViewById(R.id.chart);
previewChart = (PreviewLineChartView) rootView.findViewById(R.id.chart_preview);
// Generate data for previewed chart and copy of that data for preview chart.
generateDefaultData();
chart.setLineChartData(data);
// Disable zoom/scroll for previewed chart, visible chart ranges depends on preview chart viewport so
// zoom/scroll is unnecessary.
chart.setZoomEnabled(false);
chart.setScrollEnabled(false);
previewChart.setLineChartData(previewData);
previewChart.setViewportChangeListener(new ViewportListener());
previewX(false);
return rootView;
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:25,代码来源:PreviewLineChartActivity.java
示例2: setupCharts
import lecho.lib.hellocharts.view.PreviewLineChartView; //导入依赖的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());
}
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:25,代码来源:BGHistory.java
示例3: setupCharts
import lecho.lib.hellocharts.view.PreviewLineChartView; //导入依赖的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());
}
开发者ID:StephenBlackWasAlreadyTaken,项目名称:xDrip-Experimental,代码行数:23,代码来源:BGHistory.java
示例4: setupCharts
import lecho.lib.hellocharts.view.PreviewLineChartView; //导入依赖的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();
}
开发者ID:StephenBlackWasAlreadyTaken,项目名称:NightWatch,代码行数:20,代码来源:Home.java
示例5: onCreateView
import lecho.lib.hellocharts.view.PreviewLineChartView; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_iobcob_linechart, container, false);
iobcobPastChart = (LineChartView) rootView.findViewById(R.id.iobcobPast);
previewChart = (PreviewLineChartView) getActivity().findViewById(R.id.chart_preview);
iobcobPastLoading = (ProgressBar) rootView.findViewById(R.id.iobcobPastLoading);
//setupChart();
updateChart();
return rootView;
}
开发者ID:timomer,项目名称:HAPP,代码行数:12,代码来源:MainActivity.java
示例6: setupCharts
import lecho.lib.hellocharts.view.PreviewLineChartView; //导入依赖的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();
}
开发者ID:StephenBlackWasAlreadyTaken,项目名称:xDrip-Experimental,代码行数:56,代码来源:Home.java
示例7: onCreate
import lecho.lib.hellocharts.view.PreviewLineChartView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
activity = this;
super.onCreate(savedInstanceState);
Fabric.with(this, new Crashlytics());
ins = this;
//Sets default Preferences
PreferenceManager.setDefaultValues(this, R.xml.pref_aps, false);
PreferenceManager.setDefaultValues(this, R.xml.pref_general, false);
PreferenceManager.setDefaultValues(this, R.xml.pref_notification, false);
PreferenceManager.setDefaultValues(this, R.xml.pref_integration, false);
PreferenceManager.setDefaultValues(this, R.xml.pref_misc, false);
PreferenceManager.setDefaultValues(this, R.xml.pref_pump, false);
checkEula();
//Make sure BackgroundService is running, as this maybe first run
startService(new Intent(this, BackgroundService.class));
setContentView(R.layout.activity_main);
realmManager = new RealmManager();
realmManager.getRealm().setAutoRefresh(true); //so we pickup updates from other threads
setupMenuAndToolbar();
// Create the adapter that will return a fragment for each of the 4 primary sections of the app.
mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
// Set up the ViewPager with the sections adapter.
mViewPager = (ViewPager) this.findViewById(R.id.pager);
bgChart = (LineChartView) findViewById(R.id.chart);
bgChartLoading = (ProgressBar) findViewById(R.id.bgChartLoading);
bgPreviewChart = (PreviewLineChartView) findViewById(R.id.chart_preview);
mViewPager.setAdapter(mSectionsPagerAdapter);
//Build Fragments
openAPSFragmentObject = new openAPSFragment();
iobcobActiveFragmentObject = new iobcobActiveFragment();
iobcobFragmentObject = new iobcobFragment();
basalvsTempBasalObject = new basalvsTempBasalFragment();
}
开发者ID:timomer,项目名称:HAPP,代码行数:44,代码来源:MainActivity.java
注:本文中的lecho.lib.hellocharts.view.PreviewLineChartView类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论