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


Java LineChartView类代码示例

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


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

示例1: onCreateView

import lecho.lib.hellocharts.view.LineChartView; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    setHasOptionsMenu(true);
    View rootView = inflater.inflate(R.layout.fragment_line_chart, container, false);

    chart = (LineChartView) rootView.findViewById(R.id.chart);
    chart.setOnValueTouchListener(new ValueTouchListener());

    // Generate some random values.
    generateValues();

    generateData();

    // Disable viewport recalculations, see toggleCubic() method for more info.
    chart.setViewportCalculationEnabled(false);

    resetViewport();

    return rootView;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:21,代码来源:LineChartActivity.java

示例2: 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

示例3: onCreateView

import lecho.lib.hellocharts.view.LineChartView; //导入依赖的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

示例4: LineChartRenderer

import lecho.lib.hellocharts.view.LineChartView; //导入依赖的package包/类
public LineChartRenderer(Context context, Chart chart, LineChartDataProvider dataProvider, LineChartView lineChartView) {
    super(context, chart);
    this.dataProvider = dataProvider;
    this.lineChartView = lineChartView;
    this.touchToleranceMargin = ChartUtils.dp2px(this.density, 4);
    this.linePaint.setAntiAlias(true);
    this.linePaint.setStyle(Style.STROKE);
    this.linePaint.setStrokeCap(Cap.ROUND);
    this.linePaint.setStrokeWidth((float) ChartUtils.dp2px(this.density, 3));
    this.pointPaint.setAntiAlias(true);
    this.pointPaint.setStyle(Style.FILL);
    this.weightStrPaint.setAntiAlias(true);
    this.weightStrPaint.setColor(-1);
    this.weightStrPaint.setTextSize((float) ChartUtils.dp2px(this.density, 12));
    this.weightLinePaint.setAntiAlias(true);
    this.weightLinePaint.setStyle(Style.STROKE);
    this.weightLinePaint.setStrokeWidth((float) ChartUtils.dp2px(this.density, 1));
    this.weightLinePaint.setColor(ChartUtils.DEFAULT_TARGET_COLOR);
    this.checkPrecision = ChartUtils.dp2px(this.density, 2);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:21,代码来源:LineChartRenderer.java

示例5: onActivityCreated

import lecho.lib.hellocharts.view.LineChartView; //导入依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState){
    super.onActivityCreated(savedInstanceState);

    mLineView=(LineChartView)view.findViewById(R.id.disease_num_linechart);
    mColumnView=(ColumnChartView)view.findViewById(R.id.disease_num_columnchart);

    //初始化数据
    //设置初始线型图数据
    setInitialLineDatas();
    //设置柱状图数据,禁用缩放
    setColumnDatas();

    //设置点击事件
    mLineView.setOnValueTouchListener(new LineValueTouchListener());
    mColumnView.setOnValueTouchListener(new ColumnValueTouchListener());

}
 
开发者ID:lupwei,项目名称:Croprotector,代码行数:19,代码来源:disease_num_chart_fragment.java

示例6: onCreateView

import lecho.lib.hellocharts.view.LineChartView; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);

    View rootView = inflater.inflate(R.layout.fragment_chart_expenses, container, false);
    chart = (LineChartView) rootView.findViewById(R.id.chart_expenses_linechart);
    mNoExpensesContainer = (RelativeLayout) rootView.findViewById(R.id.chart_expenses_no_expenses_container);

    try {
        activeCreditCardId = SharedPreferencesUtils.getInt(getContext(), Constants.ACTIVE_CC_ID);
    }catch(SharedPreferenceNotFoundException e) {
        //This shouldn't happen
        //Toast.makeText(getActivity(), "Megapeo en oncreate, SharedPreferenceNotFoundException CreditCardNotFoundException", Toast.LENGTH_SHORT).show();
    }

    refreshData();
    return rootView;
}
 
开发者ID:abicelis,项目名称:CreditCardExpenseManager,代码行数:20,代码来源:ChartExpenseFragment.java

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

示例8: showContentView

import lecho.lib.hellocharts.view.LineChartView; //导入依赖的package包/类
private void showContentView(int position) {
        switch (position) {
            case 0://表格
                tableFrameLayout.setVisibility(View.VISIBLE);
                tuFrameLayout.setVisibility(View.GONE);
                break;
            case 1:
//                if(lineChartView == null) {
                LogUtil.i(getTAG(), "create linechartview");
                lineChartView = new LineChartView(getActivity());
                initLineChart();
                tuFrameLayout.addView(lineChartView);
//                }
                tableFrameLayout.setVisibility(View.GONE);
                tuFrameLayout.setVisibility(View.VISIBLE);
                updateLineChart();
                break;
        }
    }
 
开发者ID:lvjianjian,项目名称:MyHealth,代码行数:20,代码来源:AbstractHistoryFragment.java

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

示例10: 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();
}
 
开发者ID:StephenBlackWasAlreadyTaken,项目名称:NightWatch,代码行数:20,代码来源:Home.java

示例11: onCreateView

import lecho.lib.hellocharts.view.LineChartView; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    setHasOptionsMenu(true);
    View rootView = inflater.inflate(R.layout.fragment_line_chart, container, false);

    chart = (LineChartView) rootView.findViewById(R.id.chart);
    chart.setOnValueTouchListener(new ValueTouchListener());

    // Generate some randome values.
    getValues();

    generateData();

    // Disable viewpirt recalculations, see toggleCubic() method for more info.
    chart.setViewportCalculationEnabled(false);

    resetViewport();

    return rootView;
}
 
开发者ID:vaslabs,项目名称:SDC,代码行数:21,代码来源:MainFragment.java

示例12: populateMeetingDurationChart

import lecho.lib.hellocharts.view.LineChartView; //导入依赖的package包/类
public static void populateMeetingDurationChart(Context context, LineChartView chart, @NonNull Cursor cursor) {
    List<PointValue> points = new ArrayList<>();
    List<AxisValue> xAxisValues = new ArrayList<>();

    MeetingCursorWrapper cursorWrapper = new MeetingCursorWrapper(cursor);
    while (cursorWrapper.moveToNext()) {
        Meeting meeting = Meeting.read(context, cursorWrapper);
        points.add(getMeetingDurationPointValue(meeting));
        xAxisValues.add(getMeetingDurationXAxisValue(context, meeting));
    }
    cursor.moveToPosition(-1);

    int lineColor = ResourcesCompat.getColor(context.getResources(), R.color.scrum_chatter_primary_color, null);
    Line line = new Line(points);
    line.setColor(lineColor);
    List<Line> lines = new ArrayList<>();
    lines.add(line);

    LineChartData lineChartData = new LineChartData();
    lineChartData.setLines(lines);
    setupChart(context,
            chart,
            xAxisValues,
            context.getString(R.string.chart_duration),
            lines);
}
 
开发者ID:caarmen,项目名称:scrumchatter,代码行数:27,代码来源:MeetingDurationLineChart.java

示例13: initLine

import lecho.lib.hellocharts.view.LineChartView; //导入依赖的package包/类
public void initLine(Context context, LineChartView lineChart, String beginDate, String
        endDate, List<WeightRecord> weightRecords, float targetWeight, String targetDate,
                     float viewportLeft, float viewportRight, int typeMode, boolean
                             isLandscape) {
    this.mContext = context;
    this.mBeginDate = beginDate;
    this.mEndDate = endDate;
    this.mWeightRecords = weightRecords;
    this.lineChart = lineChart;
    this.mViewportLeft = viewportLeft;
    this.mViewportRight = viewportRight;
    this.mTypeMode = typeMode;
    this.mIsLandscape = isLandscape;
    this.mTargetWeight = targetWeight;
    this.mTargetDate = targetDate;
    this.resources = context.getResources();
    if (this.lineChart != null) {
        this.mXDates = DateFormatUtils.getEveryday(beginDate, endDate);
        if (this.mXDates != null && this.mXDates.size() != 0) {
            if (this.mWeightRecords == null || this.mWeightRecords.size() == 0) {
                this.mPointValues = getYValsForNone(this.mXDates.size());
            } else {
                this.mPointValues = getYVals(this.mWeightRecords);
            }
            if (this.mPointValues != null && this.mPointValues.size() != 0) {
                this.mAxisValues = getXals();
                if (this.mAxisValues != null && this.mAxisValues.size() != 0) {
                    setViewport();
                    setLineData();
                }
            }
        }
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:35,代码来源:ChartHelper.java

示例14: initLine

import lecho.lib.hellocharts.view.LineChartView; //导入依赖的package包/类
public void initLine(Context context, LineChartView lineChart, String beginDate, String
        endDate, List<Measure> measures, float viewportLeft, float viewportRight, int
        typeMode, boolean isLandscape) {
    this.mContext = context;
    this.mBeginDate = beginDate;
    this.mEndDate = endDate;
    this.mWeightRecords = measures;
    this.lineChart = lineChart;
    this.mViewportLeft = viewportLeft;
    this.mViewportRight = viewportRight;
    this.mTypeMode = typeMode;
    this.resources = context.getResources();
    this.mXDates = DateFormatUtils.getEveryday(beginDate, endDate);
    if (this.mXDates != null && this.mXDates.size() != 0) {
        if (measures == null || measures.size() == 0) {
            this.mPointValues = getYValsForNone(this.mXDates.size());
        } else {
            this.mPointValues = getYVals(measures);
        }
        if (this.mPointValues != null && this.mPointValues.size() != 0) {
            this.mAxisValues = getXals();
            if (this.mAxisValues != null && this.mAxisValues.size() != 0) {
                setViewport();
                setLinData();
            }
        }
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:29,代码来源:ChartMeasureHelper.java

示例15: inject

import lecho.lib.hellocharts.view.LineChartView; //导入依赖的package包/类
public void inject(Finder finder, T target, Object source) {
    target.lineChart = (LineChartView) finder.castView((View) finder.findRequiredView(source,
            R.id.linechart, "field 'lineChart'"), R.id.linechart, "field 'lineChart'");
    target.rg_weight = (RadioGroup) finder.castView((View) finder.findRequiredView(source, R
            .id.rg_weight, "field 'rg_weight'"), R.id.rg_weight, "field 'rg_weight'");
    target.ll_content = (LinearLayout) finder.castView((View) finder.findRequiredView(source,
            R.id.ll_content, "field 'll_content'"), R.id.ll_content, "field 'll_content'");
    target.txt_orientation = (TextView) finder.castView((View) finder.findRequiredView
            (source, R.id.txt_orientation, "field 'txt_orientation'"), R.id.txt_orientation,
            "field 'txt_orientation'");
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:12,代码来源:WeightCurveActivity$$ViewInjector.java


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