/// <summary> /// chScatter DataBound event handler /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void chScatter_DataBound(object sender, ChartDataBoundEventArgs e) { if (DataContextSource.RatioComparisonInfo != null) { this.chaScatter.Annotations.Clear(); if (DataContextSource.RatioComparisonInfo.Count() != 0) { Decimal?financialRatioTotal = DataContextSource.RatioComparisonInfo.Sum(record => record.FINANCIAL); Decimal?financialRatioAverage = financialRatioTotal / DataContextSource.RatioComparisonInfo.Count(); Decimal?valuationRatioTotal = DataContextSource.RatioComparisonInfo.Sum(record => record.VALUATION); Decimal?valuationRatioAverage = valuationRatioTotal / DataContextSource.RatioComparisonInfo.Count(); this.chaScatter.Annotations.Add(new CustomGridLine() { XIntercept = Convert.ToDouble(valuationRatioAverage), StrokeThickness = 1 }); this.chaScatter.Annotations.Add(new CustomGridLine() { YIntercept = Convert.ToDouble(financialRatioAverage), StrokeThickness = 1 }); } } }
/// <summary> /// Checking the status of Chart, whether zoom can be executed or not /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void ChartDataBound(object sender, ChartDataBoundEventArgs e) { ((Telerik.Windows.Controls.DelegateCommand)zoomInCommand).InvalidateCanExecute(); ((Telerik.Windows.Controls.DelegateCommand)zoomOutCommand).InvalidateCanExecute(); }
/// <summary> /// Data Context Source for chart /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void ChartDataBound(object sender, ChartDataBoundEventArgs e) { ((DelegateCommand)zoomInCommand).InvalidateCanExecute(); ((DelegateCommand)zoomOutCommand).InvalidateCanExecute(); }