org.jCharts.chartData

## Class PieChartDataSet

- java.lang.Object
- - org.jCharts.chartData.DataSet
  - - org.jCharts.chartData.PieChartDataSet

All Implemented Interfaces:
  Serializable, IData, IDataSet, IPieChartDataSet, HTMLTestable

    public final class PieChartDataSet
    extends DataSet
    implements IPieChartDataSet

Implementation of the IPieChartDataSet Interface for use with the PieChart2D Object.

See Also:
  Serialized Form

### Field Summary

Fields
`private String` `chartTitle`

### Fields inherited from class org.jCharts.chartData.DataSet

`data, legendLabels, paints`

### Constructor Summary

Constructors
Constructor and Description
`PieChartDataSet(String chartTitle, double[] data, String[] legendLabels, Paint[] paints, PieChart2DProperties pieChart2DProperties)` Constructor

### Method Summary

Methods
`String` `getChartTitle()` Returns the chart title.
`double` `getValue(int index)` Returns the value in the data set at the specified position.
`private void` `validateData(double[] data, String[] legendLabels, Paint[] paints)` Perform some limited validation of the structure of the passed data.

### Methods inherited from class org.jCharts.chartData.DataSet

`getChartTypeProperties, getLegendLabel, getNumberOfDataItems, getNumberOfLegendLabels, getPaint, toHTML`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.jCharts.chartData.interfaces.IDataSet

`getChartTypeProperties, getLegendLabel, getNumberOfDataItems, getNumberOfLegendLabels, getPaint`

### Field Detail

#### chartTitle

    private String chartTitle

### Constructor Detail

#### PieChartDataSet

    public PieChartDataSet(String chartTitle,
                   double[] data,
                   String[] legendLabels,
                   Paint[] paints,
                   PieChart2DProperties pieChart2DProperties)
                    throws ChartDataException

Constructor

Parameters:
  `chartTitle` - if the title is NULL, no title will be drawn
  `data` -
  `legendLabels` -
  `paints` -
  `pieChart2DProperties` -
Throws:
  `ChartDataException` - if fails a limited validation check

### Method Detail

#### validateData

    private void validateData(double[] data,
                    String[] legendLabels,
                    Paint[] paints)
                       throws ChartDataException

Perform some limited validation of the structure of the passed data. This is useful for development.

Parameters:
  `data` -
  `legendLabels` -
  `paints` -
Throws:
  `ChartDataException`

#### getChartTitle

    public String getChartTitle()

Returns the chart title.

Specified by:
  `getChartTitle` in interface `IPieChartDataSet`
Returns:
  String the chart title. If this returns NULL, no title will be displayed.

#### getValue

    public double getValue(int index)
                    throws ArrayIndexOutOfBoundsException

Returns the value in the data set at the specified position.

Specified by:
  `getValue` in interface `IPieChartDataSet`
Parameters:
  `index` -
Returns:
  double
Throws:
  `ArrayIndexOutOfBoundsException`