com.java4less.rchart
Class PieDataSerie

java.lang.Object
  |
  +--com.java4less.rchart.DataSerie
        |
        +--com.java4less.rchart.PieDataSerie
Direct Known Subclasses:
GaugeDataSerie

public class PieDataSerie
extends DataSerie


The PieDataSerie is actually not a serie of value but a set of values to be plotted as a pie chart.

Example:

// data
double[] d1={64,95,11,70};
// style of the pie
FillStyle[] s1={new FillStyle(java.awt.Color.cyan),new FillStyle(java.awt.Color.blue),new FillStyle(java.awt.Color.green),new FillStyle(java.awt.Color.yellow)};
PieDataSerie data1= new PieDataSerie(d1,s1);


Field Summary
 boolean drawPercentages
          if true the percenteges will be displayed instead of the actual values.
 double textDistanceToCenter
          distance of the text to the center of the pie.
 java.awt.Color valueColor
          color of the font used to display the values/percentages.
 java.awt.Font valueFont
          font used to display the values/percentages.
 
Fields inherited from class com.java4less.rchart.DataSerie
dataLabels, hotAreas, name, nullValue, secondYAxis, valueFormat
 
Constructor Summary
PieDataSerie()
           
PieDataSerie(double[] y, FillStyle[] s)
          creates a PieDataSerie to display a list of values on a pie chart.
PieDataSerie(double[] y, FillStyle[] s, boolean[] keepTogether, java.lang.String[] labels)
          creates a PieDataSerie to display a list of values on a pie chart.
 
Method Summary
 void addPieData(double y, FillStyle s)
          Adds a new value to the set.
 void addPieData(double y, FillStyle s, boolean keepTogether, java.lang.String label)
          Adds a new value to the set.
 
Methods inherited from class com.java4less.rchart.DataSerie
addData, doubleToString, getElementX, getElementY, getSize, setDatax
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

valueColor

public java.awt.Color valueColor
color of the font used to display the values/percentages.

valueFont

public java.awt.Font valueFont
font used to display the values/percentages.

textDistanceToCenter

public double textDistanceToCenter
distance of the text to the center of the pie. The default value is 1 (outside the pie). A value of 0.5 means half of the radius of the pie.

drawPercentages

public boolean drawPercentages
if true the percenteges will be displayed instead of the actual values.
Constructor Detail

PieDataSerie

public PieDataSerie()

PieDataSerie

public PieDataSerie(double[] y,
                    FillStyle[] s,
                    boolean[] keepTogether,
                    java.lang.String[] labels)
creates a PieDataSerie to display a list of values on a pie chart. Each element must have also a styled. KeepTogether is an array of booleans that indicate which items must be displayed separated from the others.

PieDataSerie

public PieDataSerie(double[] y,
                    FillStyle[] s)
creates a PieDataSerie to display a list of values on a pie chart. Each element must have also a styled.
Method Detail

addPieData

public void addPieData(double y,
                       FillStyle s)
Adds a new value to the set.

addPieData

public void addPieData(double y,
                       FillStyle s,
                       boolean keepTogether,
                       java.lang.String label)
Adds a new value to the set.