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


Java YAxis.setDrawLabels方法代码示例

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


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

示例1: setAxis

import com.github.mikephil.charting.components.YAxis; //导入方法依赖的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: onDownloadRateSuccessful

import com.github.mikephil.charting.components.YAxis; //导入方法依赖的package包/类
public void onDownloadRateSuccessful() {
    ArrayList<BarDataSet> dataSets;

    ArrayList<BarEntry> valueSet1 = new ArrayList<>();
    BarEntry v1e1 = new BarEntry(ratee.fivestar, 0); // Jan
    valueSet1.add(v1e1);
    BarEntry v1e2 = new BarEntry(ratee.fourstar, 1); // Feb
    valueSet1.add(v1e2);
    BarEntry v1e3 = new BarEntry(ratee.threestar, 2); // Mar
    valueSet1.add(v1e3);
    BarEntry v1e4 = new BarEntry(ratee.twostar, 3); // Apr
    valueSet1.add(v1e4);
    BarEntry v1e5 = new BarEntry(ratee.onestar, 4); // May
    valueSet1.add(v1e5);


    BarDataSet barDataSet1 = new BarDataSet(valueSet1, "");
    barDataSet1.setColors(ColorTemplate.COLORFUL_COLORS);


    dataSets = new ArrayList<>();
    dataSets.add(barDataSet1);
    BarData data = new BarData(getXAxisValues(), dataSets);
    //        barDataSet1.setValueTextSize(2);
    data.setValueFormatter(new MyValueFormatter());
    chart.setData(data);
    chart.getXAxis().setEnabled(false); // hides horizontal grid lines inside chart
    YAxis leftAxis = chart.getAxisLeft();
    chart.getAxisRight().setEnabled(false); // hides horizontal grid lines with below line
    leftAxis.setEnabled(false); // hides vertical grid lines  inside chart
        /*chart.animateXY(2000, 2000);*/ // for animating reviews display
    chart.invalidate();

    chart.setDescription("");    // Hide the description

    chart.setPinchZoom(true);

    leftAxis.setDrawLabels(true);
}
 
开发者ID:sega4revenge,项目名称:Sega,代码行数:40,代码来源:ProductDetailFragment.java

示例3: setupYAxes

import com.github.mikephil.charting.components.YAxis; //导入方法依赖的package包/类
private void setupYAxes(BarLineChartBase chart) {
    YAxis y = chart.getAxisLeft();
    y.setDrawZeroLine(true);
    y.setDrawLabels(false);
    y.setDrawGridLines(false);
    y.setDrawAxisLine(false);
    y.setAxisMinimum(0);
    y = chart.getAxisRight();
    y.setDrawZeroLine(true);
    y.setDrawLabels(false);
    y.setDrawGridLines(false);
    y.setDrawAxisLine(false);
    y.setAxisMinimum(0);
}
 
开发者ID:jasonwyatt,项目名称:SQLite-Performance,代码行数:15,代码来源:TestSuiteFragment.java

示例4: init

import com.github.mikephil.charting.components.YAxis; //导入方法依赖的package包/类
private void init(Context context, AttributeSet attrs, int defStyle) {
    setDrawBarShadow(false);
    setDrawValueAboveBar(true);
    getDescription().setEnabled(false);
    setMaxVisibleValueCount(60);
    setDrawGridBackground(false);

    XAxis xl = getXAxis();
    xl.setPosition(XAxis.XAxisPosition.BOTTOM);
    xl.setDrawAxisLine(true);
    xl.setDrawGridLines(false);
    xl.setGranularity(10f);
    xl.setTextColor(Color.GRAY);

    YAxis yl = getAxisLeft();
    yl.setDrawAxisLine(false);
    yl.setDrawGridLines(false);
    yl.setDrawLabels(false);
    yl.setAxisMinimum(0f);
    yl.setTextColor(Color.GRAY);

    YAxis yr = getAxisRight();
    yr.setDrawAxisLine(true);
    yr.setDrawGridLines(false);
    yr.setAxisMinimum(0f);
    yl.setTextColor(Color.GRAY);

    setFitBars(true);
    animateY(2500);

    Legend l = getLegend();
    l.setVerticalAlignment(Legend.LegendVerticalAlignment.BOTTOM);
    l.setHorizontalAlignment(Legend.LegendHorizontalAlignment.LEFT);
    l.setOrientation(Legend.LegendOrientation.HORIZONTAL);
    l.setDrawInside(false);
    l.setFormSize(8f);
    l.setXEntrySpace(4f);

}
 
开发者ID:VidyaSastry,项目名称:Opal-Chat-AnalyticsDashboard,代码行数:40,代码来源:MyHorizontalBarChart.java

示例5: setupChart

import com.github.mikephil.charting.components.YAxis; //导入方法依赖的package包/类
/**
 * Setup chart (axis, grid, etc.).
 *
 * @param lineChart      chart to setup.
 * @param data           chart with the data.
 * @param firstTimestamp seconds timestamp of the first record (used as initial reference).
 */
private void setupChart(LineChart lineChart, LineData data, long firstTimestamp) {
    // General setup
    lineChart.setDrawGridBackground(false);
    lineChart.setDrawBorders(false);
    lineChart.setViewPortOffsets(50, 0, 50, 50);
    lineChart.getDescription().setEnabled(false);
    lineChart.getLegend().setEnabled(false);
    lineChart.setTouchEnabled(false);
    lineChart.setNoDataText(context.getString(R.string.no_flight_act_data_available));
    // X axis setup
    IAxisValueFormatter xAxisFormatter = new HourAxisValueFormatter(firstTimestamp);
    XAxis xAxis = lineChart.getXAxis();
    xAxis.setValueFormatter(xAxisFormatter);
    xAxis.setDrawGridLines(false);
    xAxis.setDrawAxisLine(false);
    xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
    xAxis.setCenterAxisLabels(false);
    xAxis.setTextColor(ContextCompat.getColor(context, R.color.colorIcons));
    // Y axis setup
    YAxis yAxis = lineChart.getAxisLeft();
    yAxis.setAxisMaximum(40);
    yAxis.setAxisMinimum(0);
    yAxis.setDrawLabels(false);
    yAxis.setDrawAxisLine(false);
    yAxis.setDrawGridLines(true);
    lineChart.getAxisRight().setEnabled(false);
    // Add data
    lineChart.setData(data);
}
 
开发者ID:davidmigloz,项目名称:go-bees,代码行数:37,代码来源:RecordingsAdapter.java

示例6: setupActivityChart

import com.github.mikephil.charting.components.YAxis; //导入方法依赖的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);
    }
 
开发者ID:scifiswapnil,项目名称:gadgetbridge_artikcloud,代码行数:34,代码来源:SleepChartFragment.java

示例7: setupWeekStepsChart

import com.github.mikephil.charting.components.YAxis; //导入方法依赖的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);
}
 
开发者ID:scifiswapnil,项目名称:gadgetbridge_artikcloud,代码行数:29,代码来源:WeekStepsChartFragment.java

示例8: setupChart

import com.github.mikephil.charting.components.YAxis; //导入方法依赖的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();
    }
 
开发者ID:scifiswapnil,项目名称:gadgetbridge_artikcloud,代码行数:38,代码来源:ActivitySleepChartFragment.java

示例9: onCreate

import com.github.mikephil.charting.components.YAxis; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.activity_barchart_noseekbar);

    mTf = Typeface.createFromAsset(getAssets(), "OpenSans-Regular.ttf");
    mChart = (BarChart) findViewById(R.id.chart1);
    mChart.setBackgroundColor(Color.WHITE);
    mChart.setExtraTopOffset(-30f);
    mChart.setExtraBottomOffset(10f);
    mChart.setExtraLeftOffset(70f);
    mChart.setExtraRightOffset(70f);

    mChart.setDrawBarShadow(false);
    mChart.setDrawValueAboveBar(true);

    mChart.getDescription().setEnabled(false);

    // scaling can now only be done on x- and y-axis separately
    mChart.setPinchZoom(false);

    mChart.setDrawGridBackground(false);

    XAxis xAxis = mChart.getXAxis();
    xAxis.setPosition(XAxisPosition.BOTTOM);
    xAxis.setTypeface(mTf);
    xAxis.setDrawGridLines(false);
    xAxis.setDrawAxisLine(false);
    xAxis.setTextColor(Color.LTGRAY);
    xAxis.setTextSize(13f);
    xAxis.setLabelCount(5);
    xAxis.setCenterAxisLabels(true);
    xAxis.setGranularity(1f);

    YAxis left = mChart.getAxisLeft();
    left.setDrawLabels(false);
    left.setSpaceTop(25f);
    left.setSpaceBottom(25f);
    left.setDrawAxisLine(false);
    left.setDrawGridLines(false);
    left.setDrawZeroLine(true); // draw a zero line
    left.setZeroLineColor(Color.GRAY);
    left.setZeroLineWidth(0.7f);
    mChart.getAxisRight().setEnabled(false);
    mChart.getLegend().setEnabled(false);

    // THIS IS THE ORIGINAL DATA YOU WANT TO PLOT
    final List<Data> data = new ArrayList<>();
    data.add(new Data(0f, -224.1f, "12-29"));
    data.add(new Data(1f, 238.5f, "12-30"));
    data.add(new Data(2f, 1280.1f, "12-31"));
    data.add(new Data(3f, -442.3f, "01-01"));
    data.add(new Data(4f, -2280.1f, "01-02"));

    xAxis.setValueFormatter(new IAxisValueFormatter() {
        @Override
        public String getFormattedValue(float value, AxisBase axis) {
            return data.get(Math.min(Math.max((int) value, 0), data.size()-1)).xAxisValue;
        }
    });

    setData(data);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:66,代码来源:BarChartPositiveNegative.java

示例10: onCreate

import com.github.mikephil.charting.components.YAxis; //导入方法依赖的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

示例11: setUI

import com.github.mikephil.charting.components.YAxis; //导入方法依赖的package包/类
public void setUI() {
        final Description des = new Description();
        des.setText(".");
        lineChart.setDescription(des);
        lineChart.setDrawGridBackground(false);
        lineChart.setExtraBottomOffset(-50);

        XAxis x = lineChart.getXAxis();
        x.setPosition(XAxis.XAxisPosition.TOP);
        x.setDrawGridLines(false);
        x.setDrawAxisLine(false);
        x.setDrawLabels(true);
        x.setYOffset(25);


        x.setLabelRotationAngle(270);
        x.setTextSize(12);
        x.setTextColor(Color.WHITE);
        x.setValueFormatter(new IAxisValueFormatter() {
            @Override
            public String getFormattedValue(float value, AxisBase axis) {
//                Date dt = new Date((long) value);
//                Log.d(Const.TAG2, "sVF Next is "+dt.toString());
//                SimpleDateFormat simpleDateFormat = new SimpleDateFormat(" hh:mm aaa");
//                String newValue = simpleDateFormat.format(dt);
//                return Const.NO_BREAK + newValue;

                if(uHi==(int)value){
                    return "";
                }else {
                    uHi= (int) value;
                }

                Date d= new Date(dt[(int) value]);
                SimpleDateFormat simpleDateFormat = new SimpleDateFormat(" hh:mm aaa");
                String newValue = simpleDateFormat.format(d);
                return Const.NO_BREAK + newValue;
            }
        });


        YAxis yLeft = lineChart.getAxis(YAxis.AxisDependency.LEFT);
        yLeft.setDrawGridLines(false);
        yLeft.setDrawAxisLine(false);
        yLeft.setDrawLabels(false);

        YAxis yRight = lineChart.getAxis(YAxis.AxisDependency.RIGHT);
        yRight.setDrawGridLines(false);
        yRight.setDrawAxisLine(false);
        yRight.setDrawLabels(false);

        lineChart.setDoubleTapToZoomEnabled(false);

        setData();
    }
 
开发者ID:shivam301296,项目名称:True-Weather,代码行数:56,代码来源:WeatherGraph.java

示例12: onDownloadRateSuccessful

import com.github.mikephil.charting.components.YAxis; //导入方法依赖的package包/类
public void onDownloadRateSuccessful() {
    ArrayList<BarDataSet> dataSets;

    ArrayList<BarEntry> valueSet1 = new ArrayList<>();
    BarEntry v1e1 = new BarEntry(ratee.fivestar, 0); // Jan
    valueSet1.add(v1e1);
    BarEntry v1e2 = new BarEntry(ratee.fourstar, 1); // Feb
    valueSet1.add(v1e2);
    BarEntry v1e3 = new BarEntry(ratee.threestar, 2); // Mar
    valueSet1.add(v1e3);
    BarEntry v1e4 = new BarEntry(ratee.twostar, 3); // Apr
    valueSet1.add(v1e4);
    BarEntry v1e5 = new BarEntry(ratee.onestar, 4); // May
    valueSet1.add(v1e5);


    BarDataSet barDataSet1 = new BarDataSet(valueSet1, "");
    barDataSet1.setColors(ColorTemplate.COLORFUL_COLORS);


    dataSets = new ArrayList<>();
    dataSets.add(barDataSet1);
    BarData data = new BarData(getXAxisValues(), dataSets);
    //        barDataSet1.setValueTextSize(2);
    data.setValueFormatter(new MyValueFormatter());
    chart.setData(data);
    chart.getXAxis().setEnabled(false); // hides horizontal grid lines inside chart
    YAxis leftAxis = chart.getAxisLeft();
    chart.getAxisRight().setEnabled(false); // hides horizontal grid lines with below line
    leftAxis.setEnabled(false); // hides vertical grid lines  inside chart
        /*chart.animateXY(2000, 2000);*/ // for animating reviews display
    chart.invalidate();

    chart.setDescription("");    // Hide the description

    chart.setPinchZoom(true);

    leftAxis.setDrawLabels(true);
    DecimalFormat numberFormat = new DecimalFormat("#.0");
    txtrate.setText(Float.parseFloat(rate1) + "");

    ratingDetail.setRating(Float.parseFloat(rate1));
    txtratecount.setText(point1);
    txtcountfavorites.setText(countfavorites + " " + getResources().getString(R.string.favorites));

}
 
开发者ID:sega4revenge,项目名称:Sega,代码行数:47,代码来源:ProfileDetailFragment.java

示例13: init

import com.github.mikephil.charting.components.YAxis; //导入方法依赖的package包/类
private void init(Context context, AttributeSet attrs, int defStyle) {
    setDrawBarShadow(false);
    setDrawValueAboveBar(true);
    getDescription().setEnabled(false);
    setMaxVisibleValueCount(60);
    setDrawGridBackground(false);

    XAxis xAxis = getXAxis();
    xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
    xAxis.setDrawGridLines(false);
    xAxis.setGranularity(1f);
    xAxis.setLabelCount(7);
    xAxis.setTextColor(Color.GRAY);

    YAxis leftAxis = getAxisLeft();
    leftAxis.setDrawGridLines(false);
    leftAxis.setLabelCount(8, false);
    leftAxis.setPosition(YAxis.YAxisLabelPosition.OUTSIDE_CHART);
    leftAxis.setSpaceTop(15f);
    leftAxis.setAxisMinimum(0f);
    leftAxis.setTextColor(Color.GRAY);

    YAxis rightAxis = getAxisRight();
    rightAxis.setDrawGridLines(false);
    rightAxis.setDrawAxisLine(false);
    rightAxis.setLabelCount(8, false);
    rightAxis.setDrawLabels(false);
    rightAxis.setSpaceTop(15f);
    rightAxis.setAxisMinimum(0f);

    Legend l = getLegend();
    l.setVerticalAlignment(Legend.LegendVerticalAlignment.BOTTOM);
    l.setHorizontalAlignment(Legend.LegendHorizontalAlignment.LEFT);
    l.setOrientation(Legend.LegendOrientation.HORIZONTAL);
    l.setDrawInside(false);
    l.setForm(Legend.LegendForm.SQUARE);
    l.setFormSize(9f);
    l.setTextSize(11f);
    l.setXEntrySpace(4f);

}
 
开发者ID:VidyaSastry,项目名称:Opal-Chat-AnalyticsDashboard,代码行数:42,代码来源:MyBarChart.java

示例14: onCreate

import com.github.mikephil.charting.components.YAxis; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.activity_barchart_noseekbar);

    mTf = Typeface.createFromAsset(getAssets(), "OpenSans-Regular.ttf");
    mChart = (BarChart) findViewById(R.id.chart1);
    mChart.setBackgroundColor(Color.WHITE);
    mChart.setExtraTopOffset(-30f);
    mChart.setExtraBottomOffset(10f);
    mChart.setExtraLeftOffset(70f);
    mChart.setExtraRightOffset(70f);

    mChart.setDrawBarShadow(false);
    mChart.setDrawValueAboveBar(true);

    mChart.setDescription("");

    // scaling can now only be done on x- and y-axis separately
    mChart.setPinchZoom(false);

    mChart.setDrawGridBackground(false);

    XAxis xAxis = mChart.getXAxis();
    xAxis.setPosition(XAxisPosition.BOTTOM);
    xAxis.setTypeface(mTf);
    xAxis.setDrawGridLines(false);
    xAxis.setDrawAxisLine(false);
    xAxis.setSpaceBetweenLabels(2);
    xAxis.setTextColor(Color.LTGRAY);
    xAxis.setTextSize(13f);

    YAxis left = mChart.getAxisLeft();
    left.setDrawLabels(false);
    left.setStartAtZero(false);
    left.setSpaceTop(25f);
    left.setSpaceBottom(25f);
    left.setDrawAxisLine(false);
    left.setDrawGridLines(false);
    left.setDrawZeroLine(true); // draw a zero line
    left.setZeroLineColor(Color.GRAY);
    left.setZeroLineWidth(0.7f);
    mChart.getAxisRight().setEnabled(false);
    mChart.getLegend().setEnabled(false);

    // THIS IS THE ORIGINAL DATA YOU WANT TO PLOT
    List<Data> data = new ArrayList<>();
    data.add(new Data(0, -224.1f, "12-29"));
    data.add(new Data(1, 238.5f, "12-30"));
    data.add(new Data(2, 1280.1f, "12-31"));
    data.add(new Data(3, -442.3f, "01-01"));
    data.add(new Data(4, -2280.1f, "01-02"));

    setData(data);
}
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:58,代码来源:BarChartPositiveNegative.java

示例15: setupHistoryChart

import com.github.mikephil.charting.components.YAxis; //导入方法依赖的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);
}
 
开发者ID:scifiswapnil,项目名称:gadgetbridge_artikcloud,代码行数:49,代码来源:LiveActivityFragment.java


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