/** * Returns a list of the categories that should be displayed for the * specified axis. * * @param axis the axis (<code>null</code> not permitted) * * @return The categories. * * @since 1.0.3 */ public List getCategoriesForAxis(CategoryAxis axis) { List result = new ArrayList(); int axisIndex = this.domainAxes.indexOf(axis); List datasets = datasetsMappedToDomainAxis(axisIndex); Iterator iterator = datasets.iterator(); while (iterator.hasNext()) { CategoryDataset dataset = (CategoryDataset) iterator.next(); // add the unique categories from this dataset for (int i = 0; i < dataset.getColumnCount(); i++) { Comparable category = dataset.getColumnKey(i); if (!result.contains(category)) { result.add(category); } } } return result; }
/** * Returns a list of the categories that should be displayed for the * specified axis. * * @param axis the axis ({@code null} not permitted) * * @return The categories. * * @since 1.0.3 */ public List getCategoriesForAxis(CategoryAxis axis) { List result = new ArrayList(); int axisIndex = getDomainAxisIndex(axis); for (CategoryDataset dataset : datasetsMappedToDomainAxis(axisIndex)) { // add the unique categories from this dataset for (int i = 0; i < dataset.getColumnCount(); i++) { Comparable category = dataset.getColumnKey(i); if (!result.contains(category)) { result.add(category); } } } return result; }