예제 #1
0
        internal void RangeSelectorChanged()
        {
            if (MainChart != null)
            {
                MainChart.BeginUpdate();
                UpdateDataRange();

                IEnumerable <QuoteRange> ranges = ViewModel.ChartViewModel.Instance.GetYRange(this.LowerValue, this.UpperValue);
                if (ranges != null && ranges.Any())
                {
                    if (MainChart != null)
                    {
                        MainChart.AxisY.Min = ranges.Min(p => { return(p == null ? int.MaxValue : p.PriceMin); });
                        MainChart.AxisY.Max = ranges.Max(p => { return(p == null ? int.MinValue : p.PriceMax); });
                    }
                    var quote = ranges.First();
                    if (quote != null && VolumeSeries != null)
                    {
                        VolumeSeries.AxisY.Min = quote.VolumeMin;
                        VolumeSeries.AxisY.Max = quote.VolumeMax * 12;
                    }
                }
                MainChart.EndUpdate();

                if (this.RangeSelector != null)
                {
                    DateRangeText = Utilities.FromOADate(RangeSelector.LowerValue).ToString("MMM dd, yyyy")
                                    + " - " + Utilities.FromOADate(RangeSelector.UpperValue).ToString("MMM dd, yyyy");
                }
            }
        }
예제 #2
0
 public bool BeginUpdate()
 {
     return(MainChart.BeginUpdate());
 }