如何将文本值放置在 MPAndroidChart 圆圈中? [英] How to place the text values inside in MPAndroidChart circle?

查看:46
本文介绍了如何将文本值放置在 MPAndroidChart 圆圈中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个基于图表的应用程序,我正在使用

但我喜欢这张图片:

再次感谢您帮助解决这个问题,

 ArrayListe1 = new ArrayList();float[] 值 = 新的 float[]{48, 59, 79, 29, 39, 50, 60};for (int i = 0; i < values.length; i++) {e1.add(new Entry(values[i], i, "line3"));}int[] color = {Color.parseColor("#D13385"), Color.parseColor("#37D04E"), Color.parseColor("#33D1D1"), Color.parseColor("#D1C933")};LineDataSet d1 = new LineDataSet(e1, "" + cnt);d1.setColors(颜色);d1.setLineWidth(3.0f);d1.setCircleSize(7.0f);d1.setDrawValues(true);d1.setCircleColor(Color.parseColor("#891e9a"));d1.setCircleColorHole(Color.parseColor("#891e9a"));d1.setDrawHighlightIndicators(false);d1.setDrawFilled(false);d1.setFillAlpha(20);d1.setHighlightLineWidth(50f);d1.setValueTextSize(10f);

解决方案

目前不可能更改默认绘制值的位置.您必须修改库才能获得该行为.

I am developing a chart based application, I am using MPAndroidChart library, I need to place the text value inside of circle, i tried to display,Thanks for if any suggestions related this,

i attached a screenshot related to that issue. I need to be do like this

but i get like this image:

Thanks Again for helping this issue,

 ArrayList<Entry> e1 = new ArrayList<Entry>();

        float[] values = new float[]{48, 59, 79, 29, 39, 50, 60};
        for (int i = 0; i < values.length; i++) {
            e1.add(new Entry(values[i], i, "line3"));

        }
        int[] color = {Color.parseColor("#D13385"),    Color.parseColor("#37D04E"), Color.parseColor("#33D1D1"),  Color.parseColor("#D1C933")};
        LineDataSet d1 = new LineDataSet(e1, "" + cnt);
        d1.setColors(color);
        d1.setLineWidth(3.0f);
        d1.setCircleSize(7.0f);
        d1.setDrawValues(true);      
        d1.setCircleColor(Color.parseColor("#891e9a"));
        d1.setCircleColorHole(Color.parseColor("#891e9a"));
        d1.setDrawHighlightIndicators(false);
        d1.setDrawFilled(false);
        d1.setFillAlpha(20);     
        d1.setHighlightLineWidth(50f);
        d1.setValueTextSize(10f);

解决方案

Currently it is not possible to change the position where the values are drawn by default. You will have to modify the library to get that behaviour.

这篇关于如何将文本值放置在 MPAndroidChart 圆圈中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆