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


Java YAxis.setDrawAxisLine方法代码示例

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


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

示例1: 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_linechart_noseekbar);

    mChart = (LineChart) findViewById(R.id.chart1);
    mChart.setBackgroundColor(Color.WHITE);
    mChart.setGridBackgroundColor(mFillColor);
    mChart.setDrawGridBackground(true);

    mChart.setDrawBorders(true);

    // no description text
    mChart.getDescription().setEnabled(false);

    // if disabled, scaling can be done on x- and y-axis separately
    mChart.setPinchZoom(false);

    Legend l = mChart.getLegend();
    l.setEnabled(false);

    XAxis xAxis = mChart.getXAxis();
    xAxis.setEnabled(false);

    YAxis leftAxis = mChart.getAxisLeft();
    leftAxis.setAxisMaximum(900f);
    leftAxis.setAxisMinimum(-250f);
    leftAxis.setDrawAxisLine(false);
    leftAxis.setDrawZeroLine(false);
    leftAxis.setDrawGridLines(false);

    mChart.getAxisRight().setEnabled(false);

    // add data
    setData(100, 60);

    mChart.invalidate();
}
 
开发者ID:xsingHu,项目名称:xs-android-architecture,代码行数:41,代码来源:FilledLineActivity.java

示例2: setHorizontalBarChart

import com.github.mikephil.charting.components.YAxis; //导入方法依赖的package包/类
/**
 * Set the horizontal bar pattern
 * @param barChart chart
 * @param chartData horizontal bar chart data
 * @param jobs string array of job titles
 * @param typeface Typeface font
 */
public static void setHorizontalBarChart(BarChart barChart, final ChartData<?> chartData,
                                         final String[] jobs, Typeface typeface) {
    barChart.setDrawGridBackground(false);
    XAxis xAxis = barChart.getXAxis();
    xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
    //xAxis.setLabelCount(chartData.getEntryCount());
    xAxis.setLabelCount(jobs.length);
    xAxis.setTypeface(typeface);
    xAxis.setDrawAxisLine(true);
    xAxis.setDrawGridLines(false);
    xAxis.setGranularity(1f);

    YAxis leftAxis = barChart.getAxisLeft();
    leftAxis.setTypeface(typeface);
    leftAxis.setSpaceTop(15f);
    leftAxis.setAxisMinimum(0f);
    leftAxis.setGranularity(1f);
    leftAxis.setDrawAxisLine(true);
    leftAxis.setDrawGridLines(true);
    YAxis axisRight = barChart.getAxisRight();
    axisRight.setTypeface(typeface);
    axisRight.setDrawAxisLine(true);
    axisRight.setDrawGridLines(false);
    axisRight.setGranularity(1f);
    axisRight.setAxisMinimum(0f);

    final Legend legend = barChart.getLegend();
    legend.setVerticalAlignment(Legend.LegendVerticalAlignment.BOTTOM);
    legend.setHorizontalAlignment(Legend.LegendHorizontalAlignment.LEFT);
    legend.setOrientation(Legend.LegendOrientation.HORIZONTAL);
    legend.setDrawInside(false);
    legend.setFormSize(8f);
    legend.setXEntrySpace(4f);
    barChart.setData((BarData) chartData);
    barChart.setFitBars(true);
    barChart.animateY(DURATION_LONG);
    xAxis.setValueFormatter(new HorizontalBarValueFormatter(jobs));
}
 
开发者ID:graviton57,项目名称:DOUSalaries,代码行数:46,代码来源:ChartHelper.java

示例3: prepareChart

import com.github.mikephil.charting.components.YAxis; //导入方法依赖的package包/类
private void prepareChart() {
    mChart.setTouchEnabled(true);
    mChart.setDragEnabled(true);
    mChart.setScaleEnabled(true);
    mChart.setPinchZoom(true);
    mChart.setHighlightPerTapEnabled(true);
    mChart.setDoubleTapToZoomEnabled(false);
    mChart.setHighlightPerDragEnabled(false);

    mChart.getDescription().setEnabled(false);
    mChart.setDrawGridBackground(false);
    mChart.getLegend().setEnabled(true);
    mChart.getAxisRight().setEnabled(false);
    mChart.setMarker(new AMarkView(this, R.layout.ac_detail_mark_view));

    final YAxis leftAxis = mChart.getAxisLeft();
    leftAxis.setTextColor(ContextCompat.getColor(this, R.color.text_primary));
    leftAxis.setAxisMaximum(1F);
    leftAxis.setDrawGridLines(false);
    leftAxis.setDrawAxisLine(true);

    final LimitLine upLine = new LimitLine(0.9F, "Great");
    upLine.setLineWidth(2F);
    upLine.enableDashedLine(10F, 10F, 10F);
    upLine.setLabelPosition(LimitLine.LimitLabelPosition.RIGHT_TOP);
    upLine.setLineColor(ContextCompat.getColor(this, R.color.divider));
    upLine.setTextColor(ContextCompat.getColor(this, R.color.green$1));

    final LimitLine downLine = new LimitLine(0.5F, "Bad");
    downLine.setLineWidth(2F);
    downLine.enableDashedLine(10F, 10F, 10F);
    downLine.setLabelPosition(LimitLine.LimitLabelPosition.RIGHT_BOTTOM);
    downLine.setLineColor(ContextCompat.getColor(this, R.color.divider));
    downLine.setTextColor(ContextCompat.getColor(this, R.color.pink_$1));

    leftAxis.addLimitLine(upLine);
    leftAxis.addLimitLine(downLine);
}
 
开发者ID:huazhouwang,项目名称:Synapse,代码行数:39,代码来源:ModelDetailActivity.java

示例4: 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

示例5: 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

示例6: chartYAxisStyling

import com.github.mikephil.charting.components.YAxis; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
private void chartYAxisStyling(YAxis yAxis) {
    yAxis.setPosition(YAxis.YAxisLabelPosition.OUTSIDE_CHART);
    yAxis.setTextColor(SettingsActivity.ThemePreferenceFragment.isLight(getContext()) ?
            getResources().getColor(R.color.traffic_chart_text_color_light) :
            getResources().getColor(R.color.traffic_chart_text_color_dark));
    yAxis.setDrawGridLines(false);
    yAxis.setGranularityEnabled(true);
    yAxis.setDrawAxisLine(true);
}
 
开发者ID:DmitryMalkovich,项目名称:gito-github-client,代码行数:11,代码来源:TrafficFragment.java

示例7: 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

示例8: createBarChart

import com.github.mikephil.charting.components.YAxis; //导入方法依赖的package包/类
public static void createBarChart(BarChart barChart, List<Pair<String, Integer>> chartData, String title, Context context){

        barChart.setDrawBarShadow(false);
        barChart.setDrawValueAboveBar(true);
        barChart.setPinchZoom(false);
        barChart.setDrawGridBackground(true);
        barChart.setScaleEnabled(false);
        barChart.getAxisRight().setEnabled(false);

        YAxis yl = barChart.getAxisLeft();
        yl.setDrawAxisLine(true);
        yl.setDrawGridLines(false);
        yl.setGridLineWidth(0.3f);

        createChart(barChart,chartData,title,context);
    }
 
开发者ID:fga-gpp-mds,项目名称:2016.2-CidadeDemocratica,代码行数:17,代码来源:CharterGenerator.java

示例9: initChart

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

示例10: initChart

import com.github.mikephil.charting.components.YAxis; //导入方法依赖的package包/类
/**
 * 初始化图表
 *
 * @param chart 原始图表
 * @return 初始化后的图表
 */
public static LineChart initChart(LineChart chart) {
    // 不显示数据描述
    chart.getDescription().setEnabled(false);
    // 没有数据的时候,显示“暂无数据”
    chart.setNoDataText("暂无数据");
    // 不显示表格颜色
    chart.setDrawGridBackground(false);
    // 不可以缩放
    chart.setScaleEnabled(false);
    // 不显示y轴右边的值
    chart.getAxisRight().setEnabled(false);
    // 不显示图例
    Legend legend = chart.getLegend();
    legend.setEnabled(false);
    // 向左偏移15dp,抵消y轴向右偏移的30dp
    chart.setExtraLeftOffset(-15);

    XAxis xAxis = chart.getXAxis();
    // 不显示x轴
    xAxis.setDrawAxisLine(false);
    // 设置x轴数据的位置
    xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
    xAxis.setTextColor(Color.WHITE);
    xAxis.setTextSize(12);
    xAxis.setGridColor(Color.parseColor("#30FFFFFF"));
    // 设置x轴数据偏移量
    xAxis.setYOffset(-12);

    YAxis yAxis = chart.getAxisLeft();
    // 不显示y轴
    yAxis.setDrawAxisLine(false);
    // 设置y轴数据的位置
    yAxis.setPosition(YAxis.YAxisLabelPosition.OUTSIDE_CHART);
    // 不从y轴发出横向直线
    yAxis.setDrawGridLines(false);
    yAxis.setTextColor(Color.WHITE);
    yAxis.setTextSize(12);
    // 设置y轴数据偏移量
    yAxis.setXOffset(30);
    yAxis.setYOffset(-3);
    yAxis.setAxisMinimum(0);

    //Matrix matrix = new Matrix();
    // x轴缩放1.5倍
    //matrix.postScale(1.5f, 1f);
    // 在图表动画显示之前进行缩放
    //chart.getViewPortHandler().refresh(matrix, chart, false);
    // x轴执行动画
    //chart.animateX(2000);
    chart.invalidate();
    return chart;
}
 
开发者ID:alidili,项目名称:Demos,代码行数:59,代码来源:ChartUtils.java

示例11: 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

示例12: 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_candlechart);

        tvX = (TextView) findViewById(R.id.tvXMax);
        tvY = (TextView) findViewById(R.id.tvYMax);

        mSeekBarX = (SeekBar) findViewById(R.id.seekBar1);
        mSeekBarX.setOnSeekBarChangeListener(this);

        mSeekBarY = (SeekBar) findViewById(R.id.seekBar2);
        mSeekBarY.setOnSeekBarChangeListener(this);

        mChart = (CandleStickChart) findViewById(R.id.chart1);
        mChart.setBackgroundColor(Color.WHITE);

        mChart.getDescription().setEnabled(false);

        // if more than 60 entries are displayed in the chart, no values will be
        // drawn
        mChart.setMaxVisibleValueCount(60);

        // 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.setDrawGridLines(false);

        YAxis leftAxis = mChart.getAxisLeft();  
//        leftAxis.setEnabled(false);
        leftAxis.setLabelCount(7, false);
        leftAxis.setDrawGridLines(false);
        leftAxis.setDrawAxisLine(false);
        
        YAxis rightAxis = mChart.getAxisRight();
        rightAxis.setEnabled(false);
//        rightAxis.setStartAtZero(false);

        // setting data
        mSeekBarX.setProgress(40);
        mSeekBarY.setProgress(100);
        
        mChart.getLegend().setEnabled(false);
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:51,代码来源:CandleStickChartActivity.java

示例13: 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_horizontalbarchart);

        tvX = (TextView) findViewById(R.id.tvXMax);
        tvY = (TextView) findViewById(R.id.tvYMax);

        mSeekBarX = (SeekBar) findViewById(R.id.seekBar1);
        mSeekBarY = (SeekBar) findViewById(R.id.seekBar2);

        mChart = (HorizontalBarChart) findViewById(R.id.chart1);
        mChart.setOnChartValueSelectedListener(this);
        // mChart.setHighlightEnabled(false);

        mChart.setDrawBarShadow(false);

        mChart.setDrawValueAboveBar(true);

        mChart.getDescription().setEnabled(false);

        // if more than 60 entries are displayed in the chart, no values will be
        // drawn
        mChart.setMaxVisibleValueCount(60);

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

        // draw shadows for each bar that show the maximum value
        // mChart.setDrawBarShadow(true);

        mChart.setDrawGridBackground(false);

        XAxis xl = mChart.getXAxis();
        xl.setPosition(XAxisPosition.BOTTOM);
        xl.setTypeface(mTfLight);
        xl.setDrawAxisLine(true);
        xl.setDrawGridLines(false);
        xl.setGranularity(10f);

        YAxis yl = mChart.getAxisLeft();
        yl.setTypeface(mTfLight);
        yl.setDrawAxisLine(true);
        yl.setDrawGridLines(true);
        yl.setAxisMinimum(0f); // this replaces setStartAtZero(true)
//        yl.setInverted(true);

        YAxis yr = mChart.getAxisRight();
        yr.setTypeface(mTfLight);
        yr.setDrawAxisLine(true);
        yr.setDrawGridLines(false);
        yr.setAxisMinimum(0f); // this replaces setStartAtZero(true)
//        yr.setInverted(true);

        setData(12, 50);
        mChart.setFitBars(true);
        mChart.animateY(2500);

        // setting data
        mSeekBarY.setProgress(50);
        mSeekBarX.setProgress(12);

        mSeekBarY.setOnSeekBarChangeListener(this);
        mSeekBarX.setOnSeekBarChangeListener(this);

        Legend l = mChart.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:weiwenqiang,项目名称:GitHub,代码行数:76,代码来源:HorizontalBarChartActivity.java

示例14: 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

示例15: 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


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