当前位置: 首页>>代码示例>>Java>>正文


Java LineChartView.getMaximumViewport方法代码示例

本文整理汇总了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;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:19,代码来源:GoodBadChartActivity.java

示例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());
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:14,代码来源:ExampleChartPreferenceView.java

示例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);
        }
    }
}
 
开发者ID:timomer,项目名称:HAPP,代码行数:31,代码来源:MainActivity.java


注:本文中的lecho.lib.hellocharts.view.LineChartView.getMaximumViewport方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。