本文整理匯總了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);
}