Example usage for org.jfree.chart.plot.dial StandardDialScale getMinorTickCount

List of usage examples for org.jfree.chart.plot.dial StandardDialScale getMinorTickCount

Introduction

In this page you can find the example usage for org.jfree.chart.plot.dial StandardDialScale getMinorTickCount.

Prototype

public int getMinorTickCount() 

Source Link

Document

Returns the number of minor tick marks between major tick marks.

Usage

From source file:org.pentaho.chart.plugin.jfreechart.dial.JFreeDialChartGeneratorIT.java

public void testScale() throws Exception {
    JFreeChart chart = getJFreeChart("testchart.xml", new Object[][] { { 8D } }); //$NON-NLS-1$
    DialPlot plot = (DialPlot) chart.getPlot();
    StandardDialScale scale = (StandardDialScale) plot.getScale(0);
    assertEquals(-20D, scale.getLowerBound());
    assertEquals(20D, scale.getUpperBound());
    assertEquals(-135D, scale.getStartAngle());
    assertEquals(-180D, scale.getExtent());

    assertEquals(5D, scale.getMajorTickIncrement());
    assertEquals(2, scale.getMinorTickCount());

    assertEquals(new Color(255, 105, 180) /*hotpink*/, scale.getTickLabelPaint());
    assertEquals(12, scale.getTickLabelFont().getSize());
    assertEquals(Font.ITALIC | Font.BOLD, scale.getTickLabelFont().getStyle());
    // had trouble getting a font comparison to work without breaking it down into size, style, and name
    assertEquals("Monospaced", scale.getTickLabelFont().getName()); //$NON-NLS-1$

    assertEquals(5F, ((BasicStroke) scale.getMajorTickStroke()).getLineWidth());
    assertEquals(3F, ((BasicStroke) scale.getMinorTickStroke()).getLineWidth());

    assertEquals(0.10D, scale.getMajorTickLength());
    assertEquals(0.05D, scale.getMinorTickLength());

}