override method refreshContent is not calling while extend com.github.mikephil.charting.components.MarkerView;

时间:2018-10-02 09:20:41

标签: android mpandroidchart

here is my code when it called then its override function did not call.plz tell me any solution

i copied same code from https://github.com/PhilJay/MPAndroidChart/wiki/MarkerView

public MarkerForChart(Context context, int layoutResource) {
    super(context, layoutResource);
    tvDateChart = (TextView) findViewById(R.id.date_chart_tv);
}

@Override
public void refreshContent(Entry e, Highlight highlight) {

    if (e instanceof CandleEntry) {

        CandleEntry ce = (CandleEntry) e;

        tvDateChart.setText("" + Utils.formatNumber(ce.getHigh(), 0, true));
    } else {

        tvDateChart.setText("" + Utils.formatNumber(e.getY(), 0, true));
    }

    super.refreshContent(e, highlight);
}

@Override
public MPPointF getOffset() {
    return new MPPointF(-(getWidth() / 2), -getHeight());
}

0 个答案:

没有答案