Documentation of 'de.erichseifert.gral.plots.PiePlot' Java class
PiePlot
de.erichseifert.gral.plots

Class PiePlot

  • All Implemented Interfaces:
    DataListener, Container, Drawable, Navigable, Plot, java.io.Serializable, java.lang.Iterable<Drawable>


    public class PiePlot
    extends AbstractPlot
    implements Navigable

    Class that displays data as segments of a pie plot. Empty segments are displayed for negative values.

    To create a new PiePlot simply create a new instance using a data source. Example:

     DataTable data = new DataTable(Integer.class, Double.class);
     data.add(-23.50);
     data.add(100.00);
     data.add( 60.25);
    
     PiePlot plot = new PiePlot(data);
     
    See Also:
    Serialized Form
    • Field Detail

      • AXIS_TANGENTIAL

        public static final java.lang.String AXIS_TANGENTIAL
        Key for specifying the tangential axis of a pie plot.
        See Also:
        Constant Field Values
    • Constructor Detail

      • PiePlot

        public PiePlot(DataSource data)
        Initializes a new pie plot with the specified data source.
        Parameters:
        data - Data to be displayed.
    • Method Detail

      • autoscaleAxis

        public void autoscaleAxis(java.lang.String axisName)
        Description copied from class: AbstractPlot
        Tries to automatically set the ranges of the axes specified by the name if it is set to auto-scale.
        Specified by:
        autoscaleAxis in interface Plot
        Overrides:
        autoscaleAxis in class AbstractPlot
        Parameters:
        axisName - Name of the axis that should be scaled.
        See Also:
        Axis.setAutoscaled(boolean)
      • add

        public void add(int index,
                        DataSource source,
                        boolean visible)
        Description copied from class: AbstractPlot
        Inserts the specified data series to the plot at a specified position.
        Specified by:
        add in interface Plot
        Overrides:
        add in class AbstractPlot
        Parameters:
        index - Position.
        source - Data series.
        visible - true if the series should be displayed, false otherwise.
      • getPointRenderer

        public PointRenderer getPointRenderer(DataSource s)
        Returns the PointRenderer for the specified data source.
        Parameters:
        s - Data source.
        Returns:
        PointRenderer.
      • setPointRenderer

        public void setPointRenderer(DataSource s,
                                     PointRenderer pointRenderer)
        Sets the PointRenderer for a certain data source to the specified value.
        Parameters:
        s - Data source.
        pointRenderer - PointRenderer to be set.
      • getNavigator

        public Navigator getNavigator()
        Returns a navigator instance that can control the current object.
        Specified by:
        getNavigator in interface Navigable
        Returns:
        A navigator instance.
      • getCenter

        public java.awt.geom.Point2D getCenter()
        Returns a point which defines the center of the pie. The coordinates are relative to the plot area dimensions, i.e. 0.0 means left/top, 0.5 means the center, and 1.0 means right/bottom.
        Returns:
        Point which defines the center of the pie.
      • setCenter

        public void setCenter(java.awt.geom.Point2D center)
        Sets the center of the pie. The coordinates must be relative to the plot area dimensions, i.e. 0.0 means left/top, 0.5 means the center, and 1.0 means right/bottom.
        Parameters:
        center - Point which defines the center of the pie.
      • getRadius

        public double getRadius()
        Returns the radius of the pie relative to the plot area size.
        Returns:
        Radius of the pie relative to the plot area size.
      • setRadius

        public void setRadius(double radius)
        Sets the radius of the pie relative to the plot area size.
        Parameters:
        radius - Radius of the pie relative to the plot area size.
      • getStart

        public double getStart()
        Returns the starting angle of the first segment. The angle is counterclockwise.
        Returns:
        Starting angle of the first segment in degrees.
      • setStart

        public void setStart(double start)
        Sets the starting angle of the first segment. The angle is always applied counterclockwise.
        Parameters:
        start - Starting angle of the first segment in degrees.
      • isClockwise

        public boolean isClockwise()
        Returns whether the segments are in clockwise or counterclockwise order.
        Returns:
        true if segments are in clockwise order, otherwise false.
      • setClockwise

        public void setClockwise(boolean clockwise)
        Sets whether the segments will be in clockwise or counterclockwise order.
        Parameters:
        clockwise - true if segments should be in clockwise order, otherwise false.

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.