Example usage for org.jfree.chart.plot SpiderWebPlot getAxisLineStroke

List of usage examples for org.jfree.chart.plot SpiderWebPlot getAxisLineStroke

Introduction

In this page you can find the example usage for org.jfree.chart.plot SpiderWebPlot getAxisLineStroke.

Prototype

public Stroke getAxisLineStroke() 

Source Link

Document

Returns the stroke used to draw the axis lines.

Usage

From source file:net.sf.dynamicreports.test.jasper.chart.SpiderChartTest.java

@Override
public void test() {
    super.test();

    numberOfPagesTest(1);//from   www. j a v  a  2 s  .  c  o  m

    JRPrintFrame printFrame = (JRPrintFrame) getElementAt("summary.list1", 0);

    JRPrintImage image = (JRPrintImage) printFrame.getElements().get(0);
    JFreeChart chart = getChart(image);
    SpiderWebPlot plot = (SpiderWebPlot) chart.getPlot();
    Assert.assertEquals("max value", 10d, plot.getMaxValue());
    Assert.assertEquals("rotation", Rotation.ANTICLOCKWISE, plot.getDirection());
    Assert.assertEquals("table order", org.jfree.util.TableOrder.BY_COLUMN, plot.getDataExtractOrder());
    Assert.assertFalse("web filled", plot.isWebFilled());
    Assert.assertEquals("start angle", 20d, plot.getStartAngle());
    Assert.assertEquals("head percent", 30d, plot.getHeadPercent());
    Assert.assertEquals("interior gap", 0.15d, plot.getInteriorGap());
    Assert.assertEquals("axis line color", Color.RED, plot.getAxisLinePaint());
    Assert.assertEquals("interior gap", 2f, ((BasicStroke) plot.getAxisLineStroke()).getLineWidth());
    Assert.assertEquals("label color", Color.BLUE, plot.getLabelPaint());
    Assert.assertEquals("label gap", 2d, plot.getAxisLabelGap());
    Assert.assertTrue("label font", plot.getLabelFont().isBold());

    image = (JRPrintImage) printFrame.getElements().get(1);
    chart = getChart(image);
    plot = (SpiderWebPlot) chart.getPlot();
    Assert.assertEquals("title", "title", chart.getTitle().getText());
    Assert.assertEquals("subtitle", "subtitle", ((TextTitle) chart.getSubtitle(1)).getText());
}