protected override void CreateEmptyOption() { if (emptyOption != null) { return; } emptyOption = new UIOption(); emptyOption.Title = new UITitle(); emptyOption.Title.Text = "SunnyUI"; emptyOption.Title.SubText = "PieChart"; var series = new UISeries(); series.Name = "饼状图"; series.Type = UISeriesType.Pie; series.Center = new UICenter(50, 55); series.Radius = 70; for (int i = 0; i < 5; i++) { series.AddData("Data" + i, (i + 1) * 20); } emptyOption.Series.Add(series); }
private RectangleF GetSeriesRect(UISeries series) { int left = series.Center.Left; int top = series.Center.Top; left = Width * left / 100; top = Height * top / 100; float halfRadius = Math.Min(Width, Height) * series.Radius / 200.0f; return(new RectangleF(left - halfRadius, top - halfRadius, halfRadius * 2, halfRadius * 2)); }
public void AddSeries(UISeries series) { Series.Add(series); }