public CreateAPieChart() { InitializeComponent(); var sceneEntity = PieSeries3D.GetSceneEntity() as SciChart.Charting3D.RenderableSeries.PieMeshSceneEntity; // Pie PieSection pieSection = new PieSection(); pieSection.fInnerRadius = 40.0f; pieSection.fOuterRadius = 160.0f; pieSection.fPercentage = 0.2f; pieSection.fStartAngle = 0.0f; pieSection.fThickness = 30.0f; pieSection.color = System.Windows.Media.Color.FromArgb(255, 0, 0, 255); sceneEntity.AddSection(pieSection); pieSection.fInnerRadius = 40.0f; pieSection.fOuterRadius = 140.0f; pieSection.fPercentage = 0.2f; pieSection.fStartAngle = 0.2f * ( float )Math.PI * 2.0f; pieSection.fThickness = 40.0f; pieSection.color = System.Windows.Media.Color.FromArgb(255, 0, 255, 0); sceneEntity.AddSection(pieSection); pieSection.fInnerRadius = 60.0f; pieSection.fOuterRadius = 120.0f; pieSection.fPercentage = 0.2f; pieSection.fStartAngle = 0.4f * (float)Math.PI * 2.0f; pieSection.fThickness = 50.0f; pieSection.color = System.Windows.Media.Color.FromArgb(255, 255, 0, 0); sceneEntity.AddSection(pieSection); pieSection.fInnerRadius = 60.0f; pieSection.fOuterRadius = 120.0f; pieSection.fPercentage = 0.2f; pieSection.fStartAngle = 0.6f * (float)Math.PI * 2.0f; pieSection.fThickness = 50.0f; pieSection.color = System.Windows.Media.Color.FromArgb(255, 255, 255, 255); sceneEntity.AddSection(pieSection); pieSection.fInnerRadius = 60.0f; pieSection.fOuterRadius = 120.0f; pieSection.fPercentage = 0.2f; pieSection.fStartAngle = 0.8f * (float)Math.PI * 2.0f; pieSection.fThickness = 50.0f; pieSection.color = System.Windows.Media.Color.FromArgb(255, 0, 0, 0); sceneEntity.AddSection(pieSection); diffuseColorComboBox.ItemsSource = typeof(Colors).GetProperties().Select(x => new ColorModel { ColorName = x.Name, Color = (Color)x.GetValue(null, null) }).ToList(); specularColorComboBox.ItemsSource = typeof(Colors).GetProperties().Select(x => new ColorModel { ColorName = x.Name, Color = (Color)x.GetValue(null, null) }).ToList(); }
private void BindingChartRejectRslt(DataTable _dtChartData) { try { if (this.pieDiagramRsltMain.Series.Count > 0) { this.pieDiagramRsltMain.Series.Clear(); } this.chartErrPrctPie.BeginInit(); // 차트 색 지정 (색상 수 : 7개) CustomPalette customPalette = new CustomPalette(); customPalette.Colors.Add(Colors.LightBlue); customPalette.Colors.Add(Colors.IndianRed); customPalette.Colors.Add(Colors.SteelBlue); customPalette.Colors.Add(Colors.Orange); customPalette.Colors.Add(Colors.OliveDrab); customPalette.Colors.Add(Colors.PapayaWhip); customPalette.Colors.Add(Colors.LightCoral); chartErrPrctPie.Palette = customPalette; this.g_Is3D = new PieSeries3D(); this.g_Is3D.ArgumentScaleType = ScaleType.Auto; this.g_Is3D.DataSourceSorted = false; this.g_Is3D.ArgumentDataMember = "Argument_str"; this.g_Is3D.ValueDataMember = "Value"; List <ChartDataPointMember> pies = this.GetGenerateDataCell(_dtChartData); this.g_Is3D.DataSource = pies; this.g_Is3D.LegendTextPattern = "{S} : {A:0}"; if (this.pieDiagramRsltMain.Series.Count > 0) { this.pieDiagramRsltMain.Series.Clear(); } this.pieDiagramRsltMain.Series.Add(this.g_Is3D); // 파이차트 마우스 회전 X this.pieDiagramRsltMain.RuntimeRotation = false; // 파이차트 Label this.g_Is3D.LabelsVisibility = true; this.g_Is3D.Label = new SeriesLabel(); this.g_Is3D.Label.TextPattern = "{A}: {VP:P0}"; PieSeries3D.SetLabelPosition(this.g_Is3D.Label, PieLabelPosition.TwoColumns); } catch { throw; } finally { this.chartErrPrctPie.EndInit(); this.g_Is3D = null; } }
void lbModel_SelectedIndexChanged(object sender, RoutedEventArgs e) { Pie3DKind modelKind = lbModel.SelectedItem as Pie3DKind; if (modelKind != null) { Type type = modelKind.Type; Pie3DModelKindHelper.SetModel(chart, (Pie3DModel)Activator.CreateInstance(type)); PieSeries3D series = (PieSeries3D)chart.Diagram.Series[0]; series.HoleRadiusPercent = type.Name.StartsWith("Semi") ? 0 : 50; series.DepthTransform = type.Name.StartsWith("Semi") ? 0.5 : 1; } }