コード例 #1
0
        private void ApplyData(EventDataItem eventData, SeasonalityChartAndGrid chart, Label eventLabel, UltraTextEditor ssInto, UltraTextEditor ssOut, UltraTextEditor rssInto, UltraTextEditor rssOut, SeasonalityChartAndGrid chartAndGridOverlay)
        {            
            //var con = Helper.TransformToCon(dataAroundEvents, 15, DataAroundEventField.Filled_Diff);
            var conAndShift = Helper.TransformToCompoChartDataAndShift(eventData.DataAroundEvents, 15, DataAroundEventField.RawDataAroundEvent_Diffs);
            var conForProbability = Helper.TransformToCompoChartDataAndShift(eventData.DataAroundEvents, 15, DataAroundEventField.RawDataAroundEvent_Diffs);
            
            var con = conAndShift.Item1;
            var shift = conAndShift.Item2;
            var closestEvent = conAndShift.Item3;
            con.Name = eventData.EventCode;
            var avgsAndProb = ViewModel.ComputeAvgsAndProb(con, conForProbability, shift);
            var avgs = avgsAndProb.Item1;
            var Probs = avgsAndProb.Item2;

            chart.Chart.VerticalLineShift = shift+1;
            chart.ApplyData(eventData.EventCode + "\n" + closestEvent.ToString("yyyy-MMM-dd"), con.ColumnHeadings, avgs);
            SetYAxix(chart);
            chart.Chart.AddLegend();
            eventLabel.Text = eventData.EventCode;

            chartAndGridOverlay.ApplyData(eventData.EventCode + "\n" + closestEvent.ToString("yyyy-MMM-dd"), con.ColumnHeadings, avgs);
            chartAndGridOverlay.Chart.VerticalLineShift = shift + 1;

            // probability
            chart.Chart.AddColumnChart(eventData.EventCode + " prob", conForProbability.Item1.ColumnHeadings, Probs, ProbabilityCalc.GetMaxValue(ViewModel.ProbCalcMethod));

            // apply stats
            ssInto.Text = ViewModel.ComputeSSInto(con, shift).ToString();
            ssOut.Text = ViewModel.ComputeSSOut(con, shift).ToString();
            rssInto.Text = ViewModel.ComputeRSSInto(con, shift).ToString();
            rssOut.Text = ViewModel.ComputeRSSOut(con, shift).ToString();
        }
コード例 #2
0
        public void ApplyData(EventDataItem[] eventDataItems)
        {
            ClearAllCharts();

            int i = 0;
            foreach (var eventDataItem in eventDataItems)
            {
                ApplyData(eventDataItem, GetRelevantChart(i), eventLabels.ElementAt(i),
                                                    ssIntoFields.ElementAt(i),
                                                    ssOutFields.ElementAt(i),
                                                    rssIntoFields.ElementAt(i),
                                                    rssOutFields.ElementAt(i),
                                                    seasonalityChartAndGridOverlay);
                i++;
            }

            // display composite chart
            seasonalityChartAndGrid1.ClearData();
            var xaxis = new string[16];
            var xaxisLine = new double[16];
            for (int indx = 0; indx < xaxis.Length; indx++)
            {
                xaxisLine[indx] = 0;
                xaxis[indx] = indx.ToString();
            }
            var compoSeries = ViewModel.ComputeComposite();
            seasonalityChartAndGrid1.ApplyData("HorizontalLine", xaxis, xaxisLine);
            seasonalityChartAndGrid1.ApplyData("Composite", xaxis, compoSeries);

            // overlay chart            
            SetYAxix(seasonalityChartAndGridOverlay);
            seasonalityChartAndGridOverlay.Chart.AddLegend();
        }