首页 \ 问答 \ 如何仅在MPAndroidChart PieChart中显示切片文本?(How to show only slice text in MPAndroidChart PieChart?)

如何仅在MPAndroidChart PieChart中显示切片文本?(How to show only slice text in MPAndroidChart PieChart?)

我使用库MPAndroidChart绘制饼图。

我想只显示切片文本(X)而不是切片(Y)的值。 我发现的唯一方法是重写Valuesformatter并始终发送一个空字符串。

data.setValueFormatter(new ValueFormatter()
        {
            @Override
            public String getFormattedValue(float value)
            {
                //return formatter_currency.format(value) + " " + currency;         
                return ""; // Display only categories name.
            }
        });

但是这样所有的名字都不能正确地匹配切片(它下面有空字符串)。

有办法做到这一点?


I use the library MPAndroidChart to draw a pie chart.

I want to show only the slice text(X) and not the value of the slice(Y). The only way that I have found is to Override the Valuesformatter and send always an empty string.

data.setValueFormatter(new ValueFormatter()
        {
            @Override
            public String getFormattedValue(float value)
            {
                //return formatter_currency.format(value) + " " + currency;         
                return ""; // Display only categories name.
            }
        });

But in this way all the names doesn't fit the slice correctly(there is the empty string under it).

There is a way to achieve this?


原文:https://stackoverflow.com/questions/29333612
更新时间:2022-11-26 16:11

最满意答案

这个问题涉及Google recaptcha公钥和私钥的一般主题。 在其中一个答案https://stackoverflow.com/q/5839628/321143您的问题,关于使用相同的密钥为多个网站的安全性,解决。 这似乎是可以的:

是的,在本地测试和服务器部署中使用相同的密钥对是完全可以的(只要您保密私钥)。

为了测试的目的,我在我的家用计算机localhost:80上使用同一对密钥。 他们都工作得很好


This question was about the general subject of Google recaptcha public and private key. In one of the answers https://stackoverflow.com/q/5839628/321143 your question, about the safety of using the same key for more than one website, is addressed. It seems to be okay to do so:

Yes that's perfectly ok to use the same key pair for both local testing and server deployment (as long as you keep your private key a secret).

and

I personally use same pair of keys at 3 of my seperate web sites + at my home computer at localhost:80 for testing purposes. They all work very well

相关问答

更多