本文整理汇总了Java中lecho.lib.hellocharts.view.LineChartView.setOnValueTouchListener方法的典型用法代码示例。如果您正苦于以下问题:Java LineChartView.setOnValueTouchListener方法的具体用法?Java LineChartView.setOnValueTouchListener怎么用?Java LineChartView.setOnValueTouchListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lecho.lib.hellocharts.view.LineChartView
的用法示例。
在下文中一共展示了LineChartView.setOnValueTouchListener方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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());
}
示例3: 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());
}
示例4: 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());
}
示例5: 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;
}
示例6: setupCharts
import lecho.lib.hellocharts.view.LineChartView; //导入方法依赖的package包/类
private void setupCharts() {
bgGraphBuilder = new BgGraphBuilder(this);
updateStuff = false;
chart = (LineChartView) findViewById(R.id.chart);
chart.setZoomType(ZoomType.HORIZONTAL);
//Transmitter Battery Level
final Sensor sensor = Sensor.currentSensor();
if (sensor != null && sensor.latest_battery_level != 0 && sensor.latest_battery_level <= Constants.TRANSMITTER_BATTERY_LOW && ! mPreferences.getBoolean("disable_battery_warning", false)) {
Drawable background = new Drawable() {
@Override
public void draw(Canvas canvas) {
DisplayMetrics metrics = getApplicationContext().getResources().getDisplayMetrics();
int px = (int) (30 * (metrics.densityDpi / 160f));
Paint paint = new Paint();
paint.setTextSize(px);
paint.setAntiAlias(true);
paint.setColor(Color.parseColor("#FFFFAA"));
paint.setStyle(Paint.Style.STROKE);
paint.setAlpha(100);
canvas.drawText("transmitter battery", 10, chart.getHeight() / 3 - (int) (1.2 * px), paint);
if(sensor.latest_battery_level <= Constants.TRANSMITTER_BATTERY_EMPTY){
paint.setTextSize((int)(px*1.5));
canvas.drawText("VERY LOW", 10, chart.getHeight() / 3, paint);
} else {
canvas.drawText("low", 10, chart.getHeight() / 3, paint);
}
}
@Override
public void setAlpha(int alpha) {}
@Override
public void setColorFilter(ColorFilter cf) {}
@Override
public int getOpacity() {return 0;}
};
chart.setBackground(background);
}
previewChart = (PreviewLineChartView) findViewById(R.id.chart_preview);
previewChart.setZoomType(ZoomType.HORIZONTAL);
chart.setLineChartData(bgGraphBuilder.lineData());
chart.setOnValueTouchListener(bgGraphBuilder.getOnValueSelectTooltipListener());
previewChart.setLineChartData(bgGraphBuilder.previewLineData());
updateStuff = true;
previewChart.setViewportCalculationEnabled(true);
chart.setViewportCalculationEnabled(true);
previewChart.setViewportChangeListener(new ViewportListener());
chart.setViewportChangeListener(new ChartViewPortListener());
setViewport();
}
示例7: onCreateView
import lecho.lib.hellocharts.view.LineChartView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
overviewView = inflater.inflate(R.layout.fragment_overview, container, false);
userLineSeparator = overviewView.findViewById(R.id.userLineSeparator);
context = overviewView.getContext();
txtTitleUser = (TextView) overviewView.findViewById(R.id.txtTitleUser);
txtTitleLastMeasurement = (TextView) overviewView.findViewById(R.id.txtTitleLastMeasurment);
tableOverviewLayout = (TableLayout)overviewView.findViewById(R.id.tableLayoutMeasurements);
overviewMeasurements = new ArrayList<>();
overviewMeasurements.add(new WeightMeasurementView(context));
overviewMeasurements.add(new BMIMeasurementView(context));
overviewMeasurements.add(new WaterMeasurementView(context));
overviewMeasurements.add(new MuscleMeasurementView(context));
overviewMeasurements.add(new LBWMeasurementView(context));
overviewMeasurements.add(new FatMeasurementView(context));
overviewMeasurements.add(new BoneMeasurementView(context));
overviewMeasurements.add(new WaistMeasurementView(context));
overviewMeasurements.add(new WHtRMeasurementView(context));
overviewMeasurements.add(new HipMeasurementView(context));
overviewMeasurements.add(new WHRMeasurementView(context));
overviewMeasurements.add(new BMRMeasurementView(context));
for (MeasurementView measurement : overviewMeasurements) {
tableOverviewLayout.addView(measurement);
}
pieChartLast = (PieChartView) overviewView.findViewById(R.id.pieChartLast);
lineChartLast = (LineChartView) overviewView.findViewById(R.id.lineChartLast);
spinUser = (Spinner) overviewView.findViewById(R.id.spinUser);
lineChartLast.setOnValueTouchListener(new LineChartTouchListener());
pieChartLast.setOnValueTouchListener(new PieChartLastTouchListener());
pieChartLast.setChartRotationEnabled(false);
userSelectedData = null;
spinUserAdapter = new ArrayAdapter<>(overviewView.getContext(), R.layout.support_simple_spinner_dropdown_item, new ArrayList<String>());
spinUser.setAdapter(spinUserAdapter);
// Set item select listener after spinner is created because otherwise item listener fires a lot!?!?
spinUser.post(new Runnable() {
public void run() {
spinUser.setOnItemSelectedListener(new spinUserSelectionListener());
updateUserSelection();
}
});
OpenScale.getInstance(getContext()).registerFragment(this);
return overviewView;
}