当前位置: 首页>>代码示例>>Java>>正文


Java XAxis.setXOffset方法代码示例

本文整理汇总了Java中com.github.mikephil.charting.components.XAxis.setXOffset方法的典型用法代码示例。如果您正苦于以下问题:Java XAxis.setXOffset方法的具体用法?Java XAxis.setXOffset怎么用?Java XAxis.setXOffset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.github.mikephil.charting.components.XAxis的用法示例。


在下文中一共展示了XAxis.setXOffset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setAxis

import com.github.mikephil.charting.components.XAxis; //导入方法依赖的package包/类
@Override
public void setAxis(AnalysisXAxisValueFormatter formatter, float yAxisMaxValue) {

    XAxis xAxis = mRadarChart.getXAxis();
    xAxis.setTextSize(9f);
    xAxis.setYOffset(0f);
    xAxis.setXOffset(0f);
    xAxis.setValueFormatter(formatter);
    xAxis.setTextColor(Color.WHITE);

    YAxis yAxis = mRadarChart.getYAxis();
    yAxis.setLabelCount(5, false);
    yAxis.setTextSize(9f);
    yAxis.setAxisMinimum(0f);
    yAxis.setAxisMaximum(yAxisMaxValue);
    yAxis.setDrawLabels(false);

    Legend l = mRadarChart.getLegend();
    l.setVerticalAlignment(Legend.LegendVerticalAlignment.TOP);
    l.setHorizontalAlignment(Legend.LegendHorizontalAlignment.CENTER);
    l.setOrientation(Legend.LegendOrientation.HORIZONTAL);
    l.setDrawInside(false);
    l.setXEntrySpace(7f);
    l.setYEntrySpace(5f);
    l.setTextColor(Color.WHITE);
}
 
开发者ID:Alex-ZHOU,项目名称:VMAndroid,代码行数:27,代码来源:AnalysisChartFragment.java

示例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_radarchart_noseekbar);

    TextView tv = (TextView) findViewById(R.id.textView);
    tv.setTypeface(mTfLight);
    tv.setTextColor(Color.WHITE);
    tv.setBackgroundColor(Color.rgb(60, 65, 82));

    mChart = (RadarChart) findViewById(R.id.chart1);
    mChart.setBackgroundColor(Color.rgb(60, 65, 82));

    mChart.getDescription().setEnabled(false);

    mChart.setWebLineWidth(1f);
    mChart.setWebColor(Color.LTGRAY);
    mChart.setWebLineWidthInner(1f);
    mChart.setWebColorInner(Color.LTGRAY);
    mChart.setWebAlpha(100);

    // create a custom MarkerView (extend MarkerView) and specify the layout
    // to use for it
    MarkerView mv = new RadarMarkerView(this, R.layout.radar_markerview);
    mv.setChartView(mChart); // For bounds control
    mChart.setMarker(mv); // Set the marker to the chart

    setData();

    mChart.animateXY(
            1400, 1400,
            Easing.EasingOption.EaseInOutQuad,
            Easing.EasingOption.EaseInOutQuad);

    XAxis xAxis = mChart.getXAxis();
    xAxis.setTypeface(mTfLight);
    xAxis.setTextSize(9f);
    xAxis.setYOffset(0f);
    xAxis.setXOffset(0f);
    xAxis.setValueFormatter(new IAxisValueFormatter() {

        private String[] mActivities = new String[]{"Burger", "Steak", "Salad", "Pasta", "Pizza"};

        @Override
        public String getFormattedValue(float value, AxisBase axis) {
            return mActivities[(int) value % mActivities.length];
        }
    });
    xAxis.setTextColor(Color.WHITE);

    YAxis yAxis = mChart.getYAxis();
    yAxis.setTypeface(mTfLight);
    yAxis.setLabelCount(5, false);
    yAxis.setTextSize(9f);
    yAxis.setAxisMinimum(0f);
    yAxis.setAxisMaximum(80f);
    yAxis.setDrawLabels(false);

    Legend l = mChart.getLegend();
    l.setVerticalAlignment(Legend.LegendVerticalAlignment.TOP);
    l.setHorizontalAlignment(Legend.LegendHorizontalAlignment.CENTER);
    l.setOrientation(Legend.LegendOrientation.HORIZONTAL);
    l.setDrawInside(false);
    l.setTypeface(mTfLight);
    l.setXEntrySpace(7f);
    l.setYEntrySpace(5f);
    l.setTextColor(Color.WHITE);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:71,代码来源:RadarChartActivitry.java


注:本文中的com.github.mikephil.charting.components.XAxis.setXOffset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。