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


Java ContainerScrollType类代码示例

本文整理汇总了Java中lecho.lib.hellocharts.gesture.ContainerScrollType的典型用法代码示例。如果您正苦于以下问题:Java ContainerScrollType类的具体用法?Java ContainerScrollType怎么用?Java ContainerScrollType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ContainerScrollType类属于lecho.lib.hellocharts.gesture包,在下文中一共展示了ContainerScrollType类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreateView

import lecho.lib.hellocharts.gesture.ContainerScrollType; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    binding = FragmentStatisticsChartConsumptionPreviewBinding.inflate(inflater);

    chart = binding.chart;
    previewChart = binding.chartPreview;
    chart.setZoomEnabled(true);
    chart.setScrollEnabled(true);
    chart.setZoomType(ZoomType.HORIZONTAL);
    chart.setContainerScrollEnabled(true, ContainerScrollType.HORIZONTAL);
    chart.setViewportChangeListener(new ViewportListener());
    chart.setOnValueTouchListener(new ValueTouchListener());
    previewChart.setScrollEnabled(false);
    previewChart.setZoomEnabled(false);

    return binding.getRoot();
}
 
开发者ID:piskula,项目名称:FuelUp,代码行数:18,代码来源:StatisticsChartConsumptionPreviewFragment.java

示例2: onCreateView

import lecho.lib.hellocharts.gesture.ContainerScrollType; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    binding = FragmentStatisticsChartCostsPerTimeBinding.inflate(inflater);

    vehicle = getArguments().getParcelable(ARG_VEHICLE);

    chart = binding.chart;
    chart.setZoomEnabled(true);
    chart.setScrollEnabled(true);
    chart.setZoomType(ZoomType.HORIZONTAL);
    chart.setContainerScrollEnabled(true, ContainerScrollType.HORIZONTAL);
    chart.setOnValueTouchListener(new ValueTouchListener());

    return binding.getRoot();
}
 
开发者ID:piskula,项目名称:FuelUp,代码行数:16,代码来源:StatisticsChartCostsPerTimeFragment.java

示例3: onCreateView

import lecho.lib.hellocharts.gesture.ContainerScrollType; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    binding = FragmentStatisticsChartConsumptionPerTimeBinding.inflate(inflater);

    chart = binding.chart;
    chart.setZoomEnabled(true);
    chart.setScrollEnabled(true);
    chart.setZoomType(ZoomType.HORIZONTAL);
    chart.setContainerScrollEnabled(true, ContainerScrollType.HORIZONTAL);

    return binding.getRoot();
}
 
开发者ID:piskula,项目名称:FuelUp,代码行数:13,代码来源:StatisticsChartConsumptionPerTimeFragment.java

示例4: setContainerScrollEnabled

import lecho.lib.hellocharts.gesture.ContainerScrollType; //导入依赖的package包/类
@Override
public void setContainerScrollEnabled(boolean isContainerScrollEnabled, ContainerScrollType containerScrollType) {
    this.isContainerScrollEnabled = isContainerScrollEnabled;
    this.containerScrollType = containerScrollType;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:6,代码来源:AbstractChartView.java

示例5: initView

import lecho.lib.hellocharts.gesture.ContainerScrollType; //导入依赖的package包/类
@SuppressLint("SetTextI18n")
private void initView() {
    NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
    navigationView.getMenu().getItem(0).setChecked(true);

    collapsingToolbarLayout = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);
    tabLayout = (TabLayout) findViewById(R.id.tab_layout);
    viewPager = (ViewPager) findViewById(R.id.view_pager);
    progressRunTimesText = (TextView) findViewById(R.id.progress_times);
    progressStepsText = (TextView) findViewById(R.id.progress_step_num);
    progressDisEnergyText = (TextView) findViewById(R.id.progress_dis_energy);
    circleProgress = (GradeProgressView) findViewById(R.id.circle_progress);
    menuButton = (ImageView) findViewById(R.id.menu_button);
    drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    fab = (FloatingActionButton) findViewById(R.id.fab);
    menuBgImg = (ImageView) navigationView.getHeaderView(0).findViewById(R.id.menu_bg_img);
    columnChart = (ColumnChartView) findViewById(R.id.column_chart);
    welcomeText = (TextView) navigationView.getHeaderView(0).findViewById(R.id.welcome_text);
    profileImage = (CircleImageView) navigationView.getHeaderView(0).findViewById(R.id.profile_image);
    dataDescription = (TextView) findViewById(R.id.data_description);
    progressViewLayout = (RelativeLayout) findViewById(R.id.progress_view_layout);
    chartView = (RelativeLayout) findViewById(R.id.chart_view_layout);
    //conn = new SocialServiceConn();
    setToolbar(R.id.toolbar_main, false);

    menuButton.setOnClickListener(this);
    fab.setOnClickListener(this);
    profileImage.setOnClickListener(this);
    menuBgImg.setOnClickListener(this);
    navigationView.setNavigationItemSelectedListener(this);

    //初始化进度条数值
    circleProgress.setProgressWidthAnimation(0);
    //初始化Title
    collapsingToolbarLayout.setTitle(getResources().getString(R.string.title_activity_main));
    //初始化TabLayout
    mTitle.add("跑步详情");
    mTitle.add("数据统计");
    mFragment.add(new RunListFragment());
    mFragment.add(new StatisticsFragment());
    MyFragmentPagerAdapter adapter = new MyFragmentPagerAdapter(getSupportFragmentManager(), mTitle, mFragment);
    runListFragment = (RunListFragment) adapter.getItem(0);
    statisticsFragment = (StatisticsFragment) adapter.getItem(1);
    viewPager.setAdapter(adapter);
    tabLayout.setupWithViewPager(viewPager);
    //初始化ColumnChart
    columnChart.setContainerScrollEnabled(true, ContainerScrollType.HORIZONTAL);
    columnChart.setInteractive(true);
    columnChart.setZoomEnabled(false);
    columnChart.setContainerScrollEnabled(true, ContainerScrollType.HORIZONTAL);
    chartView.setVisibility(View.INVISIBLE);

    //初始化welcome文字
    welcomeText.setText(Utility.getTime(Types.TYPE_AM_PM) + "好," + username + "!");
}
 
开发者ID:SailFlorve,项目名称:RunHDU,代码行数:56,代码来源:MainActivity.java

示例6: setContainerScrollEnabled

import lecho.lib.hellocharts.gesture.ContainerScrollType; //导入依赖的package包/类
public void setContainerScrollEnabled(boolean isContainerScrollEnabled, ContainerScrollType containerScrollType) {
    this.isContainerScrollEnabled = isContainerScrollEnabled;
    this.containerScrollType = containerScrollType;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:5,代码来源:AbstractChartView.java

示例7: initLineChart

import lecho.lib.hellocharts.gesture.ContainerScrollType; //导入依赖的package包/类
private void initLineChart() {
        Line line = new Line(mPointValues).setColor(Color.parseColor("#FFFAFA"));  //折线的颜色(橙色)
        List<Line> lines = new ArrayList<>();
        line.setShape(ValueShape.CIRCLE);//折线图上每个数据点的形状  这里是圆形 (有三种 :ValueShape.SQUARE  ValueShape.CIRCLE  ValueShape.DIAMOND)
        line.setCubic(false);//曲线是否平滑,即是曲线还是折线
        line.setFilled(false);//是否填充曲线的面积
        line.setHasLabels(true);//曲线的数据坐标是否加上备注
//      line.setHasLabelsOnlyForSelected(true);//点击数据坐标提示数据(设置了这个line.setHasLabels(true);就无效)
        line.setHasLines(true);//是否用线显示。如果为false 则没有曲线只有点显示
        line.setHasPoints(true);//是否显示圆点 如果为false 则没有原点只有点显示(每个数据点都是个大的圆点)
        lines.add(line);
        LineChartData data = new LineChartData();
        data.setLines(lines);

        //坐标轴
        Axis axisX = new Axis(); //X轴
        axisX.setHasTiltedLabels(true);  //X坐标轴字体是斜的显示还是直的,true是斜的显示
        axisX.setTextColor(Color.WHITE);  //设置字体颜色
        //axisX.setName("date");  //表格名称
        axisX.setTextSize(10);//设置字体大小
        axisX.setMaxLabelChars(8); //最多几个X轴坐标,意思就是你的缩放让X轴上数据的个数7<=x<=mAxisXValues.length
        axisX.setValues(mAxisXValues);  //填充X轴的坐标名称
        data.setAxisXBottom(axisX); //x 轴在底部
        //data.setAxisXTop(axisX);  //x 轴在顶部
        axisX.setHasLines(true); //x 轴分割线

        // Y轴是根据数据的大小自动设置Y轴上限(在下面我会给出固定Y轴数据个数的解决方案)
        Axis axisY = new Axis();

        axisY.setName("");//y轴标注
        // axisY.setTextSize(10);//设置字体大小
        axisY.setTextColor(Color.parseColor("#ffffff"));
        data.setAxisYLeft(axisY);  //Y轴设置在左边
        //data.setAxisYRight(axisY);  //y轴设置在右边


        //设置行为属性,支持缩放、滑动以及平移
        lineChart.setInteractive(true);
        lineChart.setZoomType(ZoomType.HORIZONTAL);
        lineChart.setMaxZoom((float) 2);//最大方法比例
        lineChart.setContainerScrollEnabled(true, ContainerScrollType.HORIZONTAL);
        lineChart.setLineChartData(data);
        lineChart.setVisibility(View.VISIBLE);
        /**注:下面的7,10只是代表一个数字去类比而已
         * 当时是为了解决X轴固定数据个数。见(http://forum.xda-developers.com/tools/programming/library-hellocharts-charting-library-t2904456/page2);
         */
//        Viewport v = new Viewport(lineChart.getMaximumViewport());
//        v.left = 0;
//        v.right= 7;
//        lineChart.setCurrentViewport(v);
    }
 
开发者ID:gojuukaze,项目名称:healthgo,代码行数:52,代码来源:MainActivity.java

示例8: onCreate

import lecho.lib.hellocharts.gesture.ContainerScrollType; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_chart);

    ButterKnife.bind(this);
    chart.setContainerScrollEnabled(true, ContainerScrollType.HORIZONTAL);
    chart.setZoomType(ZoomType.HORIZONTAL);

    ArrayList<com.marco.marplex.schoolbook.models.Materia> list =
            Subjects.getSubjects(this, getIntent().getIntExtra("period", 1));

    int numColumns = list.size();

    // Column can have many subcolumns, here by default I use 1 subcolumn in each column.
    List<Column> columns = new ArrayList<Column>();
    List<SubcolumnValue> values;
    List<AxisValue> axisValues = new ArrayList<AxisValue>();

    for (int i = 0; i < numColumns; ++i) {

        values = new ArrayList<SubcolumnValue>();
        values.add(new SubcolumnValue((float)list.get(i).mediaMateria, ChartUtils.pickColor()));

        axisValues.add(new AxisValue(i).setLabel(list.get(i).testoMateria));

        Column column = new Column(values);
        column.setHasLabels(true);
        column.setHasLabelsOnlyForSelected(false);
        columns.add(column);
    }

    ColumnChartData data = new ColumnChartData(columns);

    Axis axisX = new Axis(axisValues);
    Axis axisY = new Axis().setHasLines(true);
    axisY.setName("Media");
    data.setAxisXBottom(axisX);
    data.setAxisYLeft(axisY);

    chart.setColumnChartData(data);
    chart.setZoomLevel(0,0, 5f);
}
 
开发者ID:Marplex,项目名称:Schoolbook,代码行数:44,代码来源:ChartActivity.java

示例9: setContainerScrollEnabled

import lecho.lib.hellocharts.gesture.ContainerScrollType; //导入依赖的package包/类
/**
 * Set isContainerScrollEnabled to true and containerScrollType to HORIZONTAL or VERTICAL if you are using chart
 * within scroll container.
 */
public void setContainerScrollEnabled(boolean isContainerScrollEnabled, ContainerScrollType containerScrollType);
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:6,代码来源:Chart.java

示例10: setContainerScrollEnabled

import lecho.lib.hellocharts.gesture.ContainerScrollType; //导入依赖的package包/类
void setContainerScrollEnabled(boolean z, ContainerScrollType containerScrollType); 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:2,代码来源:Chart.java


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