本文整理汇总了Java中com.github.mikephil.charting.components.XAxis.setLabelsToSkip方法的典型用法代码示例。如果您正苦于以下问题:Java XAxis.setLabelsToSkip方法的具体用法?Java XAxis.setLabelsToSkip怎么用?Java XAxis.setLabelsToSkip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.mikephil.charting.components.XAxis
的用法示例。
在下文中一共展示了XAxis.setLabelsToSkip方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setXAxis
import com.github.mikephil.charting.components.XAxis; //导入方法依赖的package包/类
/**
* xAxis config details: https://github.com/PhilJay/MPAndroidChart/wiki/XAxis
*/
@ReactProp(name = "xAxis")
public void setXAxis(Chart chart, ReadableMap propMap) {
XAxis axis = chart.getXAxis();
setCommonAxisConfig(chart, axis, propMap);
if (BridgeUtils.validate(propMap, ReadableType.Number, "labelsToSkip")) {
axis.setLabelsToSkip(propMap.getInt("labelsToSkip"));
}
if (BridgeUtils.validate(propMap, ReadableType.Boolean, "avoidFirstLastClipping")) {
axis.setAvoidFirstLastClipping(propMap.getBoolean("avoidFirstLastClipping"));
}
if (BridgeUtils.validate(propMap, ReadableType.Number, "spaceBetweenLabels")) {
axis.setSpaceBetweenLabels(propMap.getInt("spaceBetweenLabels"));
}
if (BridgeUtils.validate(propMap, ReadableType.String, "position")) {
axis.setPosition(XAxisPosition.valueOf(propMap.getString("position")));
}
}
示例2: onCreate
import com.github.mikephil.charting.components.XAxis; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_scrollview);
mChart = (BarChart) findViewById(R.id.chart1);
mChart.setDescription("");
// scaling can now only be done on x- and y-axis separately
mChart.setPinchZoom(false);
mChart.setDrawBarShadow(false);
mChart.setDrawGridBackground(false);
XAxis xAxis = mChart.getXAxis();
xAxis.setPosition(XAxisPosition.BOTTOM);
xAxis.setLabelsToSkip(0);
xAxis.setDrawGridLines(false);
mChart.getAxisLeft().setDrawGridLines(false);
mChart.getLegend().setEnabled(false);
setData(10);
}
示例3: updateLineChart
import com.github.mikephil.charting.components.XAxis; //导入方法依赖的package包/类
public static LineChart updateLineChart(LineChart chart, int max, List<Entry> entries, List<String> xValues)
{
Resources res = chart.getContext().getResources();
chart.setDrawBorders(false);
XAxis xAxis = chart.getXAxis();
xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
xAxis.setDrawAxisLine(false);
xAxis.setYOffset(32f);
xAxis.setDrawGridLines(false);
xAxis.setLabelsToSkip(0);
xAxis.setTextSize(14);
xAxis.setTextColor(res.getColor(R.color.mm_warm_grey));
xAxis.setTypeface(Typeface.create("sans-serif-medium", Typeface.NORMAL));
YAxis yAxis = chart.getAxisLeft();
yAxis.setDrawAxisLine(false);
yAxis.setDrawGridLines(false);
yAxis.setDrawZeroLine(false);
yAxis.setAxisMaxValue(max + 2);
yAxis.setAxisMinValue(0);
yAxis.setShowOnlyMinMax(true);
yAxis.setTextSize(14);
yAxis.setTextColor(res.getColor(R.color.mm_warm_grey));
yAxis.setTypeface(Typeface.create("sans-serif-medium", Typeface.NORMAL));
chart.getAxisRight().setEnabled(false);
chart.getLegend().setEnabled(false);
chart.setDescription("");
LineDataSet set = new LineDataSet(entries, "");
set.setCircleColor(res.getColor(R.color.mm_colorPrimary));
set.setCircleRadius(4f);
set.setDrawCircleHole(false);
set.setColor(res.getColor(R.color.mm_colorPrimary));
set.setLineWidth(2f);
set.setDrawValues(false);
LineData data = new LineData(xValues, set);
chart.setData(data);
chart.setVisibleXRange(0, 7);
return chart;
}