本文整理汇总了Java中lecho.lib.hellocharts.view.LineChartView.setZoomEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java LineChartView.setZoomEnabled方法的具体用法?Java LineChartView.setZoomEnabled怎么用?Java LineChartView.setZoomEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lecho.lib.hellocharts.view.LineChartView
的用法示例。
在下文中一共展示了LineChartView.setZoomEnabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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_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;
}
示例2: setupChart
import lecho.lib.hellocharts.view.LineChartView; //导入方法依赖的package包/类
private static void setupChart(Context context, LineChartView chart, List<AxisValue> xAxisValues, String yAxisLabel, List<Line> lines) {
Axis xAxis = new Axis(xAxisValues);
ChartUtils.setupXAxis(context, xAxis);
Axis yAxis = new Axis();
ChartUtils.setupYAxis(context, yAxisLabel, yAxis);
LineChartData lineChartData = new LineChartData();
lineChartData.setAxisXBottom(xAxis);
lineChartData.setAxisYLeft(yAxis);
lineChartData.setLines(lines);
chart.setZoomEnabled(true);
chart.setZoomType(ZoomType.HORIZONTAL);
chart.setLineChartData(lineChartData);
resetViewport(chart);
}