public PieChart(double[] svalues, string[] scaptions)
{
if (svalues.Length != scaptions.Length)
{
throw (new Exception("Length of values must be equal to the length of captions of chart."));
}
if (svalues.Length > 10)
{
throw (new Exception("Pie chart does not support items more than 10."));
}
this.length = svalues.Length;
this.values = svalues;
this.captions = scaptions;
this.CalculateAngles();
this.chartcolors = new BaseColor[length];
this.chartcolors[0] = BaseColor.RED;
if (length > 1) this.chartcolors[1] = BaseColor.GREEN;
if (length > 2) this.chartcolors[2] = BaseColor.BLUE;
if (length > 3) this.chartcolors[3] = BaseColor.BLACK;
if (length > 4) this.chartcolors[4] = BaseColor.YELLOW;
if (length > 5) this.chartcolors[5] = BaseColor.ORANGE;
if (length > 6) this.chartcolors[6] = BaseColor.CYAN;
if (length > 7) this.chartcolors[7] = BaseColor.MAGENTA;
if (length > 8) this.chartcolors[8] = BaseColor.PINK;
if (length > 9) this.chartcolors[9] = BaseColor.LIGHT_GRAY;
}