com.github.mikephil.charting.charts.BarChart.setOnChartGestureListener()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(1.5k)|赞(0)|评价(0)|浏览(88)

本文整理了Java中com.github.mikephil.charting.charts.BarChart.setOnChartGestureListener()方法的一些代码示例,展示了BarChart.setOnChartGestureListener()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BarChart.setOnChartGestureListener()方法的具体详情如下:
包路径:com.github.mikephil.charting.charts.BarChart
类名称:BarChart
方法名:setOnChartGestureListener

BarChart.setOnChartGestureListener介绍

暂无

代码示例

代码示例来源:origin: PhilJay/MPAndroidChart

@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  View v = inflater.inflate(R.layout.frag_simple_bar, container, false);
  // create a new chart object
  chart = new BarChart(getActivity());
  chart.getDescription().setEnabled(false);
  chart.setOnChartGestureListener(this);
  MyMarkerView mv = new MyMarkerView(getActivity(), R.layout.custom_marker_view);
  mv.setChartView(chart); // For bounds control
  chart.setMarker(mv);
  chart.setDrawGridBackground(false);
  chart.setDrawBarShadow(false);
  Typeface tf = Typeface.createFromAsset(context.getAssets(), "OpenSans-Light.ttf");
  chart.setData(generateBarData(1, 20000, 12));
  Legend l = chart.getLegend();
  l.setTypeface(tf);
  YAxis leftAxis = chart.getAxisLeft();
  leftAxis.setTypeface(tf);
  leftAxis.setAxisMinimum(0f); // this replaces setStartAtZero(true)
  chart.getAxisRight().setEnabled(false);
  XAxis xAxis = chart.getXAxis();
  xAxis.setEnabled(false);
  // programmatically add the chart
  FrameLayout parent = v.findViewById(R.id.parentLayout);
  parent.addView(chart);
  return v;
}

代码示例来源:origin: zhuanghongji/mp-android-chart

mChart.setOnChartGestureListener(this);

相关文章

微信公众号

最新文章

更多