本文整理汇总了Java中com.github.mikephil.charting.components.XAxis.setDrawLimitLinesBehindData方法的典型用法代码示例。如果您正苦于以下问题:Java XAxis.setDrawLimitLinesBehindData方法的具体用法?Java XAxis.setDrawLimitLinesBehindData怎么用?Java XAxis.setDrawLimitLinesBehindData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.mikephil.charting.components.XAxis
的用法示例。
在下文中一共展示了XAxis.setDrawLimitLinesBehindData方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupActivityChart
import com.github.mikephil.charting.components.XAxis; //导入方法依赖的package包/类
private void setupActivityChart() {
mActivityChart.setBackgroundColor(BACKGROUND_COLOR);
mActivityChart.setDescriptionColor(DESCRIPTION_COLOR);
configureBarLineChartDefaults(mActivityChart);
XAxis x = mActivityChart.getXAxis();
x.setDrawLabels(true);
x.setDrawGridLines(false);
x.setEnabled(true);
x.setTextColor(CHART_TEXT_COLOR);
x.setDrawLimitLinesBehindData(true);
YAxis y = mActivityChart.getAxisLeft();
y.setDrawGridLines(false);
// y.setDrawLabels(false);
// TODO: make fixed max value optional
y.setAxisMaxValue(1f);
y.setAxisMinValue(0);
y.setDrawTopYLabelEntry(false);
y.setTextColor(CHART_TEXT_COLOR);
// y.setLabelCount(5);
y.setEnabled(true);
YAxis yAxisRight = mActivityChart.getAxisRight();
yAxisRight.setDrawGridLines(false);
yAxisRight.setEnabled(supportsHeartrate(getChartsHost().getDevice()));
yAxisRight.setDrawLabels(true);
yAxisRight.setDrawTopYLabelEntry(true);
yAxisRight.setTextColor(CHART_TEXT_COLOR);
yAxisRight.setAxisMaxValue(HeartRateUtils.MAX_HEART_RATE_VALUE);
yAxisRight.setAxisMinValue(HeartRateUtils.MIN_HEART_RATE_VALUE);
}
示例2: setupWeekStepsChart
import com.github.mikephil.charting.components.XAxis; //导入方法依赖的package包/类
private void setupWeekStepsChart() {
mWeekStepsChart.setBackgroundColor(BACKGROUND_COLOR);
mWeekStepsChart.setDescriptionColor(DESCRIPTION_COLOR);
mWeekStepsChart.setDescription("");
configureBarLineChartDefaults(mWeekStepsChart);
XAxis x = mWeekStepsChart.getXAxis();
x.setDrawLabels(true);
x.setDrawGridLines(false);
x.setEnabled(true);
x.setTextColor(CHART_TEXT_COLOR);
x.setDrawLimitLinesBehindData(true);
YAxis y = mWeekStepsChart.getAxisLeft();
y.setDrawGridLines(false);
y.setDrawTopYLabelEntry(false);
y.setTextColor(CHART_TEXT_COLOR);
y.setEnabled(true);
YAxis yAxisRight = mWeekStepsChart.getAxisRight();
yAxisRight.setDrawGridLines(false);
yAxisRight.setEnabled(false);
yAxisRight.setDrawLabels(false);
yAxisRight.setDrawTopYLabelEntry(false);
yAxisRight.setTextColor(CHART_TEXT_COLOR);
}
示例3: setupChart
import com.github.mikephil.charting.components.XAxis; //导入方法依赖的package包/类
private void setupChart() {
mChart.setBackgroundColor(BACKGROUND_COLOR);
mChart.setDescriptionColor(DESCRIPTION_COLOR);
configureBarLineChartDefaults(mChart);
XAxis x = mChart.getXAxis();
x.setDrawLabels(true);
x.setDrawGridLines(false);
x.setEnabled(true);
x.setTextColor(CHART_TEXT_COLOR);
x.setDrawLimitLinesBehindData(true);
YAxis y = mChart.getAxisLeft();
y.setDrawGridLines(false);
// y.setDrawLabels(false);
// TODO: make fixed max value optional
y.setAxisMaxValue(1f);
y.setAxisMinValue(0);
y.setDrawTopYLabelEntry(false);
y.setTextColor(CHART_TEXT_COLOR);
// y.setLabelCount(5);
y.setEnabled(true);
YAxis yAxisRight = mChart.getAxisRight();
yAxisRight.setDrawGridLines(false);
yAxisRight.setEnabled(supportsHeartrate(getChartsHost().getDevice()));
yAxisRight.setDrawLabels(true);
yAxisRight.setDrawTopYLabelEntry(true);
yAxisRight.setTextColor(CHART_TEXT_COLOR);
yAxisRight.setAxisMaxValue(HeartRateUtils.MAX_HEART_RATE_VALUE);
yAxisRight.setAxisMinValue(HeartRateUtils.MIN_HEART_RATE_VALUE);
// refresh immediately instead of use refreshIfVisible(), for perceived performance
refresh();
}
示例4: initChart
import com.github.mikephil.charting.components.XAxis; //导入方法依赖的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));
}
示例5: onCreateView
import com.github.mikephil.charting.components.XAxis; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
view = inflater.inflate(R.layout.fragment_lastscanchart, container, false);
LineChart cv_LastScan = (LineChart) view.findViewById(R.id.cv_LastScan);
cv_LastScan.setOnChartGestureListener(new myChartGestureListener(cv_LastScan));
XAxis xAxis = cv_LastScan.getXAxis();
xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
xAxis.setTextSize(10f);
xAxis.setTextColor(getResources().getColor(R.color.colorGlucoseNow));
xAxis.enableGridDashedLine(5f, 5f, 0f);
xAxis.setDrawLimitLinesBehindData(true);
YAxis yAxisLeft = cv_LastScan.getAxisLeft();
YAxis yAxisRight = cv_LastScan.getAxisRight();
yAxisRight.setEnabled(false);
yAxisLeft.setTextSize(18f); // set the textsize
yAxisLeft.setTextColor(getResources().getColor(R.color.colorGlucoseNow));
yAxisLeft.setPosition(YAxis.YAxisLabelPosition.INSIDE_CHART);
yAxisLeft.setStartAtZero(true);
yAxisLeft.setYOffset(-6f);
yAxisLeft.setAxisMinValue(0.0f);
Legend legend = cv_LastScan.getLegend();
legend.setEnabled(false);
// no description text
cv_LastScan.setDescription("");
cv_LastScan.setNoDataText(getResources().getString(R.string.no_data));
cv_LastScan.setNoDataTextDescription("");
// enable touch gestures
cv_LastScan.setTouchEnabled(true);
// enable scaling and dragging
cv_LastScan.setDragEnabled(true);
cv_LastScan.setScaleEnabled(true);
cv_LastScan.setDrawGridBackground(false);
// if disabled, scaling can be done on x- and y-axis separately
cv_LastScan.setPinchZoom(true);
MyMarkerView mv = new MyMarkerView(view.getContext(), R.layout.custom_marker_view);
// set the marker to the chart
cv_LastScan.setMarkerView(mv);
try {
int sdk = android.os.Build.VERSION.SDK_INT;
if (sdk < android.os.Build.VERSION_CODES.HONEYCOMB) {
cv_LastScan.setHardwareAccelerationEnabled(false);
} else {
cv_LastScan.setHardwareAccelerationEnabled(true);
}
} catch (Exception e) {
}
refresh();
return (view);
}
示例6: initChart
import com.github.mikephil.charting.components.XAxis; //导入方法依赖的package包/类
public void initChart() {
mChart.setDescription("");
mChart.setDragEnabled(false);
mChart.setScaleEnabled(false);
mChart.setPinchZoom(false);
GraphMarkerView markerView = new GraphMarkerView(mChart.getContext(), R.layout.trackdota_graph_marker);
mChart.setMarkerView(markerView);
mChart.setHighlightEnabled(false);
XAxis xAxis = mChart.getXAxis();
xAxis.removeAllLimitLines();
xAxis.setDrawLimitLinesBehindData(true);
xAxis.setDrawGridLines(true);
YAxis leftAxis = mChart.getAxisLeft();
leftAxis.removeAllLimitLines();
leftAxis.setStartAtZero(false);
LimitLine limitLine = new LimitLine(0f);
limitLine.setLineColor(Color.WHITE);
limitLine.setLineWidth(2f);
leftAxis.addLimitLine(limitLine);
mChart.setBackgroundColor(Color.BLACK);
mChart.setDrawBorders(false);
mChart.getLegend().setEnabled(false);
mChart.setDoubleTapToZoomEnabled(false);
mChart.setDrawGridBackground(false);
leftAxis.setValueFormatter(new ValueFormatter() {
@Override
public String getFormattedValue(float value) {
return String.valueOf((int) value);
}
});
leftAxis.setTextColor(Color.WHITE);
mChart.getAxisRight().setEnabled(false);
//mChart.animateX(2500);
clearChart();
}
示例7: setupHistoryChart
import com.github.mikephil.charting.components.XAxis; //导入方法依赖的package包/类
private void setupHistoryChart(BarLineChartBase chart) {
configureBarLineChartDefaults(chart);
chart.setTouchEnabled(false); // no zooming or anything, because it's updated all the time
chart.setBackgroundColor(BACKGROUND_COLOR);
chart.setDescriptionColor(DESCRIPTION_COLOR);
chart.setDescription(getString(R.string.live_activity_steps_per_minute_history));
chart.setNoDataText(getString(R.string.live_activity_start_your_activity));
chart.getLegend().setEnabled(false);
Paint infoPaint = chart.getPaint(Chart.PAINT_INFO);
infoPaint.setTextSize(Utils.convertDpToPixel(20f));
infoPaint.setFakeBoldText(true);
chart.setPaint(infoPaint, Chart.PAINT_INFO);
XAxis x = chart.getXAxis();
x.setDrawLabels(true);
x.setDrawGridLines(false);
x.setEnabled(true);
x.setTextColor(CHART_TEXT_COLOR);
x.setDrawLimitLinesBehindData(true);
YAxis y = chart.getAxisLeft();
y.setDrawGridLines(false);
y.setDrawTopYLabelEntry(false);
y.setTextColor(CHART_TEXT_COLOR);
y.setEnabled(true);
y.setAxisMinValue(0);
YAxis yAxisRight = chart.getAxisRight();
yAxisRight.setDrawGridLines(false);
yAxisRight.setEnabled(true);
yAxisRight.setDrawLabels(true);
yAxisRight.setDrawTopYLabelEntry(false);
yAxisRight.setTextColor(CHART_TEXT_COLOR);
yAxisRight.setAxisMaxValue(HeartRateUtils.MAX_HEART_RATE_VALUE);
yAxisRight.setAxisMinValue(HeartRateUtils.MIN_HEART_RATE_VALUE);
mHistorySet = new LineDataSet(new ArrayList<Entry>(), getString(R.string.live_activity_steps_history));
mHistorySet.setAxisDependency(YAxis.AxisDependency.LEFT);
mHistorySet.setColor(akActivity.color);
mHistorySet.setDrawCircles(false);
mHistorySet.setDrawCubic(true);
mHistorySet.setDrawFilled(true);
mHistorySet.setDrawValues(false);
mHeartRateSet = createHeartrateSet(new ArrayList<Entry>(), getString(R.string.live_activity_heart_rate));
mHeartRateSet.setDrawValues(false);
}