本文整理汇总了Java中com.github.mikephil.charting.charts.BarChart.setDrawBorders方法的典型用法代码示例。如果您正苦于以下问题:Java BarChart.setDrawBorders方法的具体用法?Java BarChart.setDrawBorders怎么用?Java BarChart.setDrawBorders使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.mikephil.charting.charts.BarChart
的用法示例。
在下文中一共展示了BarChart.setDrawBorders方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initChart
import com.github.mikephil.charting.charts.BarChart; //导入方法依赖的package包/类
private void initChart(BarChart chart) {
float scaledDensity = getResources().getDisplayMetrics().scaledDensity;
chart.setDragEnabled(true);
chart.setScaleYEnabled(false);
chart.setScaleXEnabled(false);
chart.setDoubleTapToZoomEnabled(false);
chart.setPinchZoom(false);
chart.setHighlightPerDragEnabled(false);
chart.setHighlightPerTapEnabled(false);
chart.setDrawGridBackground(false);
chart.setDrawBorders(false);
chart.setDrawValueAboveBar(false);
chart.getAxisLeft().setEnabled(false);
XAxis xAxis = chart.getXAxis();
xAxis.setDrawAxisLine(true);
xAxis.setDrawGridLines(false);
xAxis.setDrawLabels(false);
xAxis.setDrawLimitLinesBehindData(false);
xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
YAxis yAxis = chart.getAxisRight();
yAxis.setDrawAxisLine(false);
yAxis.setStartAtZero(false);
yAxis.setSpaceTop(10f);
yAxis.setSpaceBottom(0f);
yAxis.setTextSize(10 * scaledDensity);
yAxis.setTextColor(ContextCompat.getColor(this, R.color.text));
chart.getLegend().setEnabled(false);
chart.setDescription(" ");
chart.setNoDataText("Can't see sh*t captain!");
Paint p = chart.getPaint(Chart.PAINT_INFO);
DisplayMetrics dm = getResources().getDisplayMetrics();
int size = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, 18, dm); //TODO use styles
p.setTextSize(size);
p.setColor(ContextCompat.getColor(this, R.color.gray600));
p.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
}
示例2: initializeViews
import com.github.mikephil.charting.charts.BarChart; //导入方法依赖的package包/类
private void initializeViews() {
titleTextView = (TextView) findViewById(R.id.view_chart_bar_title);
titleTextView.setText(titleText);
titleTextView.setTextColor(titleTextColor);
titleTextView.setTextSize(TypedValue.COMPLEX_UNIT_PX, titleTextSize);
titleTextView.setTypeface(Typeface.create(titleTextTypeface, Typeface.NORMAL));
expand = (ImageView) findViewById(R.id.view_chart_line_expand);
if (expandTintColor != 0) {
Drawable drawable = expand.getDrawable();
drawable = DrawableCompat.wrap(drawable);
DrawableCompat.setTint(drawable, expandTintColor);
expand.setImageDrawable(drawable);
}
chart = (BarChart) findViewById(R.id.view_chart_bar);
chart.getLegend().setEnabled(false);
chart.setDescription("");
chart.setDrawBorders(false);
chart.setDrawValueAboveBar(false);
chart.setDrawGridBackground(false);
chart.setDrawBarShadow(false);
chart.setDrawHighlightArrow(false);
chart.setPinchZoom(false);
chart.setExtraLeftOffset(0);
chart.setExtraRightOffset(0);
chart.setExtraBottomOffset(8);
chart.setExtraTopOffset(0);
chart.setTouchEnabled(true);
chart.setDragEnabled(true);
XAxis xAxis = chart.getXAxis();
xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
xAxis.setDrawAxisLine(false);
xAxis.setYOffset(16);
xAxis.setDrawGridLines(false);
xAxis.setLabelsToSkip(0);
xAxis.setTextSize(chartXAxisTextSize);
xAxis.setTextColor(chartXAxisTextColor);
xAxis.setTypeface(Typeface.create(chartXAxisTextTypeface, Typeface.NORMAL));
YAxis yAxisLeft = chart.getAxisLeft();
yAxisLeft.setDrawAxisLine(false);
yAxisLeft.setDrawGridLines(false);
yAxisLeft.setDrawZeroLine(false);
yAxisLeft.setDrawLabels(false);
YAxis yAxisRight = chart.getAxisRight();
yAxisRight.setDrawAxisLine(false);
yAxisRight.setDrawGridLines(false);
yAxisRight.setDrawZeroLine(false);
yAxisRight.setDrawLabels(false);
}