简体   繁体   English

在x轴和y轴上带有字符串标签的图形

[英]graphs with string labels in x-axis and y-axis

I am trying to create multiple types of graphs like bar, line, and bubble. 我正在尝试创建多种类型的图,如条形图,折线图和气泡图。 I have tried using MpAndroidChart library and AnyChart library to set string values in x-axis and y-axis but they are not working. 我尝试使用MpAndroidChart库和AnyChart库在x轴和y轴上设置字符串值,但是它们不起作用。

public class BubbleDataEntry extends DataEntry {

public BubbleDataEntry(String x, Integer value, Integer size) {
    setValue("x", x);
    setValue("value", value);
    setValue("size", size);
}

public BubbleDataEntry(String x, Double value, Double size) {
    setValue("x", x);
    setValue("value", value);
    setValue("size", size);
}

public BubbleDataEntry(Integer x, Integer value, Integer size) {
    setValue("x", x);
    setValue("value", value);
    setValue("size", size);
}

public BubbleDataEntry(Double x, Double value, Double size) {
    setValue("x", x);
    setValue("value", value);
    setValue("size", size);
}

} }

It does not support string parameter, and if I am trying to do by overriding it, it is not working. 它不支持字符串参数,并且如果我试图通过覆盖它来做到这一点,那么它将无法正常工作。

Line, Bar and Bubble charts by AnyChart support String x-values as a default. 默认情况下,AnyChart的折线图,条形图和气泡图支持字符串x值。 Here is a sample of a Column Chart with String X-values . 这是带有字符串X值的柱形图示例 Also, you mentioned String Y-values. 另外,您提到了String Y值。 Please, can you provide more details about this requirement? 请您提供有关此要求的更多详细信息吗? Usually, Y-position of points is related to a Number Y-value in case of Linear Y-scale. 通常,在线性Y标度的情况下,点的Y位置与数字Y值相关。 Do you want to replace Linear Y-scale with Ordinal one? 您是否要用Ordinal 1代替Linear Y-scale? Or just replace Number values with named ranges? 还是仅将Number值替换为命名范围? If you can provide the expecting result this will help us to provide a solution. 如果您可以提供预期的结果,这将帮助我们提供解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM