Java Code Examples for org.jfree.chart.util.TableOrder#BY_ROW

The following examples show how to use org.jfree.chart.util.TableOrder#BY_ROW . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DefaultChartService.java    From dhis2-core with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private JFreeChart getRadarChart( BaseChart chart, CategoryDataset dataSet )
{
    SpiderWebPlot plot = new SpiderWebPlot( dataSet, TableOrder.BY_ROW );
    plot.setLabelFont( LABEL_FONT );

    JFreeChart radarChart = new JFreeChart( chart.getName(), TITLE_FONT, plot, !chart.isHideLegend() );

    setBasicConfig( radarChart, chart );

    return radarChart;
}
 
Example 2
Source File: ChartImageGenerator.java    From dhis2-core with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private JFreeChart getRadarChart( final Visualization visualization, CategoryDataset dataSet )
{
    SpiderWebPlot plot = new SpiderWebPlot( dataSet, TableOrder.BY_ROW );
    plot.setLabelFont( LABEL_FONT );

    JFreeChart radarChart = new JFreeChart( visualization.getName(), TITLE_FONT, plot, !visualization.isHideLegend() );

    setBasicConfig( radarChart, visualization );

    return radarChart;
}
 
Example 3
Source File: Arja_00162_t.java    From coming with MIT License 4 votes vote down vote up
/**
 * Returns a collection of legend items for the pie chart.
 *
 * @return The legend items.
 */
public LegendItemCollection getLegendItems() {

    LegendItemCollection result = new LegendItemCollection();

    if (this.dataset != null) {
        List keys = null;

        prefetchSectionPaints();
        if (this.dataExtractOrder == TableOrder.BY_ROW) {
            keys = this.dataset.getColumnKeys();
        }
        else if (this.dataExtractOrder == TableOrder.BY_COLUMN) {
            keys = this.dataset.getRowKeys();
        }

        if (keys != null) {
            int section = 0;
            Iterator iterator = keys.iterator();
            while (iterator.hasNext()) {
                Comparable key = (Comparable) iterator.next();
                String label = key.toString();
                String description = label;
                Paint paint = (Paint) this.sectionPaints.get(key);
                LegendItem item = new LegendItem(label, description,
                        null, null, Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                        paint, Plot.DEFAULT_OUTLINE_STROKE, paint);
                item.setDataset(getDataset());
                result.add(item);
                section++;
            }
        }
        if (this.limit > 0.0) {
            result.add(new LegendItem(this.aggregatedItemsKey.toString(),
                    this.aggregatedItemsKey.toString(), null, null,
                    Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                    this.aggregatedItemsPaint,
                    Plot.DEFAULT_OUTLINE_STROKE,
                    this.aggregatedItemsPaint));
        }
    }
    return result;
}
 
Example 4
Source File: Arja_0063_s.java    From coming with MIT License 4 votes vote down vote up
/**
 * Returns a collection of legend items for the pie chart.
 *
 * @return The legend items.
 */
public LegendItemCollection getLegendItems() {

    LegendItemCollection result = new LegendItemCollection();

    if (this.dataset != null) {
        List keys = null;

        prefetchSectionPaints();
        if (this.dataExtractOrder == TableOrder.BY_ROW) {
            keys = this.dataset.getColumnKeys();
        }
        else if (this.dataExtractOrder == TableOrder.BY_COLUMN) {
            keys = this.dataset.getRowKeys();
        }

        if (keys != null) {
            int section = 0;
            Iterator iterator = keys.iterator();
            while (iterator.hasNext()) {
                Comparable key = (Comparable) iterator.next();
                String label = key.toString();
                String description = label;
                Paint paint = (Paint) this.sectionPaints.get(key);
                LegendItem item = new LegendItem(label, description,
                        null, null, Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                        paint, Plot.DEFAULT_OUTLINE_STROKE, paint);
                item.setDataset(getDataset());
                result.add(item);
                section++;
            }
        }
        if (this.limit > 0.0) {
            result.add(new LegendItem(this.aggregatedItemsKey.toString(),
                    this.aggregatedItemsKey.toString(), null, null,
                    Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                    this.aggregatedItemsPaint,
                    Plot.DEFAULT_OUTLINE_STROKE,
                    this.aggregatedItemsPaint));
        }
    }
    return result;
}
 
Example 5
Source File: Chart_12_MultiplePiePlot_s.java    From coming with MIT License 4 votes vote down vote up
/**
 * Returns a collection of legend items for the pie chart.
 *
 * @return The legend items.
 */
public LegendItemCollection getLegendItems() {

    LegendItemCollection result = new LegendItemCollection();

    if (this.dataset != null) {
        List keys = null;

        prefetchSectionPaints();
        if (this.dataExtractOrder == TableOrder.BY_ROW) {
            keys = this.dataset.getColumnKeys();
        }
        else if (this.dataExtractOrder == TableOrder.BY_COLUMN) {
            keys = this.dataset.getRowKeys();
        }

        if (keys != null) {
            int section = 0;
            Iterator iterator = keys.iterator();
            while (iterator.hasNext()) {
                Comparable key = (Comparable) iterator.next();
                String label = key.toString();
                String description = label;
                Paint paint = (Paint) this.sectionPaints.get(key);
                LegendItem item = new LegendItem(label, description,
                        null, null, Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                        paint, Plot.DEFAULT_OUTLINE_STROKE, paint);
                item.setDataset(getDataset());
                result.add(item);
                section++;
            }
        }
        if (this.limit > 0.0) {
            result.add(new LegendItem(this.aggregatedItemsKey.toString(),
                    this.aggregatedItemsKey.toString(), null, null,
                    Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                    this.aggregatedItemsPaint,
                    Plot.DEFAULT_OUTLINE_STROKE,
                    this.aggregatedItemsPaint));
        }
    }
    return result;
}
 
Example 6
Source File: Arja_00174_s.java    From coming with MIT License 4 votes vote down vote up
/**
 * Returns a collection of legend items for the pie chart.
 *
 * @return The legend items.
 */
public LegendItemCollection getLegendItems() {

    LegendItemCollection result = new LegendItemCollection();

    if (this.dataset != null) {
        List keys = null;

        prefetchSectionPaints();
        if (this.dataExtractOrder == TableOrder.BY_ROW) {
            keys = this.dataset.getColumnKeys();
        }
        else if (this.dataExtractOrder == TableOrder.BY_COLUMN) {
            keys = this.dataset.getRowKeys();
        }

        if (keys != null) {
            int section = 0;
            Iterator iterator = keys.iterator();
            while (iterator.hasNext()) {
                Comparable key = (Comparable) iterator.next();
                String label = key.toString();
                String description = label;
                Paint paint = (Paint) this.sectionPaints.get(key);
                LegendItem item = new LegendItem(label, description,
                        null, null, Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                        paint, Plot.DEFAULT_OUTLINE_STROKE, paint);
                item.setDataset(getDataset());
                result.add(item);
                section++;
            }
        }
        if (this.limit > 0.0) {
            result.add(new LegendItem(this.aggregatedItemsKey.toString(),
                    this.aggregatedItemsKey.toString(), null, null,
                    Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                    this.aggregatedItemsPaint,
                    Plot.DEFAULT_OUTLINE_STROKE,
                    this.aggregatedItemsPaint));
        }
    }
    return result;
}
 
Example 7
Source File: Arja_001_s.java    From coming with MIT License 4 votes vote down vote up
/**
 * Returns a collection of legend items for the pie chart.
 *
 * @return The legend items.
 */
public LegendItemCollection getLegendItems() {

    LegendItemCollection result = new LegendItemCollection();

    if (this.dataset != null) {
        List keys = null;

        prefetchSectionPaints();
        if (this.dataExtractOrder == TableOrder.BY_ROW) {
            keys = this.dataset.getColumnKeys();
        }
        else if (this.dataExtractOrder == TableOrder.BY_COLUMN) {
            keys = this.dataset.getRowKeys();
        }

        if (keys != null) {
            int section = 0;
            Iterator iterator = keys.iterator();
            while (iterator.hasNext()) {
                Comparable key = (Comparable) iterator.next();
                String label = key.toString();
                String description = label;
                Paint paint = (Paint) this.sectionPaints.get(key);
                LegendItem item = new LegendItem(label, description,
                        null, null, Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                        paint, Plot.DEFAULT_OUTLINE_STROKE, paint);
                item.setDataset(getDataset());
                result.add(item);
                section++;
            }
        }
        if (this.limit > 0.0) {
            result.add(new LegendItem(this.aggregatedItemsKey.toString(),
                    this.aggregatedItemsKey.toString(), null, null,
                    Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                    this.aggregatedItemsPaint,
                    Plot.DEFAULT_OUTLINE_STROKE,
                    this.aggregatedItemsPaint));
        }
    }
    return result;
}
 
Example 8
Source File: arja3_three_s.java    From coming with MIT License 4 votes vote down vote up
/**
 * Returns a collection of legend items for the pie chart.
 *
 * @return The legend items.
 */
public LegendItemCollection getLegendItems() {

    LegendItemCollection result = new LegendItemCollection();

    if (this.dataset != null) {
        List keys = null;

        prefetchSectionPaints();
        if (this.dataExtractOrder == TableOrder.BY_ROW) {
            keys = this.dataset.getColumnKeys();
        }
        else if (this.dataExtractOrder == TableOrder.BY_COLUMN) {
            keys = this.dataset.getRowKeys();
        }

        if (keys != null) {
            int section = 0;
            Iterator iterator = keys.iterator();
            while (iterator.hasNext()) {
                Comparable key = (Comparable) iterator.next();
                String label = key.toString();
                String description = label;
                Paint paint = (Paint) this.sectionPaints.get(key);
                LegendItem item = new LegendItem(label, description,
                        null, null, Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                        paint, Plot.DEFAULT_OUTLINE_STROKE, paint);
                item.setDataset(getDataset());
                result.add(item);
                section++;
            }
        }
        if (this.limit > 0.0) {
            result.add(new LegendItem(this.aggregatedItemsKey.toString(),
                    this.aggregatedItemsKey.toString(), null, null,
                    Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                    this.aggregatedItemsPaint,
                    Plot.DEFAULT_OUTLINE_STROKE,
                    this.aggregatedItemsPaint));
        }
    }
    return result;
}
 
Example 9
Source File: Arja_00131_t.java    From coming with MIT License 4 votes vote down vote up
/**
 * Returns a collection of legend items for the pie chart.
 *
 * @return The legend items.
 */
public LegendItemCollection getLegendItems() {

    LegendItemCollection result = new LegendItemCollection();

    if (this.dataset != null) {
        List keys = null;

        prefetchSectionPaints();
        if (this.dataExtractOrder == TableOrder.BY_ROW) {
            keys = this.dataset.getColumnKeys();
        }
        else if (this.dataExtractOrder == TableOrder.BY_COLUMN) {
            keys = this.dataset.getRowKeys();
        }

        if (keys != null) {
            int section = 0;
            Iterator iterator = keys.iterator();
            while (iterator.hasNext()) {
                Comparable key = (Comparable) iterator.next();
                String label = key.toString();
                String description = label;
                Paint paint = (Paint) this.sectionPaints.get(key);
                LegendItem item = new LegendItem(label, description,
                        null, null, Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                        paint, Plot.DEFAULT_OUTLINE_STROKE, paint);
                item.setDataset(getDataset());
                result.add(item);
                section++;
            }
        }
        if (this.limit > 0.0) {
            result.add(new LegendItem(this.aggregatedItemsKey.toString(),
                    this.aggregatedItemsKey.toString(), null, null,
                    Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                    this.aggregatedItemsPaint,
                    Plot.DEFAULT_OUTLINE_STROKE,
                    this.aggregatedItemsPaint));
        }
    }
    return result;
}
 
Example 10
Source File: arja3_three_s.java    From coming with MIT License 4 votes vote down vote up
/**
 * Returns a collection of legend items for the pie chart.
 *
 * @return The legend items.
 */
public LegendItemCollection getLegendItems() {

    LegendItemCollection result = new LegendItemCollection();

    if (this.dataset != null) {
        List keys = null;

        prefetchSectionPaints();
        if (this.dataExtractOrder == TableOrder.BY_ROW) {
            keys = this.dataset.getColumnKeys();
        }
        else if (this.dataExtractOrder == TableOrder.BY_COLUMN) {
            keys = this.dataset.getRowKeys();
        }

        if (keys != null) {
            int section = 0;
            Iterator iterator = keys.iterator();
            while (iterator.hasNext()) {
                Comparable key = (Comparable) iterator.next();
                String label = key.toString();
                String description = label;
                Paint paint = (Paint) this.sectionPaints.get(key);
                LegendItem item = new LegendItem(label, description,
                        null, null, Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                        paint, Plot.DEFAULT_OUTLINE_STROKE, paint);
                item.setDataset(getDataset());
                result.add(item);
                section++;
            }
        }
        if (this.limit > 0.0) {
            result.add(new LegendItem(this.aggregatedItemsKey.toString(),
                    this.aggregatedItemsKey.toString(), null, null,
                    Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                    this.aggregatedItemsPaint,
                    Plot.DEFAULT_OUTLINE_STROKE,
                    this.aggregatedItemsPaint));
        }
    }
    return result;
}
 
Example 11
Source File: Arja_00148_s.java    From coming with MIT License 4 votes vote down vote up
/**
 * Returns a collection of legend items for the pie chart.
 *
 * @return The legend items.
 */
public LegendItemCollection getLegendItems() {

    LegendItemCollection result = new LegendItemCollection();

    if (this.dataset != null) {
        List keys = null;

        prefetchSectionPaints();
        if (this.dataExtractOrder == TableOrder.BY_ROW) {
            keys = this.dataset.getColumnKeys();
        }
        else if (this.dataExtractOrder == TableOrder.BY_COLUMN) {
            keys = this.dataset.getRowKeys();
        }

        if (keys != null) {
            int section = 0;
            Iterator iterator = keys.iterator();
            while (iterator.hasNext()) {
                Comparable key = (Comparable) iterator.next();
                String label = key.toString();
                String description = label;
                Paint paint = (Paint) this.sectionPaints.get(key);
                LegendItem item = new LegendItem(label, description,
                        null, null, Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                        paint, Plot.DEFAULT_OUTLINE_STROKE, paint);
                item.setDataset(getDataset());
                result.add(item);
                section++;
            }
        }
        if (this.limit > 0.0) {
            result.add(new LegendItem(this.aggregatedItemsKey.toString(),
                    this.aggregatedItemsKey.toString(), null, null,
                    Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                    this.aggregatedItemsPaint,
                    Plot.DEFAULT_OUTLINE_STROKE,
                    this.aggregatedItemsPaint));
        }
    }
    return result;
}
 
Example 12
Source File: Arja_00148_t.java    From coming with MIT License 4 votes vote down vote up
/**
 * Returns a collection of legend items for the pie chart.
 *
 * @return The legend items.
 */
public LegendItemCollection getLegendItems() {

    LegendItemCollection result = new LegendItemCollection();

    if (this.dataset != null) {
        List keys = null;

        prefetchSectionPaints();
        if (this.dataExtractOrder == TableOrder.BY_ROW) {
            keys = this.dataset.getColumnKeys();
        }
        else if (this.dataExtractOrder == TableOrder.BY_COLUMN) {
            keys = this.dataset.getRowKeys();
        }

        if (keys != null) {
            int section = 0;
            Iterator iterator = keys.iterator();
            while (iterator.hasNext()) {
                Comparable key = (Comparable) iterator.next();
                String label = key.toString();
                String description = label;
                Paint paint = (Paint) this.sectionPaints.get(key);
                LegendItem item = new LegendItem(label, description,
                        null, null, Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                        paint, Plot.DEFAULT_OUTLINE_STROKE, paint);
                item.setDataset(getDataset());
                result.add(item);
                section++;
            }
        }
        if (this.limit > 0.0) {
            result.add(new LegendItem(this.aggregatedItemsKey.toString(),
                    this.aggregatedItemsKey.toString(), null, null,
                    Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                    this.aggregatedItemsPaint,
                    Plot.DEFAULT_OUTLINE_STROKE,
                    this.aggregatedItemsPaint));
        }
    }
    return result;
}
 
Example 13
Source File: arja3_three_t.java    From coming with MIT License 4 votes vote down vote up
/**
 * Returns a collection of legend items for the pie chart.
 *
 * @return The legend items.
 */
public LegendItemCollection getLegendItems() {

    LegendItemCollection result = new LegendItemCollection();

    if (this.dataset != null) {
        List keys = null;

        prefetchSectionPaints();
        if (this.dataExtractOrder == TableOrder.BY_ROW) {
            keys = this.dataset.getColumnKeys();
        }
        else if (this.dataExtractOrder == TableOrder.BY_COLUMN) {
            keys = this.dataset.getRowKeys();
        }

        if (keys != null) {
            int section = 0;
            Iterator iterator = keys.iterator();
            while (iterator.hasNext()) {
                Comparable key = (Comparable) iterator.next();
                String label = key.toString();
                String description = label;
                Paint paint = (Paint) this.sectionPaints.get(key);
                LegendItem item = new LegendItem(label, description,
                        null, null, Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                        paint, Plot.DEFAULT_OUTLINE_STROKE, paint);
                item.setDataset(getDataset());
                result.add(item);
                section++;
            }
        }
        if (this.limit > 0.0) {
            result.add(new LegendItem(this.aggregatedItemsKey.toString(),
                    this.aggregatedItemsKey.toString(), null, null,
                    Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                    this.aggregatedItemsPaint,
                    Plot.DEFAULT_OUTLINE_STROKE,
                    this.aggregatedItemsPaint));
        }
    }
    return result;
}
 
Example 14
Source File: Arja_00162_s.java    From coming with MIT License 4 votes vote down vote up
/**
 * Returns a collection of legend items for the pie chart.
 *
 * @return The legend items.
 */
public LegendItemCollection getLegendItems() {

    LegendItemCollection result = new LegendItemCollection();

    if (this.dataset != null) {
        List keys = null;

        prefetchSectionPaints();
        if (this.dataExtractOrder == TableOrder.BY_ROW) {
            keys = this.dataset.getColumnKeys();
        }
        else if (this.dataExtractOrder == TableOrder.BY_COLUMN) {
            keys = this.dataset.getRowKeys();
        }

        if (keys != null) {
            int section = 0;
            Iterator iterator = keys.iterator();
            while (iterator.hasNext()) {
                Comparable key = (Comparable) iterator.next();
                String label = key.toString();
                String description = label;
                Paint paint = (Paint) this.sectionPaints.get(key);
                LegendItem item = new LegendItem(label, description,
                        null, null, Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                        paint, Plot.DEFAULT_OUTLINE_STROKE, paint);
                item.setDataset(getDataset());
                result.add(item);
                section++;
            }
        }
        if (this.limit > 0.0) {
            result.add(new LegendItem(this.aggregatedItemsKey.toString(),
                    this.aggregatedItemsKey.toString(), null, null,
                    Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                    this.aggregatedItemsPaint,
                    Plot.DEFAULT_OUTLINE_STROKE,
                    this.aggregatedItemsPaint));
        }
    }
    return result;
}
 
Example 15
Source File: Chart_12_MultiplePiePlot_t.java    From coming with MIT License 4 votes vote down vote up
/**
 * Returns a collection of legend items for the pie chart.
 *
 * @return The legend items.
 */
public LegendItemCollection getLegendItems() {

    LegendItemCollection result = new LegendItemCollection();

    if (this.dataset != null) {
        List keys = null;

        prefetchSectionPaints();
        if (this.dataExtractOrder == TableOrder.BY_ROW) {
            keys = this.dataset.getColumnKeys();
        }
        else if (this.dataExtractOrder == TableOrder.BY_COLUMN) {
            keys = this.dataset.getRowKeys();
        }

        if (keys != null) {
            int section = 0;
            Iterator iterator = keys.iterator();
            while (iterator.hasNext()) {
                Comparable key = (Comparable) iterator.next();
                String label = key.toString();
                String description = label;
                Paint paint = (Paint) this.sectionPaints.get(key);
                LegendItem item = new LegendItem(label, description,
                        null, null, Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                        paint, Plot.DEFAULT_OUTLINE_STROKE, paint);
                item.setDataset(getDataset());
                result.add(item);
                section++;
            }
        }
        if (this.limit > 0.0) {
            result.add(new LegendItem(this.aggregatedItemsKey.toString(),
                    this.aggregatedItemsKey.toString(), null, null,
                    Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                    this.aggregatedItemsPaint,
                    Plot.DEFAULT_OUTLINE_STROKE,
                    this.aggregatedItemsPaint));
        }
    }
    return result;
}
 
Example 16
Source File: Arja_0090_s.java    From coming with MIT License 4 votes vote down vote up
/**
 * Returns a collection of legend items for the pie chart.
 *
 * @return The legend items.
 */
public LegendItemCollection getLegendItems() {

    LegendItemCollection result = new LegendItemCollection();

    if (this.dataset != null) {
        List keys = null;

        prefetchSectionPaints();
        if (this.dataExtractOrder == TableOrder.BY_ROW) {
            keys = this.dataset.getColumnKeys();
        }
        else if (this.dataExtractOrder == TableOrder.BY_COLUMN) {
            keys = this.dataset.getRowKeys();
        }

        if (keys != null) {
            int section = 0;
            Iterator iterator = keys.iterator();
            while (iterator.hasNext()) {
                Comparable key = (Comparable) iterator.next();
                String label = key.toString();
                String description = label;
                Paint paint = (Paint) this.sectionPaints.get(key);
                LegendItem item = new LegendItem(label, description,
                        null, null, Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                        paint, Plot.DEFAULT_OUTLINE_STROKE, paint);
                item.setDataset(getDataset());
                result.add(item);
                section++;
            }
        }
        if (this.limit > 0.0) {
            result.add(new LegendItem(this.aggregatedItemsKey.toString(),
                    this.aggregatedItemsKey.toString(), null, null,
                    Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                    this.aggregatedItemsPaint,
                    Plot.DEFAULT_OUTLINE_STROKE,
                    this.aggregatedItemsPaint));
        }
    }
    return result;
}
 
Example 17
Source File: Arja_002_s.java    From coming with MIT License 4 votes vote down vote up
/**
 * Returns a collection of legend items for the pie chart.
 *
 * @return The legend items.
 */
public LegendItemCollection getLegendItems() {

    LegendItemCollection result = new LegendItemCollection();

    if (this.dataset != null) {
        List keys = null;

        prefetchSectionPaints();
        if (this.dataExtractOrder == TableOrder.BY_ROW) {
            keys = this.dataset.getColumnKeys();
        }
        else if (this.dataExtractOrder == TableOrder.BY_COLUMN) {
            keys = this.dataset.getRowKeys();
        }

        if (keys != null) {
            int section = 0;
            Iterator iterator = keys.iterator();
            while (iterator.hasNext()) {
                Comparable key = (Comparable) iterator.next();
                String label = key.toString();
                String description = label;
                Paint paint = (Paint) this.sectionPaints.get(key);
                LegendItem item = new LegendItem(label, description,
                        null, null, Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                        paint, Plot.DEFAULT_OUTLINE_STROKE, paint);
                item.setDataset(getDataset());
                result.add(item);
                section++;
            }
        }
        if (this.limit > 0.0) {
            result.add(new LegendItem(this.aggregatedItemsKey.toString(),
                    this.aggregatedItemsKey.toString(), null, null,
                    Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                    this.aggregatedItemsPaint,
                    Plot.DEFAULT_OUTLINE_STROKE,
                    this.aggregatedItemsPaint));
        }
    }
    return result;
}
 
Example 18
Source File: Arja_002_t.java    From coming with MIT License 4 votes vote down vote up
/**
 * Returns a collection of legend items for the pie chart.
 *
 * @return The legend items.
 */
public LegendItemCollection getLegendItems() {

    LegendItemCollection result = new LegendItemCollection();

    if (this.dataset != null) {
        List keys = null;

        prefetchSectionPaints();
        if (this.dataExtractOrder == TableOrder.BY_ROW) {
            keys = this.dataset.getColumnKeys();
        }
        else if (this.dataExtractOrder == TableOrder.BY_COLUMN) {
            keys = this.dataset.getRowKeys();
        }

        if (keys != null) {
            int section = 0;
            Iterator iterator = keys.iterator();
            while (iterator.hasNext()) {
                Comparable key = (Comparable) iterator.next();
                String label = key.toString();
                String description = label;
                Paint paint = (Paint) this.sectionPaints.get(key);
                LegendItem item = new LegendItem(label, description,
                        null, null, Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                        paint, Plot.DEFAULT_OUTLINE_STROKE, paint);
                item.setDataset(getDataset());
                result.add(item);
                section++;
            }
        }
        if (this.limit > 0.0) {
            result.add(new LegendItem(this.aggregatedItemsKey.toString(),
                    this.aggregatedItemsKey.toString(), null, null,
                    Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                    this.aggregatedItemsPaint,
                    Plot.DEFAULT_OUTLINE_STROKE,
                    this.aggregatedItemsPaint));
        }
    }
    return result;
}
 
Example 19
Source File: 1_MultiplePiePlot.java    From SimFix with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Returns a collection of legend items for the pie chart.
 *
 * @return The legend items.
 */
public LegendItemCollection getLegendItems() {

    LegendItemCollection result = new LegendItemCollection();

    if (this.dataset != null) {
        List keys = null;

        prefetchSectionPaints();
        if (this.dataExtractOrder == TableOrder.BY_ROW) {
            keys = this.dataset.getColumnKeys();
        }
        else if (this.dataExtractOrder == TableOrder.BY_COLUMN) {
            keys = this.dataset.getRowKeys();
        }

        if (keys != null) {
            int section = 0;
            Iterator iterator = keys.iterator();
            while (iterator.hasNext()) {
                Comparable key = (Comparable) iterator.next();
                String label = key.toString();
                String description = label;
                Paint paint = (Paint) this.sectionPaints.get(key);
                LegendItem item = new LegendItem(label, description,
                        null, null, Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                        paint, Plot.DEFAULT_OUTLINE_STROKE, paint);
                item.setDataset(getDataset());
                result.add(item);
                section++;
            }
        }
        if (this.limit > 0.0) {
            result.add(new LegendItem(this.aggregatedItemsKey.toString(),
                    this.aggregatedItemsKey.toString(), null, null,
                    Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                    this.aggregatedItemsPaint,
                    Plot.DEFAULT_OUTLINE_STROKE,
                    this.aggregatedItemsPaint));
        }
    }
    return result;
}
 
Example 20
Source File: 1_MultiplePiePlot.java    From SimFix with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Returns a collection of legend items for the pie chart.
 *
 * @return The legend items.
 */
public LegendItemCollection getLegendItems() {

    LegendItemCollection result = new LegendItemCollection();

    if (this.dataset != null) {
        List keys = null;

        prefetchSectionPaints();
        if (this.dataExtractOrder == TableOrder.BY_ROW) {
            keys = this.dataset.getColumnKeys();
        }
        else if (this.dataExtractOrder == TableOrder.BY_COLUMN) {
            keys = this.dataset.getRowKeys();
        }

        if (keys != null) {
            int section = 0;
            Iterator iterator = keys.iterator();
            while (iterator.hasNext()) {
                Comparable key = (Comparable) iterator.next();
                String label = key.toString();
                String description = label;
                Paint paint = (Paint) this.sectionPaints.get(key);
                LegendItem item = new LegendItem(label, description,
                        null, null, Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                        paint, Plot.DEFAULT_OUTLINE_STROKE, paint);
                item.setDataset(getDataset());
                result.add(item);
                section++;
            }
        }
        if (this.limit > 0.0) {
            result.add(new LegendItem(this.aggregatedItemsKey.toString(),
                    this.aggregatedItemsKey.toString(), null, null,
                    Plot.DEFAULT_LEGEND_ITEM_CIRCLE,
                    this.aggregatedItemsPaint,
                    Plot.DEFAULT_OUTLINE_STROKE,
                    this.aggregatedItemsPaint));
        }
    }
    return result;
}