I want to know is there any way or method to hide or disable the value in MeterPlot using JFreeChart in Java. Here's the screenshot from this example, with the value circled in yellow.

I want to know is there any way or method to hide or disable the value in MeterPlot using JFreeChart in Java. Here's the screenshot from this example, with the value circled in yellow.

As shown here, one approach is to specify a zero-sized font with an empty units string:
meterplot.setValueFont(new Font(Font.SERIF, Font.PLAIN, 0));
meterplot.setUnits("");
Alternatively, subclass MeterPlot and then either
Override drawValueLabel() to omit rendering:
MeterPlot meterplot = new MeterPlot(valuedataset){
@Override
protected void drawValueLabel(Graphics2D g2, Rectangle2D area) {
}
};
Add an attribute such as valueVisible and draw conditionally; add mutators, invoking fireChangeEvent() as warranted:
private class MyMeterPlot extends MeterPlot {
private boolean valueVisible;
public MyMeterPlot(ValueDataset dataset) {
super(dataset);
}
@Override
protected void drawValueLabel(Graphics2D g2, Rectangle2D area) {
if (valueVisible) {
super.drawValueLabel(g2, area);
}
}
public void setValueVisible(boolean valueVisible) {
this.valueVisible = valueVisible;
fireChangeEvent();
}
public boolean isValueVisible() {
return valueVisible;
}
}
For reference, changes to support value visibility have been added to version 2.0 here and back ported to the upcoming version 1.5.4 here.