Add a concrete CategoryToolTipGenerator
to your chosen renderer, for example:
renderer.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator());
The default values are described here, but you can override generateToolTip()
and access the CategoryDataset
to display anything at all.
My series values come in as "Skill (Emp)" and I would like to separate the two.
As a concrete example, the following custom renderer would display just the "Emp" portion of the series key.
renderer.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator() {
@Override
public String generateToolTip(CategoryDataset dataset, int row, int column) {
String s = super.generateToolTip(dataset, row, column);
int b = s.indexOf('(', 1) + 1;
int e = s.indexOf(')');
return s.substring(b, e);
}
});