Examples of ItemLabelPosition


Examples of org.jfree.chart.labels.ItemLabelPosition

      this.itemLabelPaintList = new PaintList();
      this.baseItemLabelPaint = Color.black;

      this.positiveItemLabelPosition = null;
      this.positiveItemLabelPositionList = new ObjectList();
      this.basePositiveItemLabelPosition = new ItemLabelPosition(
              ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER);

      this.negativeItemLabelPosition = null;
      this.negativeItemLabelPositionList = new ObjectList();
      this.baseNegativeItemLabelPosition = new ItemLabelPosition(
              ItemLabelAnchor.OUTSIDE6, TextAnchor.TOP_CENTER);

      this.createEntities = null;
      this.createEntitiesList = new BooleanList();
      this.baseCreateEntities = true;
View Full Code Here

Examples of org.jfree.chart.labels.ItemLabelPosition

      {
         return this.positiveItemLabelPosition;
      }

      // otherwise look up the position table
      ItemLabelPosition position = (ItemLabelPosition) this.positiveItemLabelPositionList.get(series);
      if (position == null)
      {
         position = this.basePositiveItemLabelPosition;
      }
      return position;
View Full Code Here

Examples of org.jfree.chart.labels.ItemLabelPosition

      {
         return this.negativeItemLabelPosition;
      }

      // otherwise look up the position list
      ItemLabelPosition position = (ItemLabelPosition) this.negativeItemLabelPositionList.get(series);
      if (position == null)
      {
         position = this.baseNegativeItemLabelPosition;
      }
      return position;
View Full Code Here

Examples of org.jfree.chart.labels.ItemLabelPosition

        CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel);
        ValueAxis valueAxis = new NumberAxis(valueAxisLabel);

        BarRenderer renderer = new BarRenderer();
        if (orientation == PlotOrientation.HORIZONTAL) {
            ItemLabelPosition position1 = new ItemLabelPosition(
                    ItemLabelAnchor.OUTSIDE3, TextAnchor.CENTER_LEFT);
            renderer.setBasePositiveItemLabelPosition(position1);
            ItemLabelPosition position2 = new ItemLabelPosition(
                    ItemLabelAnchor.OUTSIDE9, TextAnchor.CENTER_RIGHT);
            renderer.setBaseNegativeItemLabelPosition(position2);
         }
        else if (orientation == PlotOrientation.VERTICAL) {
            ItemLabelPosition position1 = new ItemLabelPosition(
                    ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER);
            renderer.setBasePositiveItemLabelPosition(position1);
            ItemLabelPosition position2 = new ItemLabelPosition(
                    ItemLabelAnchor.OUTSIDE6, TextAnchor.TOP_CENTER);
            renderer.setBaseNegativeItemLabelPosition(position2);
        }
        if (tooltips) {
            renderer.setBaseToolTipGenerator(
View Full Code Here

Examples of org.jfree.chart.labels.ItemLabelPosition

        ValueAxis valueAxis = new NumberAxis(valueAxisLabel);

        WaterfallBarRenderer renderer = new WaterfallBarRenderer();
        if (orientation == PlotOrientation.HORIZONTAL) {
            ItemLabelPosition position = new ItemLabelPosition(
                    ItemLabelAnchor.CENTER, TextAnchor.CENTER,
                    TextAnchor.CENTER, Math.PI / 2.0);
            renderer.setBasePositiveItemLabelPosition(position);
            renderer.setBaseNegativeItemLabelPosition(position);
         }
        else if (orientation == PlotOrientation.VERTICAL) {
            ItemLabelPosition position = new ItemLabelPosition(
                    ItemLabelAnchor.CENTER, TextAnchor.CENTER,
                    TextAnchor.CENTER, 0.0);
            renderer.setBasePositiveItemLabelPosition(position);
            renderer.setBaseNegativeItemLabelPosition(position);
        }
View Full Code Here

Examples of org.jfree.chart.labels.ItemLabelPosition

            g2.setFont(labelFont);
            g2.setPaint(paint);
            String label = generator.generateLabel(dataset, series, item);

            // get the label position..
            ItemLabelPosition position = null;
            if (!negative) {
                position = getPositiveItemLabelPosition(series, item);
            }
            else {
                position = getNegativeItemLabelPosition(series, item);
            }

            // work out the label anchor point...
            Point2D anchorPoint = calculateLabelAnchorPoint(
                    position.getItemLabelAnchor(), x, y, orientation);
            TextUtilities.drawRotatedString(label, g2,
                    (float) anchorPoint.getX(), (float) anchorPoint.getY(),
                    position.getTextAnchor(), position.getAngle(),
                    position.getRotationAnchor());
        }

    }
View Full Code Here

Examples of org.jfree.chart.labels.ItemLabelPosition

            g2.setFont(labelFont);
            g2.setPaint(paint);
            String label = generator.generateLabel(dataset, series, item);

            // get the label position..
            ItemLabelPosition position = null;
            if (!negative) {
                position = getPositiveItemLabelPosition(series, item);
            }
            else {
                position = getNegativeItemLabelPosition(series, item);
            }

            // work out the label anchor point...
            Point2D anchorPoint = calculateLabelAnchorPoint(
                    position.getItemLabelAnchor(), x, y, orientation);
            TextUtilities.drawRotatedString(label, g2,
                    (float) anchorPoint.getX(), (float) anchorPoint.getY(),
                    position.getTextAnchor(), position.getAngle(),
                    position.getRotationAnchor());
        }

    }
View Full Code Here

Examples of org.jfree.chart.labels.ItemLabelPosition

    /**
     * Check that the equals() method distinguishes all fields.
     */
    public void testEquals() {
        ItemLabelPosition p1 = new ItemLabelPosition();
        ItemLabelPosition p2 = new ItemLabelPosition();
        assertEquals(p1, p2);
    }
View Full Code Here

Examples of org.jfree.chart.labels.ItemLabelPosition

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

        ItemLabelPosition p1 = new ItemLabelPosition();
        ItemLabelPosition p2 = null;

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

Examples of org.jfree.chart.labels.ItemLabelPosition

            Font labelFont = getItemLabelFont(row, column);
            Paint paint = getItemLabelPaint(row, column);
            g2.setFont(labelFont);
            g2.setPaint(paint);
            String label = generator.generateLabel(dataset, row, column);
            ItemLabelPosition position = null;
            if (!negative) {
                position = getPositiveItemLabelPosition(row, column);
            }
            else {
                position = getNegativeItemLabelPosition(row, column);
            }
            Point2D anchorPoint = calculateLabelAnchorPoint(
                    position.getItemLabelAnchor(), x, y, orientation);
            TextUtilities.drawRotatedString(label, g2,
                    (float) anchorPoint.getX(), (float) anchorPoint.getY(),
                    position.getTextAnchor(),
                    position.getAngle(), position.getRotationAnchor());
        }

    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.