Package org.jfree.chart.axis

Examples of org.jfree.chart.axis.SymbolAxis


        xyplot.setDomainAxis(dateAxis);

        String[] phaseNameList = new String[phases.size()];
        for (int i = 0;  i < phaseNameList.length;  i++)
            phaseNameList[i] = Translator.translate(phases.get(i));
        SymbolAxis symbolaxis = new SymbolAxis(null, phaseNameList);
        symbolaxis.setGridBandsVisible(false);
        xyplot.setRangeAxis(symbolaxis);

        final XYBarRenderer renderer = (XYBarRenderer) xyplot.getRenderer();
        renderer.setUseYInterval(true);
        renderer.setDrawBarOutline(true);
View Full Code Here


     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {

        String[] tickLabels = new String[] {"One", "Two", "Three"};
        SymbolAxis a1 = new SymbolAxis("Test Axis", tickLabels);
        SymbolAxis a2 = null;

        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(a1);
View Full Code Here

    /**
     * Confirm that cloning works.
     */
    public void testCloning() {
        SymbolAxis a1 = new SymbolAxis("Axis", new String[] {"A", "B"});
        SymbolAxis a2 = null;
        try {
            a2 = (SymbolAxis) a1.clone();
        }
        catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        assertTrue(a1 != a2);
        assertTrue(a1.getClass() == a2.getClass());
        assertTrue(a1.equals(a2));
    }
View Full Code Here

    /**
     * Confirm that the equals method can distinguish all the required fields.
     */
    public void testEquals() {
        SymbolAxis a1 = new SymbolAxis("Axis", new String[] {"A", "B"});
        SymbolAxis a2 = new SymbolAxis("Axis", new String[] {"A", "B"});
        assertTrue(a1.equals(a2));
        assertTrue(a2.equals(a1));

        a1 = new SymbolAxis("Axis 2", new String[] {"A", "B"});
        assertFalse(a1.equals(a2));
        a2 = new SymbolAxis("Axis 2", new String[] {"A", "B"});
        assertTrue(a1.equals(a2));

        a1 = new SymbolAxis("Axis 2", new String[] {"C", "B"});
        assertFalse(a1.equals(a2));
        a2 = new SymbolAxis("Axis 2", new String[] {"C", "B"});
        assertTrue(a1.equals(a2));

        a1.setGridBandsVisible(false);
        assertFalse(a1.equals(a2));
        a2.setGridBandsVisible(false);
        assertTrue(a1.equals(a2));

        a1.setGridBandPaint(Color.black);
        assertFalse(a1.equals(a2));
        a2.setGridBandPaint(Color.black);
        assertTrue(a1.equals(a2));

        a1.setGridBandAlternatePaint(Color.red);
        assertFalse(a1.equals(a2));
        a2.setGridBandAlternatePaint(Color.red);
        assertTrue(a1.equals(a2));
    }
View Full Code Here

     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {

        String[] tickLabels = new String[] {"One", "Two", "Three"};
        SymbolAxis a1 = new SymbolAxis("Test Axis", tickLabels);
        SymbolAxis a2 = null;

        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(a1);
View Full Code Here

    /**
     * Confirm that cloning works.
     */
    public void testCloning() {
        SymbolAxis a1 = new SymbolAxis("Axis", new String[] {"A", "B"});
        SymbolAxis a2 = null;
        try {
            a2 = (SymbolAxis) a1.clone();
        }
        catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        assertTrue(a1 != a2);
        assertTrue(a1.getClass() == a2.getClass());
        assertTrue(a1.equals(a2));
    }
View Full Code Here

    /**
     * Confirm that the equals method can distinguish all the required fields.
     */
    public void testEquals() {
        SymbolAxis a1 = new SymbolAxis("Axis", new String[] {"A", "B"});
        SymbolAxis a2 = new SymbolAxis("Axis", new String[] {"A", "B"});
        assertTrue(a1.equals(a2));
        assertTrue(a2.equals(a1));

        a1 = new SymbolAxis("Axis 2", new String[] {"A", "B"});
        assertFalse(a1.equals(a2));
        a2 = new SymbolAxis("Axis 2", new String[] {"A", "B"});
        assertTrue(a1.equals(a2));

        a1 = new SymbolAxis("Axis 2", new String[] {"C", "B"});
        assertFalse(a1.equals(a2));
        a2 = new SymbolAxis("Axis 2", new String[] {"C", "B"});
        assertTrue(a1.equals(a2));

        a1.setGridBandsVisible(false);
        assertFalse(a1.equals(a2));
        a2.setGridBandsVisible(false);
        assertTrue(a1.equals(a2));

        a1.setGridBandPaint(Color.black);
        assertFalse(a1.equals(a2));
        a2.setGridBandPaint(Color.black);
        assertTrue(a1.equals(a2));

        a1.setGridBandAlternatePaint(Color.red);
        assertFalse(a1.equals(a2));
        a2.setGridBandAlternatePaint(Color.red);
        assertTrue(a1.equals(a2));
    }
View Full Code Here

    }
        chart.removeLegend();
        chart.setBackgroundPaint(Color.white);
       
        //Sets legend labels
        SymbolAxis scaleAxis = new SymbolAxis(null,legendLabels);
        scaleAxis.setRange(0.5, 0.5+zvalues.length);
        scaleAxis.setPlot(new PiePlot());
        scaleAxis.setGridBandsVisible(false);
        scaleAxis.setLabel(zLabel);
        //scaleAxis.setLabelAngle(3.14/2);
        scaleAxis.setLabelFont(addLabelsStyle.getFont());
        scaleAxis.setLabelPaint(addLabelsStyle.getColor());
     
        //draws legend as chart subtitle
        PaintScaleLegend psl = new PaintScaleLegend(legendPaintScale, scaleAxis);
        psl.setAxisOffset(2.0);
        psl.setPosition(RectangleEdge.RIGHT);
        psl.setMargin(new RectangleInsets(5, 1, 5, 1));       
        chart.addSubtitle(psl);
       
        if(yLabels!=null){
          //Sets y legend labels
          LookupPaintScale legendPaintScale2 = new LookupPaintScale(0, (yLabels.length-1), Color.white);
         
          for (int ke=0; ke<yLabels.length ; ke++){
            Color temp =Color.white;
            legendPaintScale2.add(1+ke, temp);
          }
         
          SymbolAxis scaleAxis2 = new SymbolAxis(null,yLabels);
          scaleAxis2.setRange(0, (yLabels.length-1));
          scaleAxis2.setPlot(new PiePlot());
          scaleAxis2.setGridBandsVisible(false);
       
          //draws legend as chart subtitle
          PaintScaleLegend psl2 = new PaintScaleLegend(legendPaintScale2, scaleAxis2);
          psl2.setAxisOffset(5.0);
          psl2.setPosition(RectangleEdge.LEFT);
View Full Code Here

    }
    renderer.setPaintScale(paintScale);



    SymbolAxis scaleAxis = new SymbolAxis(null, labels);
    scaleAxis.setRange(0.5, ranges.size()+0.5);
    scaleAxis.setPlot(new PiePlot());
    scaleAxis.setGridBandsVisible(false);

    org.jfree.chart.title.PaintScaleLegend psl = new PaintScaleLegend(paintScale, scaleAxis);
    psl.setMargin(new RectangleInsets(3, 10, 3, 10));
    psl.setPosition(RectangleEdge.BOTTOM);
    psl.setAxisOffset(5.0);
View Full Code Here

     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {

        String[] tickLabels = new String[] {"One", "Two", "Three"};
        SymbolAxis a1 = new SymbolAxis("Test Axis", tickLabels);
        SymbolAxis a2 = null;

        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(a1);
View Full Code Here

TOP

Related Classes of org.jfree.chart.axis.SymbolAxis

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.