當前位置: 首頁>>代碼示例>>Java>>正文


Java AxisBase類代碼示例

本文整理匯總了Java中com.github.mikephil.charting.components.AxisBase的典型用法代碼示例。如果您正苦於以下問題:Java AxisBase類的具體用法?Java AxisBase怎麽用?Java AxisBase使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


AxisBase類屬於com.github.mikephil.charting.components包,在下文中一共展示了AxisBase類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: AxisRenderer

import com.github.mikephil.charting.components.AxisBase; //導入依賴的package包/類
public AxisRenderer(ViewPortHandler viewPortHandler, Transformer trans, AxisBase axis) {
    super(viewPortHandler);

    this.mTrans = trans;
    this.mAxis = axis;

    if(mViewPortHandler != null) {

        mAxisLabelPaint = new Paint(Paint.ANTI_ALIAS_FLAG);

        mGridPaint = new Paint();
        mGridPaint.setColor(Color.GRAY);
        mGridPaint.setStrokeWidth(1f);
        mGridPaint.setStyle(Style.STROKE);
        mGridPaint.setAlpha(90);

        mAxisLinePaint = new Paint();
        mAxisLinePaint.setColor(Color.BLACK);
        mAxisLinePaint.setStrokeWidth(1f);
        mAxisLinePaint.setStyle(Style.STROKE);

        mLimitLinePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
        mLimitLinePaint.setStyle(Paint.Style.STROKE);
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:26,代碼來源:AxisRenderer.java

示例2: getFormattedValue

import com.github.mikephil.charting.components.AxisBase; //導入依賴的package包/類
@Override
public String getFormattedValue(float value, AxisBase axis) {

    //Log.i("TRANS", "x: " + viewPortHandler.getTransX() + ", y: " + viewPortHandler.getTransY());

    // e.g. adjust the x-axis values depending on scale / zoom level
    final float xScale = mViewPortHandler.getScaleX();
    if (xScale > 5)
        return "4";
    else if (xScale > 3)
        return "3";
    else if (xScale > 1)
        return "2";
    else
        return mFormat.format(value);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:17,代碼來源:MyCustomXAxisValueFormatter.java

示例3: chartXAxisStyling

import com.github.mikephil.charting.components.AxisBase; //導入依賴的package包/類
@SuppressWarnings("deprecation")
private void chartXAxisStyling(XAxis xAxis) {
    xAxis.setPosition(XAxis.XAxisPosition.TOP);
    xAxis.setTextColor(getResources().getColor(R.color.traffic_chart_text_color_light));
    xAxis.setDrawAxisLine(true);
    xAxis.setDrawGridLines(false);
    xAxis.setCenterAxisLabels(true);
    xAxis.setValueFormatter(new AxisValueFormatter() {
        @Override
        public String getFormattedValue(float value, AxisBase axis) {
            return Utils.humanReadable((long) value);
        }

        @Override
        public int getDecimalDigits() {
            return 0;
        }
    });
}
 
開發者ID:DmitryMalkovich,項目名稱:gito-github-client,代碼行數:20,代碼來源:TrafficFragment.java

示例4: getFormattedValue

import com.github.mikephil.charting.components.AxisBase; //導入依賴的package包/類
@Override
public String getFormattedValue(float value, AxisBase axis)
{
    if ( value == 0.0 || labels.isEmpty() )
    {
        return StringUtils.EMPTY;
    }
    else
    {
        value = value - 1;
        if ( value >= labels.size() )
        {
            return StringUtils.EMPTY;
        }
        else
        {
            return labels.get((int) value);
        }
    }
}
 
開發者ID:SecUSo,項目名稱:privacy-friendly-shopping-list,代碼行數:21,代碼來源:PFAXAxisLabels.java

示例5: notifyDataSetChanged

import com.github.mikephil.charting.components.AxisBase; //導入依賴的package包/類
/**
 * 更新圖表
 *
 * @param chart     圖表
 * @param values    數據
 * @param valueType 數據類型
 */
public static void notifyDataSetChanged(LineChart chart, List<Entry> values,
                                        final int valueType) {
    chart.getXAxis().setValueFormatter(new IAxisValueFormatter() {
        @Override
        public String getFormattedValue(float value, AxisBase axis) {
            return xValuesProcess(valueType)[(int) value];
        }
    });

    chart.invalidate();
    setChartData(chart, values);
}
 
開發者ID:alidili,項目名稱:Demos,代碼行數:20,代碼來源:ChartUtils.java

示例6: getFormattedValue

import com.github.mikephil.charting.components.AxisBase; //導入依賴的package包/類
public String getFormattedValue(float value, AxisBase axis) {
    int index = Math.round(value);

    if (index < 0 || index >= mValueCount || index != (int)value)
        return "";

    return mValues[index];
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:9,代碼來源:IndexAxisValueFormatter.java

示例7: getFormattedValue

import com.github.mikephil.charting.components.AxisBase; //導入依賴的package包/類
@Override
public String getFormattedValue(float value, AxisBase axis) {
    if (value > 3) {
        return super.getFormattedValue(value, axis);
    } else {
        return "";
    }
}
 
開發者ID:Protino,項目名稱:CodeWatch,代碼行數:9,代碼來源:ChartFragment.java

示例8: getFormattedValue

import com.github.mikephil.charting.components.AxisBase; //導入依賴的package包/類
@Override
public String getFormattedValue(float value, AxisBase axis) {
    int v = (int) value;
    if (v >= 0 && v < JOB_SOFT.length) {
        return JOB_SOFT[((int) value)];
    }
    return "";
}
 
開發者ID:graviton57,項目名稱:DOUSalaries,代碼行數:9,代碼來源:GroupBarValueFormatter.java

示例9: getFormattedValue

import com.github.mikephil.charting.components.AxisBase; //導入依賴的package包/類
@Override
public String getFormattedValue(float value, AxisBase axis) {
    if ((int) value >= 0 && value < month.length) {
        return month[(int) value];
    }
    return "";
}
 
開發者ID:graviton57,項目名稱:DOUSalaries,代碼行數:8,代碼來源:LineChartValueFormatter.java

示例10: getFormattedValue

import com.github.mikephil.charting.components.AxisBase; //導入依賴的package包/類
@Override
public String getFormattedValue(float value, AxisBase axis) {
    if ((int) value >= 0 && value < jobs.length) {
        String title = jobs[(int) value];
        if (title.length() > Config.JOBS_LENGTH) {
            title = title.substring(0, Config.JOBS_LENGTH);
        }
        return title;
    }
    return "";
}
 
開發者ID:graviton57,項目名稱:DOUSalaries,代碼行數:12,代碼來源:HorizontalBarValueFormatter.java

示例11: getFormattedValue

import com.github.mikephil.charting.components.AxisBase; //導入依賴的package包/類
@Override
public String getFormattedValue(float value, AxisBase axis) {
    if (dispalyInUsd) {
        return value >= 0 ? ((int) value) + "" : "";
    } else {
        return value >= 0 ? Math.floor(value * 1000) / 1000 + "" : "";
    }
}
 
開發者ID:manuelsc,項目名稱:Lunary-Ethereum-Wallet,代碼行數:9,代碼來源:DontShowNegativeFormatter.java

示例12: getFormattedValue

import com.github.mikephil.charting.components.AxisBase; //導入依賴的package包/類
@Override
public String getFormattedValue(float value, AxisBase axis) {
    try{
        if (dateFormater==null ||dateFormater.equals(""))
            return DateFormater.getInstance().getDate( measureList.get((int)value).getTimeStamp());
        return DateFormater.getInstance().getDateByFormat( measureList.get((int)value).getTimeStamp(),dateFormater);
    }
    catch (Exception ex)
    {
        return "";
    }
}
 
開發者ID:kflauri2312lffds,項目名稱:Android_watch_magpie,代碼行數:13,代碼來源:Fragment_display_measures.java

示例13: getFormattedValue

import com.github.mikephil.charting.components.AxisBase; //導入依賴的package包/類
@Override
public String getFormattedValue(float value, AxisBase axis) {
    if (!mMap.get((int) value)) {
        mMap.put((int) value, true);
        return mValues[(int) value];
    } else {
        return "";
    }
}
 
開發者ID:Wisebite,項目名稱:wisebite_android,代碼行數:10,代碼來源:MyXAxisValueFormatter.java

示例14: getFormattedValue

import com.github.mikephil.charting.components.AxisBase; //導入依賴的package包/類
@Override
public String getFormattedValue(float value, AxisBase axis) {
    try {
        return Utils.getFormattedDateTime((mChartDates.get((int) value)) * 1000, true);
    } catch (Exception ignored) {
        return "";
    }

}
 
開發者ID:mkeresztes,項目名稱:AndiCar,代碼行數:10,代碼來源:LineChartComponent.java

示例15: getFormattedValue

import com.github.mikephil.charting.components.AxisBase; //導入依賴的package包/類
@Override
public String getFormattedValue(float value, AxisBase axis) {
    try{
        SimpleDateFormat sdf = new SimpleDateFormat("h:mm a \n dd/MM/yyyy");
        Date date = new Date((long) value);
        return sdf.format(date);
    }
    catch(Exception ex){
        return "No time";
    }
}
 
開發者ID:minigridems,項目名稱:SERC-ENERYGY-METERING-MOBILE-APP,代碼行數:12,代碼來源:DayAxisValueFormatter.java


注:本文中的com.github.mikephil.charting.components.AxisBase類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。