本文整理汇总了Java中com.github.mikephil.charting.charts.LineChart.setDoubleTapToZoomEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java LineChart.setDoubleTapToZoomEnabled方法的具体用法?Java LineChart.setDoubleTapToZoomEnabled怎么用?Java LineChart.setDoubleTapToZoomEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.mikephil.charting.charts.LineChart
的用法示例。
在下文中一共展示了LineChart.setDoubleTapToZoomEnabled方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import com.github.mikephil.charting.charts.LineChart; //导入方法依赖的package包/类
private void init(){
inflate(getContext(), R.layout.view_chart, this);
mToolbar = (Toolbar) findViewById(R.id.chart_toolbar);
mLineChart = (LineChart) findViewById(R.id.chart);
mToolbar.inflateMenu(R.menu.chart);
mToolbar.setOnMenuItemClickListener(this);
mLineChart.getLegend().setEnabled(false);
mLineChart.getXAxis().setDrawLabels(false);
mLineChart.getAxisLeft().setDrawLabels(true);
mLineChart.getAxisRight().setDrawLabels(false);
mLineChart.setDescription("");
mLineChart.setPinchZoom(false);
mLineChart.setDoubleTapToZoomEnabled(false);
}
示例2: ChartViewHolder
import com.github.mikephil.charting.charts.LineChart; //导入方法依赖的package包/类
public ChartViewHolder(View itemView) {
super(itemView);
mChart = (LineChart) itemView.findViewById(R.id.chart);
mChart.getXAxis().setPosition(XAxis.XAxisPosition.BOTTOM);
mChart.getAxisRight().setEnabled(false);
mChart.setTouchEnabled(false);
mChart.setDoubleTapToZoomEnabled(false);
mChart.setPinchZoom(false);
mChart.setDescription("");
}
示例3: getFormattedLineChart
import com.github.mikephil.charting.charts.LineChart; //导入方法依赖的package包/类
/**
* Formats a line chart in a standardized manner
* @param c App context
* @param chart LineChart to format
* @param listener Listener to attach to chart
* @param xLabels Labels to use for the x-axis
* @param valueFormatter True if large value formatter should be used
* @param skip Number of values to skip
* @param legend True if show legend, false if hide legend
* @return Formatted linechart
*/
public static LineChart getFormattedLineChart(Context c, LineChart chart, OnChartValueSelectedListener listener, List<String> xLabels, boolean valueFormatter, int skip, boolean legend) {
Legend cLegend = chart.getLegend();
cLegend.setEnabled(legend);
XAxis xAxis = chart.getXAxis();
xAxis.setGranularity(skip);
xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
xAxis.setValueFormatter(new XAxisLabelFormatter(xLabels));
YAxis yAxisRight = chart.getAxisRight();
yAxisRight.setEnabled(false);
YAxis yAxisLeft = chart.getAxisLeft();
if (valueFormatter) {
yAxisLeft.setValueFormatter(new LargeNumberAxisFormatter(c));
}
if (SettingsActivity.getTheme(c) == SettingsActivity.THEME_NOIR) {
int textColorNoir = ContextCompat.getColor(c, R.color.colorPrimaryTextNoir);
cLegend.setTextColor(textColorNoir);
xAxis.setTextColor(textColorNoir);
yAxisLeft.setTextColor(textColorNoir);
}
chart.setDoubleTapToZoomEnabled(false);
chart.setDescription(EMPTY_CHART_DESCRIPTION);
chart.setDragEnabled(true);
chart.setScaleYEnabled(false);
chart.setDrawGridBackground(false);
chart.setOnChartValueSelectedListener(listener);
return chart;
}
示例4: onCreateView
import com.github.mikephil.charting.charts.LineChart; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View V = inflater.inflate(R.layout.tide_fragment, container, false);
// Setup the tide chart
LineChart tideChart = (LineChart) V.findViewById(R.id.tide_chart);
tideChart.setDrawBorders(false);
tideChart.setDescription("");
tideChart.setPinchZoom(false);
tideChart.setDoubleTapToZoomEnabled(false);
tideChart.setDrawMarkerViews(false);
tideChart.setTouchEnabled(false);
tideChart.setViewPortOffsets(0f, 0f, 0f, 0f);
// X Axis
XAxis xAxis = tideChart.getXAxis();
xAxis.setDrawGridLines(false);
xAxis.setDrawAxisLine(false);
xAxis.setDrawLabels(false);
// Y Axis
YAxis leftYAxis = tideChart.getAxisLeft();
YAxis rightYAxis = tideChart.getAxisRight();
leftYAxis.setDrawGridLines(false);
rightYAxis.setDrawGridLines(false);
leftYAxis.setDrawAxisLine(false);
rightYAxis.setDrawAxisLine(false);
leftYAxis.setDrawLabels(false);
rightYAxis.setDrawLabels(false);
leftYAxis.setDrawZeroLine(false);
rightYAxis.setDrawZeroLine(false);
// Legend
tideChart.getLegend().setEnabled(false);
return V;
}