1

I am using LineChart for plotting realtime data. I need to display custom value for the Range Tick labels. For example if the Range value is 600, I need to display it as 6mv. Could someone please suggest me a solution?

somia
  • 611
  • 5
  • 22

1 Answers1

1

Assuming the conversion you want to use is simply value / 100:

plot.setRangeValueFormat(new Format() {
    @Override
    public StringBuffer format(Object object, StringBuffer buffer, FieldPosition field) {
        Number value = (Number) object;
            buffer.append(value.doubleValue() / 100 + "mv");
                return buffer;
    }

    @Override
    public Object parseObject(String string, ParsePosition position) {
        return null;
    }
});
Nick
  • 8,181
  • 4
  • 38
  • 63