本文整理汇总了Java中lecho.lib.hellocharts.view.LineChartView.getMaximumViewport方法的典型用法代码示例。如果您正苦于以下问题:Java LineChartView.getMaximumViewport方法的具体用法?Java LineChartView.getMaximumViewport怎么用?Java LineChartView.getMaximumViewport使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lecho.lib.hellocharts.view.LineChartView
的用法示例。
在下文中一共展示了LineChartView.getMaximumViewport方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateView
import lecho.lib.hellocharts.view.LineChartView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_good_bad, container, false);
chart = (LineChartView) rootView.findViewById(R.id.chart);
generateDefaultData();
chart.setLineChartData(data);
// Increase viewport height for better look
Viewport v = chart.getMaximumViewport();
float dy = v.height() * 0.2f;
v.inset(0, -dy);
chart.setMaximumViewport(v);
chart.setCurrentViewport(v);
return rootView;
}
示例2: refreshView
import lecho.lib.hellocharts.view.LineChartView; //导入方法依赖的package包/类
protected void refreshView(View view) {
LineChartView chart = (LineChartView) view.findViewById(R.id.example_linechart);
BgGraphBuilder bgGraphBuilder = new BgGraphBuilder(getContext());
chart.setLineChartData(bgGraphBuilder.lineData());
Viewport viewport = chart.getMaximumViewport();
chart.setViewportCalculationEnabled(false);
chart.setInteractive(false);
chart.setCurrentViewport(viewport);
chart.setPadding(0, 0, 0, 0);
chart.setLeft(0);
chart.setTop(0);
Log.d(TAG, "onBindExampleChart: refreshview " + chart.getHeight());
}
示例3: onViewportChanged
import lecho.lib.hellocharts.view.LineChartView; //导入方法依赖的package包/类
@Override
public void onViewportChanged(Viewport newViewport) {
if (!updatingPreviewViewport) {
updatingChartViewport = true;
bgPreviewChart.setZoomType(ZoomType.HORIZONTAL);
bgPreviewChart.setCurrentViewport(newViewport);
updatingChartViewport = false;
if (iobcobFragmentObject.getView() != null) { //Fragment is loaded
LineChartView iobcobPastChart = (LineChartView) findViewById(R.id.iobcobPast);
Viewport iobv = new Viewport(bgChart.getMaximumViewport()); //Update the IOB COB Line Chart Viewport to stay inline with the preview
iobv.left = newViewport.left;
iobv.right = newViewport.right;
iobv.top = iobcobPastChart.getMaximumViewport().top;
iobv.bottom = iobcobPastChart.getMaximumViewport().bottom;
iobcobPastChart.setMaximumViewport(iobv);
iobcobPastChart.setCurrentViewport(iobv);
}
if (basalvsTempBasalObject.getView() != null){
LineChartView bvbChart = (LineChartView) findViewById(R.id.basalvsTempBasal_LineChart);
Viewport bvbv = new Viewport(bgChart.getMaximumViewport());
bvbv.left = newViewport.left;
bvbv.right = newViewport.right;
bvbv.top = bvbChart.getMaximumViewport().top;
bvbv.bottom = bvbChart.getMaximumViewport().bottom;
bvbChart.setMaximumViewport(bvbv);
bvbChart.setCurrentViewport(bvbv);
}
}
}