Ejemplo n.º 1
0
        public void ShouldShowChart()
        {            
            var chartgrid = new SeasonalityChartAndGrid();
            chartgrid.Create();

            var x = new[] {"-5", "-4", "-3", "-2", "-1", "0", "1", "2", "3", "4", "5"};
            var y = new[] {10.2, 12.3, 33.0, 24, 65, 36, 17, 28, 19, 25, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20};
            chartgrid.ApplyData("test data", x, y);
            //var x2 = new[] {"5", "6", "7", "8", "9", "10","11","18","32","33" };
            var y2 = new[] { 28, 19, 25.3, 11.2, 12, 13, 14, 15, 8, 19,11 };

            LookFeel.SetupBenNew();
            //LookFeel.ProcessChart(chartgrid.Chart);
            chartgrid.ApplyData("test data2", x, y2);
            chartgrid.SetupForDataType(DataAroundEventField.Filled_Level);
            

            var form = chartgrid.DisplayInShowForm("Seasonality Test");
            form.BackColor = Color.LightSlateGray;
            LookFeel.ProcessControl(form);
            
            Application.Run(form);
        }
Ejemplo n.º 2
0
        private void SetYAxix(SeasonalityChartAndGrid chart)
        {
            var chartsMinMax = new List<double[]>();
            var chartLimits = chart.Chart.FindLineChartMinMax();
            chartsMinMax.Add(chartLimits);
          
            chartLimits[1] = Math.Max(Math.Abs(chartLimits[0]), Math.Abs(chartLimits[1]));
            chartLimits[0] = -chartLimits[1];

            chart.Chart.SetYAxisLimits(                  
                  Infragistics.UltraChart.Shared.Styles.AxisRangeType.Custom,
                  chartLimits[1],
                  chartLimits[0]);
        }
Ejemplo n.º 3
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();
        }