/** * Generates an attributed label for the specified series, or <code>null</code> if no attributed * label is available (in which case, the string returned by {@link * #generateSectionLabel(PieDataset, Comparable)} will provide the fallback). Only certain * attributes are recognised by the code that ultimately displays the labels: * * <ul> * <li>{@link TextAttribute#FONT}: will set the font; * <li>{@link TextAttribute#POSTURE}: a value of {@link TextAttribute#POSTURE_OBLIQUE} will add * {@link Font#ITALIC} to the current font; * <li>{@link TextAttribute#WEIGHT}: a value of {@link TextAttribute#WEIGHT_BOLD} will add * {@link Font#BOLD} to the current font; * <li>{@link TextAttribute#FOREGROUND}: this will set the {@link Paint} for the current * <li>{@link TextAttribute#SUPERSCRIPT}: the values {@link TextAttribute#SUPERSCRIPT_SUB} and * {@link TextAttribute#SUPERSCRIPT_SUPER} are recognised. * </ul> * * @param dataset the dataset (<code>null</code> not permitted). * @param key the key. * @return An attributed label (possibly <code>null</code>). */ public AttributedString generateAttributedSectionLabel(PieDataset dataset, Comparable key) { return getAttributedLabel(dataset.getIndex(key)); }