surbhi verma
surbhi verma

Reputation: 357

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.

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.

Upvotes: 0

Views: 1009

Answers (1)

AnyChart Support
AnyChart Support

Reputation: 3905

Line, Bar and Bubble charts by AnyChart support String x-values as a default. Here is a sample of a Column Chart with String X-values. Also, you mentioned String Y-values. 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. Do you want to replace Linear Y-scale with Ordinal one? Or just replace Number values with named ranges? If you can provide the expecting result this will help us to provide a solution.

Upvotes: 1

Related Questions