Search in sources :

Example 31 with CategoryItemRenderer

use of org.jfree.chart.renderer.category.CategoryItemRenderer in project SIMVA-SoS by SESoS.

the class StackedAreaChartTest method testSetSeriesToolTipGenerator.

/**
 * Check that setting a tool tip generator for a series does override the
 * default generator.
 */
@Test
public void testSetSeriesToolTipGenerator() {
    CategoryPlot plot = (CategoryPlot) this.chart.getPlot();
    CategoryItemRenderer renderer = plot.getRenderer();
    StandardCategoryToolTipGenerator tt = new StandardCategoryToolTipGenerator();
    renderer.setSeriesToolTipGenerator(0, tt);
    CategoryToolTipGenerator tt2 = renderer.getToolTipGenerator(0, 0);
    assertTrue(tt2 == tt);
}
Also used : CategoryItemRenderer(org.jfree.chart.renderer.category.CategoryItemRenderer) StandardCategoryToolTipGenerator(org.jfree.chart.labels.StandardCategoryToolTipGenerator) CategoryToolTipGenerator(org.jfree.chart.labels.CategoryToolTipGenerator) StandardCategoryToolTipGenerator(org.jfree.chart.labels.StandardCategoryToolTipGenerator) CategoryPlot(org.jfree.chart.plot.CategoryPlot) Test(org.junit.Test)

Example 32 with CategoryItemRenderer

use of org.jfree.chart.renderer.category.CategoryItemRenderer in project SIMVA-SoS by SESoS.

the class StackedBarChart3DTest method testSetSeriesToolTipGenerator.

/**
 * Check that setting a tool tip generator for a series does override the
 * default generator.
 */
@Test
public void testSetSeriesToolTipGenerator() {
    CategoryPlot plot = (CategoryPlot) this.chart.getPlot();
    CategoryItemRenderer renderer = plot.getRenderer();
    StandardCategoryToolTipGenerator tt = new StandardCategoryToolTipGenerator();
    renderer.setSeriesToolTipGenerator(0, tt);
    CategoryToolTipGenerator tt2 = renderer.getToolTipGenerator(0, 0);
    assertTrue(tt2 == tt);
}
Also used : CategoryItemRenderer(org.jfree.chart.renderer.category.CategoryItemRenderer) StandardCategoryToolTipGenerator(org.jfree.chart.labels.StandardCategoryToolTipGenerator) CategoryToolTipGenerator(org.jfree.chart.labels.CategoryToolTipGenerator) StandardCategoryToolTipGenerator(org.jfree.chart.labels.StandardCategoryToolTipGenerator) CategoryPlot(org.jfree.chart.plot.CategoryPlot) Test(org.junit.Test)

Example 33 with CategoryItemRenderer

use of org.jfree.chart.renderer.category.CategoryItemRenderer in project SIMVA-SoS by SESoS.

the class StackedBarChartTest method testSetSeriesToolTipGenerator.

/**
 * Check that setting a tool tip generator for a series does override the
 * default generator.
 */
@Test
public void testSetSeriesToolTipGenerator() {
    CategoryPlot plot = (CategoryPlot) this.chart.getPlot();
    CategoryItemRenderer renderer = plot.getRenderer();
    StandardCategoryToolTipGenerator tt = new StandardCategoryToolTipGenerator();
    renderer.setSeriesToolTipGenerator(0, tt);
    CategoryToolTipGenerator tt2 = renderer.getToolTipGenerator(0, 0);
    assertTrue(tt2 == tt);
}
Also used : CategoryItemRenderer(org.jfree.chart.renderer.category.CategoryItemRenderer) StandardCategoryToolTipGenerator(org.jfree.chart.labels.StandardCategoryToolTipGenerator) CategoryToolTipGenerator(org.jfree.chart.labels.CategoryToolTipGenerator) StandardCategoryToolTipGenerator(org.jfree.chart.labels.StandardCategoryToolTipGenerator) CategoryPlot(org.jfree.chart.plot.CategoryPlot) Test(org.junit.Test)

Example 34 with CategoryItemRenderer

use of org.jfree.chart.renderer.category.CategoryItemRenderer in project SIMVA-SoS by SESoS.

the class LineChart3DTest method testSetSeriesToolTipGenerator.

/**
 * Check that setting a tool tip generator for a series does override the
 * default generator.
 */
@Test
public void testSetSeriesToolTipGenerator() {
    CategoryPlot plot = (CategoryPlot) this.chart.getPlot();
    CategoryItemRenderer renderer = plot.getRenderer();
    StandardCategoryToolTipGenerator tt = new StandardCategoryToolTipGenerator();
    renderer.setSeriesToolTipGenerator(0, tt);
    CategoryToolTipGenerator tt2 = renderer.getToolTipGenerator(0, 0);
    assertSame(tt2, tt);
}
Also used : CategoryItemRenderer(org.jfree.chart.renderer.category.CategoryItemRenderer) StandardCategoryToolTipGenerator(org.jfree.chart.labels.StandardCategoryToolTipGenerator) CategoryToolTipGenerator(org.jfree.chart.labels.CategoryToolTipGenerator) StandardCategoryToolTipGenerator(org.jfree.chart.labels.StandardCategoryToolTipGenerator) CategoryPlot(org.jfree.chart.plot.CategoryPlot) Test(org.junit.Test)

Example 35 with CategoryItemRenderer

use of org.jfree.chart.renderer.category.CategoryItemRenderer in project qpid-broker-j by apache.

the class CategoryStrokeAndPaintApplier method setSeriesShape.

@Override
public void setSeriesShape(final int seriesIndex, final java.awt.Shape shape, final JFreeChart targetChart) {
    CategoryItemRenderer renderer = targetChart.getCategoryPlot().getRenderer();
    if (renderer instanceof LineAndShapeRenderer) {
        LineAndShapeRenderer lineAndShapeRenderer = (LineAndShapeRenderer) renderer;
        lineAndShapeRenderer.setSeriesShapesVisible(seriesIndex, true);
        lineAndShapeRenderer.setSeriesShape(seriesIndex, shape);
    }
}
Also used : LineAndShapeRenderer(org.jfree.chart.renderer.category.LineAndShapeRenderer) CategoryItemRenderer(org.jfree.chart.renderer.category.CategoryItemRenderer)

Aggregations

CategoryItemRenderer (org.jfree.chart.renderer.category.CategoryItemRenderer)70 CategoryPlot (org.jfree.chart.plot.CategoryPlot)36 Test (org.junit.Test)32 CategoryAxis (org.jfree.chart.axis.CategoryAxis)23 CategoryDataset (org.jfree.data.category.CategoryDataset)20 AbstractCategoryItemRenderer (org.jfree.chart.renderer.category.AbstractCategoryItemRenderer)14 Paint (java.awt.Paint)13 NumberAxis (org.jfree.chart.axis.NumberAxis)13 DefaultCategoryDataset (org.jfree.data.category.DefaultCategoryDataset)13 BarRenderer (org.jfree.chart.renderer.category.BarRenderer)12 DefaultCategoryItemRenderer (org.jfree.chart.renderer.category.DefaultCategoryItemRenderer)12 StandardCategoryURLGenerator (org.jfree.chart.urls.StandardCategoryURLGenerator)12 StandardCategoryToolTipGenerator (org.jfree.chart.labels.StandardCategoryToolTipGenerator)11 ValueAxis (org.jfree.chart.axis.ValueAxis)10 CategoryToolTipGenerator (org.jfree.chart.labels.CategoryToolTipGenerator)10 CategoryURLGenerator (org.jfree.chart.urls.CategoryURLGenerator)10 LineAndShapeRenderer (org.jfree.chart.renderer.category.LineAndShapeRenderer)9 JFreeChart (org.jfree.chart.JFreeChart)6 XYItemRenderer (org.jfree.chart.renderer.xy.XYItemRenderer)5 Rectangle2D (java.awt.geom.Rectangle2D)4