protected override void Invoke(object parameter) { if (parameter is SelectionChangedEventArgs) { ComboBox targetBox = (parameter as SelectionChangedEventArgs).OriginalSource as ComboBox; if (targetBox != null && this.Target.ColorModel != null) { switch (targetBox.Name) { case "colorPaletteBox": foreach (ChartSeries series in this.Target.Series) { series.Palette = (ChartColorPalette)Enum.Parse(typeof(ChartColorPalette), (targetBox.SelectedItem as ComboBoxItem).Content.ToString()); } break; case "comboExplodeIndex": foreach (ChartSeries series in this.Target.Series) { ChartPieType.SetExplodedIndex(series, (int)targetBox.SelectedValue); } break; case "comboExplodeRadius": foreach (ChartSeries series in this.Target.Series) { ChartPieType.SetExplodeRadius(series, Convert.ToDouble(targetBox.SelectedValue.ToString())); } break; } } } }
protected override void Invoke(object parameter) { int seriesIndex = 0; foreach (ChartSeries series in this.Target.Series) { ChartPieType.SetExplodedIndex(series, seriesIndex++); series.AdornmentsInfo.SegmentShowLine = false; series.AdornmentsInfo.HorizontalAlignment = HorizontalAlignment.Center; series.AdornmentsInfo.VerticalAlignment = VerticalAlignment.Center; series.AdornmentsInfo.LabelTemplate = Application.Current.Resources["LabelTemplate"] as DataTemplate; series.StrokeThickness = 0; } }
protected override void Invoke(object parameter) { int seriesIndex = 0; CommonResourceDictionary = new ResourceDictionary() { Source = new Uri("/syncfusion.olapchartdemos.wpf;component/Resources/olapchart/OlapChartIcon.xaml", UriKind.RelativeOrAbsolute) }; foreach (ChartSeries series in this.Target.Series) { ChartPieType.SetExplodedIndex(series, seriesIndex++); series.AdornmentsInfo.SegmentShowLine = false; series.AdornmentsInfo.HorizontalAlignment = HorizontalAlignment.Center; series.AdornmentsInfo.VerticalAlignment = VerticalAlignment.Center; series.AdornmentsInfo.LabelTemplate = CommonResourceDictionary["LabelTemplate"] as DataTemplate; series.StrokeThickness = 0; } }
protected override void Invoke(object parameter) { if (parameter is RoutedEventArgs) { CheckBox targetBox = (parameter as RoutedEventArgs).OriginalSource as CheckBox; if (targetBox != null && targetBox.IsChecked != null) { switch (targetBox.Name) { case "checkExplodeAll": foreach (ChartSeries series in this.Target.olapChart1.Series) { ChartPieType.SetExplodedAll(series, targetBox.IsChecked.Value); } if ((bool)targetBox.IsChecked) { this.Target.comboExplodeIndex.IsEnabled = false; this.Target.txtExplodeIndex.IsEnabled = false; } else { this.Target.comboExplodeIndex.IsEnabled = true; this.Target.txtExplodeIndex.IsEnabled = true; } break; case "checkEnableEffects": foreach (ChartSeries series in this.Target.olapChart1.Series) { series.EnableEffects = targetBox.IsChecked.Value; } break; } } } }
private static void SetSerieType(ChartSeries UIChartSeries, IChartSerie XlsIOChartSerie) { switch (XlsIOChartSerie.SerieType) { case ExcelChartType.Column_Clustered_3D: UIChartSeries.Type = ChartTypes.Column; break; case ExcelChartType.Column_Clustered: UIChartSeries.Type = ChartTypes.Column; break; case ExcelChartType.Column_Stacked: UIChartSeries.Type = ChartTypes.StackingColumn; break; case ExcelChartType.Column_Stacked_100: UIChartSeries.Type = ChartTypes.StackingColumn100; break; case ExcelChartType.Line: UIChartSeries.Type = ChartTypes.Line; break; case ExcelChartType.Line_Markers: UIChartSeries.Type = ChartTypes.Line; UIChartSeries.EnableEffects = true; break; case ExcelChartType.Pie: UIChartSeries.Type = ChartTypes.Pie; break; case ExcelChartType.Pie_Exploded: UIChartSeries.Type = ChartTypes.Pie; ChartPieType.SetExplodedAll(UIChartSeries, true); break; case ExcelChartType.Bar_Clustered: UIChartSeries.Type = ChartTypes.Bar; break; case ExcelChartType.Bar_Stacked: UIChartSeries.Type = ChartTypes.StackingBar; break; case ExcelChartType.Bar_Stacked_100: UIChartSeries.Type = ChartTypes.StackingBar100; break; case ExcelChartType.Area: UIChartSeries.Type = ChartTypes.Area; break; case ExcelChartType.Area_Stacked: UIChartSeries.Type = ChartTypes.StackingArea; break; case ExcelChartType.Scatter_Line: case ExcelChartType.Scatter_Markers: case ExcelChartType.Scatter_Line_Markers: case ExcelChartType.Scatter_SmoothedLine: case ExcelChartType.Scatter_SmoothedLine_Markers: UIChartSeries.Type = ChartTypes.Scatter; break; case ExcelChartType.Stock_HighLowClose: UIChartSeries.Type = ChartTypes.HiLo; //4 break; case ExcelChartType.Stock_OpenHighLowClose: UIChartSeries.Type = ChartTypes.HiLoOpenClose; //4 break; case ExcelChartType.Stock_VolumeHighLowClose: UIChartSeries.Type = ChartTypes.Candle; //4 break; case ExcelChartType.Doughnut: UIChartSeries.Type = ChartTypes.Doughnut; break; case ExcelChartType.Doughnut_Exploded: UIChartSeries.Type = ChartTypes.Doughnut; ChartPieType.SetExplodedAll(UIChartSeries, true); break; case ExcelChartType.Bubble: UIChartSeries.Type = ChartTypes.Bubble; //2 break; case ExcelChartType.Radar: UIChartSeries.Type = ChartTypes.Radar; break; case ExcelChartType.Pie_3D: UIChartSeries.Type = ChartTypes.Pie; break; default: return; } }