*/
public LegendItem getLegendItem(int datasetIndex, int series)
{
// if there is no plot, there is no dataset to access...
CategoryPlot cp = getPlot();
if (cp == null)
{
return null;
}
// check that a legend item needs to be displayed...
if (!isSeriesVisible(series) || !isSeriesVisibleInLegend(series))
{
return null;
}
CategoryDataset dataset = cp.getDataset(datasetIndex);
String label = getLegendItemLabelGenerator().generateLabel(dataset,
series);
String description = label;
String toolTipText = null;
if (getLegendItemToolTipGenerator() != null)