private void ChangeToDoughnut() { if (ChartType != PieChartType.Doughnut) { ChartType = PieChartType.Doughnut; } }
private void ChangeToPie() { if (ChartType != PieChartType.Pie) { ChartType = PieChartType.Pie; } }
/// <summary> /// Create a pie chart of specified type /// </summary> /// <param name="width">width in pixels</param> /// <param name="height">height in pixels</param> /// <param name="pieChartType"></param> public PieChart(int width, int height, PieChartType pieChartType) : base(width, height) { this.pieChartType = pieChartType; }
/// <summary> /// Initializes a new instance of the Pie Chart generator. /// </summary> /// <param name="type">Pie chart type.</param> /// <param name="size">Size of the chart.</param> /// <param name="data">Chart data.</param> /// <param name="labels">Labels for pies</param> public PieChart(PieChartType type, ChartSize size, ChartData data, PieChartLabels labels) : this(type, size, data) { _labels = labels; }
/// <summary> /// Initializes a new instance of the Pie Chart generator. /// </summary> /// <param name="type">Pie chart type.</param> /// <param name="size">Size of the chart.</param> /// <param name="data">Chart data.</param> public PieChart(PieChartType type, ChartSize size, ChartData data) : base(GetPieType(type), size, data) { }
private static ChartType GetPieType(PieChartType type) { switch(type) { case PieChartType.Pie2D: return PieChart2D; case PieChartType.Pie3D: return PieChart3D; default: throw new ArgumentOutOfRangeException("type"); } }
public PieChartBuilder Type(PieChartType value) { base.Options["type"] = value; return(this); }
/// <summary> /// 创建一个指定类型的饼图 /// </summary> /// <param name="width">width in pixels</param> /// <param name="height">height in pixels</param> /// <param name="pieChartType"></param> public PieChart(int width, int heigth, PieChartType pieChartType) : base(width, heigth) { this.pieChartType = pieChartType; }