Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/219.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何在堆叠垂直条形图中使用Markerview?_Android_Mpandroidchart - Fatal编程技术网

Android 如何在堆叠垂直条形图中使用Markerview?

Android 如何在堆叠垂直条形图中使用Markerview?,android,mpandroidchart,Android,Mpandroidchart,我在显示自定义标记示例时遇到问题。当我点击堆叠条形图时,它会显示单个条形图的总值,但我需要显示堆叠条形图的值 “公共类MyMarkerView扩展了MarkerView{ private final TextView tvContent; public MyMarkerView(Context context, int layoutResource) { super(context, layoutResource); tvContent = f

我在显示自定义标记示例时遇到问题。当我点击堆叠条形图时,它会显示单个条形图的总值,但我需要显示堆叠条形图的值

“公共类MyMarkerView扩展了MarkerView{

    private final TextView tvContent;

    public MyMarkerView(Context context, int layoutResource) {
        super(context, layoutResource);

        tvContent = findViewById(R.id.tvContent);
    }

    // runs every time the MarkerView is redrawn, can be used to update the
    // content (user-interface)
    @Override
    public void refreshContent(Entry e, Highlight highlight) {

        if (e instanceof CandleEntry) {

            CandleEntry ce = (CandleEntry) e;

            tvContent.setText(Utils.formatNumber(ce.getHigh(), 0, false));
        } else {
            tvContent.setText(Utils.formatNumber(e.getY(), 0, false));
        }

        super.refreshContent(e, highlight);
    }

    private MPPointF mpPointF;

    @Override
    public MPPointF getOffset() {

        if(mpPointF == null){
            mpPointF = new MPPointF(-(getWidth() / 2), -getHeight());
        }
        return mpPointF;
    }

}"

就我而言,解决方案是改变:

e.getY()
致:


就我而言,解决方案是改变:

e.getY()
致: