コード例 #1
0
        private void ExitValuesToPlot(int index)
        {
            _chartExit.Add(new DateModel());
            var length = _chartExit.Count();

            _chartExit[length - 1].DateTime = TimeTranslation2(_dataList[index].Date);
            _chartExit[length - 1].Value    = _dataList[index].Close;
        }
コード例 #2
0
        private void BuildHistogram()
        {
            var max     = Math.Ceiling(ChartValues.Max(p => p.TotDouble));
            var min     = Math.Floor(ChartValues.Min(p => p.TotDouble));
            var binSize = max / 100;

            var histValues = new Dictionary <string, int>();

            for (var i = min; i < max; i += binSize)
            {
                histValues.Add(i + " - " + (i + binSize), ChartValues.Count(v => v.TotDouble > i && v.TotDouble <= i + binSize));
            }

            sizeChart.Series.Clear();
            sizeChart.AxisY.Clear();
            sizeChart.Series = new SeriesCollection
            {
                new RowSeries
                {
                    Values = new ChartValues <int>(histValues.Values)
                }
            };
            sizeChart.AxisY.Add(new Axis
            {
                Labels = histValues.Keys.ToList()
            });
        }
コード例 #3
0
        private void SetGraph()
        {
            ReadTestData();
            ReadGradingSystemData();
            SeriesCollection.Clear();

            LineSeriesCollection.Clear();
            DateTimes.Clear();

            if (SelectedSubject == null)
            {
                return;
            }
            if (SelectedTestType == null)
            {
                return;
            }
            if (SelectedGradingPeriod == null)
            {
                return;
            }


            //var selectedSubject = AssociatedPerson.Subjects.Where(x => x.Name == SelectedSubject.Name);
            LineSeries           dummyLineSeries = new LineSeries();
            ChartValues <double> chartValues     = new ChartValues <double>();

            foreach (var test in SelectedSubject.Tests.Where(x => x.TestType.Name == SelectedTestType.Name && x.GradingPeriod.Name == SelectedGradingPeriod.Name))
            {
                chartValues.Add(test.Percentage);
                DateTimes.Add(test.TestDate.ToString(CultureInfo.InvariantCulture));
                if (chartValues.Count() > 4)
                {
                    GraphWidth = chartValues.Count() * 150;
                }
            }

            dummyLineSeries.Values = chartValues;
            //dummyLineSeries.LineSmoothness = 0;

            LineSeriesCollection.Add(dummyLineSeries);

            foreach (var s in LineSeriesCollection)
            {
                SeriesCollection.Add(s);
            }
        }
コード例 #4
0
 private void ResetZoomOnClick(object sender, RoutedEventArgs e)
 {
     if (_values.Count() > 0)
     {
         From = _values.First().StartPoint;
         To   = _values.Last().EndPoint;
     }
 }