public static void DispatchRunAnimations(RadChartBase chart) { IEnumerable<ChartSeries> series = null; RadCartesianChart cartesianChart = chart as RadCartesianChart; if (cartesianChart != null) { series = cartesianChart.Series; } RadPieChart pieChart = chart as RadPieChart; if (pieChart != null) { series = pieChart.Series; } if (series.Any(s => (int)s.GetValue(ChartAnimationUtilities.RunningAnimationsCountProperty) > 0)) { return; } foreach (ChartSeries s in series) { DispatchRunSeriesAnimations(s); } }
public static void DispatchRunAnimations(RadChartBase chart) { IEnumerable <ChartSeries> series = null; RadCartesianChart cartesianChart = chart as RadCartesianChart; if (cartesianChart != null) { series = cartesianChart.Series; } RadPieChart pieChart = chart as RadPieChart; if (pieChart != null) { series = pieChart.Series; } if (series.Any(s => (int)s.GetValue(ChartAnimationUtilities.RunningAnimationsCountProperty) > 0)) { return; } foreach (ChartSeries s in series) { DispatchRunSeriesAnimations(s); } }
private static void UpdateChartHorizontalPanOffsetAndZoom(RadChartBase chart) { if (ChartViewUtilities.GetIsHorizontalRangeEnabled(chart) && !suspendedCharts.Contains(chart)) { suspendedCharts.Add(chart); if (chart.PlotAreaClip.Width > 0) { double horizontalStart = ChartViewUtilities.GetHorizontalStart(chart); double horizontalEnd = ChartViewUtilities.GetHorizontalEnd(chart); double horizontalRange = horizontalEnd - horizontalStart; if (horizontalRange > 0 && horizontalRange <= 1) { double newZoomX = 1 / horizontalRange; double virtualWidth = newZoomX * chart.PlotAreaClip.Width; double panOffsetX = -horizontalStart * virtualWidth; chart.Zoom = new Size(newZoomX, chart.Zoom.Height); chart.PanOffset = new Point(panOffsetX, chart.PanOffset.Y); } } suspendedCharts.Remove(chart); } }
public static void ExportToBMP(String nom, RadChartBase chart) { String origin = @"\\mede1\partage\,FGA Front Office\02_Gestion_Actions\00_BASE\04_TEMP\"; String pathTmpFolder = origin + nom + ".bmp"; Telerik.Windows.Media.Imaging.ExportExtensions.ExportToImage(chart, pathTmpFolder, new PngBitmapEncoder()); System.Diagnostics.Process.Start("mspaint", "\"" + pathTmpFolder + "\""); }
private static IEnumerable GetSeries(RadChartBase chartView) { var cartesianChart = chartView as RadCartesianChart; if (cartesianChart != null) { return(cartesianChart.Series); } var pieChart = chartView as RadPieChart; if (pieChart != null) { return(pieChart.Series); } var polarChart = (RadPolarChart)chartView; return(polarChart.Series); }
private static void UpdateHorizontalRangeValues(RadChartBase chart) { if (ChartViewUtilities.GetIsHorizontalRangeEnabled(chart) && !suspendedCharts.Contains(chart)) { suspendedCharts.Add(chart); var virtualWidth = chart.PlotAreaClip.Width * chart.Zoom.Width; if (virtualWidth > 0) { double oldHorizontalStart = ChartViewUtilities.GetHorizontalStart(chart); double oldHorizontalEnd = ChartViewUtilities.GetHorizontalEnd(chart); double newHorizontalStart = (-chart.PanOffset.X) / virtualWidth; double newHorizontalEnd = ((-chart.PanOffset.X) + chart.PlotAreaClip.Width) / virtualWidth; ChartViewUtilities.SetHorizontalStart(chart, newHorizontalStart); ChartViewUtilities.SetHorizontalEnd(chart, newHorizontalEnd); } suspendedCharts.Remove(chart); } }
private void AdjustLabelsAndTicks(RadChartBase chart, ChartBase dataContext) { if (_axis == null) _axis = chart.Find(x => x.Name == "horizontalLinearAxis") as LinearAxis; if (_axis != null) { var labelInterval = CalculateLabelInterval(dataContext); _axis.LabelInterval = labelInterval; if (_tickParent == null) { var ticks = chart.FindAll(x => x.Tag != null && x.Tag.ToString() == "Tick"); if (ticks != null && ticks.Any()) _tickParent = ticks[0].Parent as Canvas; } if (_tickParent != null) { var ticks = _tickParent.Children.Where(x => x is Rectangle && ((Rectangle)x).Tag.Equals("Tick")); var cn = 0; foreach (FrameworkElement element in ticks) { var styleModified = element.Style.Clone(); if (cn % labelInterval == 0) { styleModified.Setters.Add(new Setter(Rectangle.FillProperty, new SolidColorBrush(Color.FromArgb(0xFF, 0x33, 0x33, 0x33)))); styleModified.Setters.RemoveAt(1); } else { styleModified.Setters.Add(new Setter(Rectangle.FillProperty, new SolidColorBrush(Colors.Transparent))); styleModified.Setters.RemoveAt(1); } element.Style = styleModified; cn++; } _oldNumberOfTicks = ticks.Count(); } } }
private static IEnumerable GetSeries(RadChartBase chartView) { var cartesianChart = chartView as RadCartesianChart; if (cartesianChart != null) { return cartesianChart.Series; } var pieChart = chartView as RadPieChart; if (pieChart != null) { return pieChart.Series; } var polarChart = (RadPolarChart)chartView; return polarChart.Series; }
/// <summary> /// Initializes a new instance of the RadChartBaseAutomationPeer class. /// </summary> public RadChartBaseAutomationPeer(RadChartBase owner) : base(owner) { }
private static void UpdateHorizontalRangeValues(RadChartBase chart) { if (ChartViewUtilities.GetIsHorizontalRangeEnabled(chart) && !suspendedCharts.Contains(chart)) { suspendedCharts.Add(chart); var virtualWidth = chart.PlotAreaClip.Width * chart.Zoom.Width; if (virtualWidth > 0) { double oldHorizontalStart = ChartViewUtilities.GetHorizontalStart(chart); double oldHorizontalEnd = ChartViewUtilities.GetHorizontalEnd(chart); double newHorizontalStart = (-chart.PanOffset.X) / virtualWidth; double newHorizontalEnd = ((-chart.PanOffset.X) + chart.PlotAreaClip.Width) / virtualWidth; ChartViewUtilities.SetHorizontalStart(chart, newHorizontalStart); ChartViewUtilities.SetHorizontalEnd(chart, newHorizontalEnd); } suspendedCharts.Remove(chart); } }
private static void UpdateChartHorizontalPanOffsetAndZoom(RadChartBase chart) { if (ChartViewUtilities.GetIsHorizontalRangeEnabled(chart) && !suspendedCharts.Contains(chart)) { suspendedCharts.Add(chart); if (chart.PlotAreaClip.Width > 0) { double horizontalStart = ChartViewUtilities.GetHorizontalStart(chart); double horizontalEnd = ChartViewUtilities.GetHorizontalEnd(chart); double horizontalRange = horizontalEnd - horizontalStart; if (horizontalRange > 0 && horizontalRange <= 1) { double newZoomX = 1 / horizontalRange; double virtualWidth = newZoomX * chart.PlotAreaClip.Width; double panOffsetX = -horizontalStart * virtualWidth; chart.Zoom = new Size(newZoomX, chart.Zoom.Height); chart.PanOffset = new Point(panOffsetX, chart.PanOffset.Y); } } suspendedCharts.Remove(chart); } }