本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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);
}
示例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());
}
示例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;
}
示例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());
}
示例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;
}
}
示例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());
}
示例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();
}
示例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;
}
示例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);
}
示例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();
}
}
}
}
}
示例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();
}
}
}
}
示例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'");
}