本文整理了Java中com.github.mikephil.charting.charts.BarChart.<init>()
方法的一些代码示例,展示了BarChart.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BarChart.<init>()
方法的具体详情如下:
包路径:com.github.mikephil.charting.charts.BarChart
类名称:BarChart
方法名:<init>
暂无
代码示例来源: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 = new BarChart(getActivity());
mChart.getDescription().setEnabled(false);
mChart.setOnChartGestureListener(this);
内容来源于网络,如有侵权,请联系作者删除!