Пример #1
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
 {
     switch (connectionId)
     {
     case 1:
         this.series = ((Telerik.Windows.Controls.ChartView.LineSeries)(target));
         return;
     }
     this._contentLoaded = true;
 }
Пример #2
0
        private void MainWindow_OnLoaded(object sender, RoutedEventArgs e)
        {
            Items = Entities.Items.ToList();

            foreach (Item item in Items)
            {
                ComboBoxItemName.Items.Add(item.ItemName);
            }

            Timer1.Interval  = new TimeSpan(0, 0, 0, 60);
            Timer1.IsEnabled = true;
            Timer1.Tick     += Timer1_Tick;

            LiveChart.Series.Add(new LineSeries());
            LineSeries series1 = (LineSeries)this.LiveChart.Series[0];

            series1.CategoryBinding = new PropertyNameDataPointBinding()
            {
                PropertyName = "Date"
            };
            series1.ValueBinding = new PropertyNameDataPointBinding()
            {
                PropertyName = "ItemValue"
            };
            series1.Stroke          = Brushes.Blue;
            series1.StrokeThickness = 2;

            LiveChart.Series.Add(new LineSeries());
            LineSeries series2 = (LineSeries)this.LiveChart.Series[1];

            series2.CategoryBinding = new PropertyNameDataPointBinding()
            {
                PropertyName = "Date"
            };
            series2.ValueBinding = new PropertyNameDataPointBinding()
            {
                PropertyName = "ItemValue"
            };
            series2.Stroke          = Brushes.LimeGreen;
            series2.StrokeThickness = 2;

            LiveChart.Series.Add(new LineSeries());
            LineSeries series3 = (LineSeries)this.LiveChart.Series[2];

            series3.CategoryBinding = new PropertyNameDataPointBinding()
            {
                PropertyName = "Date"
            };
            series3.ValueBinding = new PropertyNameDataPointBinding()
            {
                PropertyName = "ItemValue"
            };
            series3.Stroke          = Brushes.OrangeRed;
            series3.StrokeThickness = 2;

            series1.ItemsSource = item1Live;
            series2.ItemsSource = item2Live;
            series3.ItemsSource = item3Live;

            LiveChartLegend.Items.Add(new LegendItem()
            {
                MarkerFill = Brushes.Blue, Title = Items[0].ItemName
            });
            LiveChartLegend.Items.Add(new LegendItem()
            {
                MarkerFill = Brushes.LimeGreen, Title = Items[1].ItemName
            });
            LiveChartLegend.Items.Add(new LegendItem()
            {
                MarkerFill = Brushes.OrangeRed, Title = Items[2].ItemName
            });
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.CBPays1 = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 2:
                this.CBMaturity = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 3:
                this.CBPays2 = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 4:
                this.CBMaturity2 = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 5:

            #line 55 "..\..\..\..\..\TauxCredit\BaseInterpolation\View\BaseInterpolation.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Interpolation_Click);

            #line default
            #line hidden
                return;

            case 6:

            #line 80 "..\..\..\..\..\TauxCredit\BaseInterpolation\View\BaseInterpolation.xaml"
                ((Telerik.Windows.Controls.RadGridView)(target)).AutoGeneratingColumn += new System.EventHandler <Telerik.Windows.Controls.GridViewAutoGeneratingColumnEventArgs>(this.RadGridView_AutoGeneratingColumn);

            #line default
            #line hidden
                return;

            case 7:

            #line 96 "..\..\..\..\..\TauxCredit\BaseInterpolation\View\BaseInterpolation.xaml"
                ((Telerik.Windows.Controls.RadGridView)(target)).AutoGeneratingColumn += new System.EventHandler <Telerik.Windows.Controls.GridViewAutoGeneratingColumnEventArgs>(this.RadGridView_AutoGeneratingColumn);

            #line default
            #line hidden
                return;

            case 8:
                this.telerik = ((Telerik.Windows.Controls.RadCartesianChart)(target));
                return;

            case 9:
                this.LineChart1 = ((Telerik.Windows.Controls.ChartView.LineSeries)(target));
                return;

            case 10:
                this.LineChart2 = ((Telerik.Windows.Controls.ChartView.LineSeries)(target));
                return;

            case 11:
                this.Spread = ((Telerik.Windows.Controls.RadCartesianChart)(target));
                return;

            case 12:
                this.LineChart3 = ((Telerik.Windows.Controls.ChartView.LineSeries)(target));
                return;

            case 13:
                this.ZeroLine = ((Telerik.Windows.Controls.ChartView.LineSeries)(target));
                return;
            }
            this._contentLoaded = true;
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.Date_F = ((System.Windows.Controls.Label)(target));
                return;

            case 2:
                this.RadGrid = ((Telerik.Windows.Controls.RadGridView)(target));

            #line 47 "..\..\..\..\..\TauxCredit\Indicateurs\View\IndicateurView.xaml"
                this.RadGrid.AutoGeneratingColumn += new System.EventHandler <Telerik.Windows.Controls.GridViewAutoGeneratingColumnEventArgs>(this.RadGridView_AutoGeneratingColumn);

            #line default
            #line hidden
                return;

            case 3:

            #line 52 "..\..\..\..\..\TauxCredit\Indicateurs\View\IndicateurView.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Indicateur_Click);

            #line default
            #line hidden
                return;

            case 4:

            #line 63 "..\..\..\..\..\TauxCredit\Indicateurs\View\IndicateurView.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btnExport_Click);

            #line default
            #line hidden
                return;

            case 5:

            #line 114 "..\..\..\..\..\TauxCredit\Indicateurs\View\IndicateurView.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Graph_Click);

            #line default
            #line hidden
                return;

            case 6:
                this.telerik = ((Telerik.Windows.Controls.RadCartesianChart)(target));
                return;

            case 7:
                this.LineChart1 = ((Telerik.Windows.Controls.ChartView.LineSeries)(target));
                return;

            case 8:
                this.LineChart2 = ((Telerik.Windows.Controls.ChartView.LineSeries)(target));
                return;

            case 9:
                this.LineChart3 = ((Telerik.Windows.Controls.ChartView.LineSeries)(target));
                return;

            case 10:
                this.LineChart4 = ((Telerik.Windows.Controls.ChartView.LineSeries)(target));
                return;

            case 11:
                this.LineChart5 = ((Telerik.Windows.Controls.ChartView.LineSeries)(target));
                return;

            case 12:
                this.LineChart6 = ((Telerik.Windows.Controls.ChartView.LineSeries)(target));
                return;

            case 13:
                this.LineChart7 = ((Telerik.Windows.Controls.ChartView.LineSeries)(target));
                return;

            case 14:
                this.LineChart8 = ((Telerik.Windows.Controls.ChartView.LineSeries)(target));
                return;

            case 15:
                this.LineChart9 = ((Telerik.Windows.Controls.ChartView.LineSeries)(target));
                return;

            case 16:
                this.LineChart10 = ((Telerik.Windows.Controls.ChartView.LineSeries)(target));
                return;

            case 17:
                this.LineChart11 = ((Telerik.Windows.Controls.ChartView.LineSeries)(target));
                return;

            case 18:
                this.LineChart12 = ((Telerik.Windows.Controls.ChartView.LineSeries)(target));
                return;

            case 19:
                this.ZeroLine = ((Telerik.Windows.Controls.ChartView.LineSeries)(target));
                return;
            }
            this._contentLoaded = true;
        }
Пример #5
0
        private void InitChart()
        {
            try
            {
                ChartBrushes = new List <Brush>();
                ChartBrushes.Add(Brushes.Blue);
                ChartBrushes.Add(Brushes.Green);
                ChartBrushes.Add(Brushes.LightSalmon);
                ChartBrushes.Add(Brushes.DarkRed);
                ChartBrushes.Add(Brushes.Gold);
                ChartBrushes.Add(Brushes.CadetBlue);
                ChartBrushes.Add(Brushes.Coral);
                ChartBrushes.Add(Brushes.Crimson);
                ChartBrushes.Add(Brushes.Indigo);
                ChartBrushes.Add(Brushes.PaleGreen);
                ChartBrushes.Add(Brushes.OrangeRed);
                ChartBrushes.Add(Brushes.Purple);
                ChartBrushes.Add(Brushes.Fuchsia);
                ChartBrushes.Add(Brushes.AliceBlue);
                ChartBrushes.Add(Brushes.Orange);
                ChartBrushes.Add(Brushes.Purple);
                ChartBrushes.Add(Brushes.Chartreuse);
                ChartBrushes.Add(Brushes.MediumBlue);
                ChartBrushes.Add(Brushes.Chocolate);

                int countItems = ItemsId.Count;

                if (ItemsId != null)
                {
                    for (int i = 0; i < countItems; i++)
                    {
                        switch (ChartType)
                        {
                        case ChartType.AreaSeries:
                            Chart.Series.Add(new AreaSeries());
                            AreaSeries series1 = (AreaSeries)this.Chart.Series[i];
                            series1.CategoryBinding = new PropertyNameDataPointBinding()
                            {
                                PropertyName = "Time"
                            };
                            series1.ValueBinding = new PropertyNameDataPointBinding()
                            {
                                PropertyName = "Value"
                            };
                            series1.Stroke          = ChartBrushes[i];
                            series1.StrokeThickness = 2;
                            break;

                        case ChartType.LineSeries:
                            Chart.Series.Add(new LineSeries());
                            LineSeries series2 = (LineSeries)this.Chart.Series[i];
                            series2.CategoryBinding = new PropertyNameDataPointBinding()
                            {
                                PropertyName = "Time"
                            };
                            series2.ValueBinding = new PropertyNameDataPointBinding()
                            {
                                PropertyName = "Value"
                            };
                            series2.Stroke          = ChartBrushes[i];
                            series2.StrokeThickness = 2;
                            break;

                        case ChartType.PointSeries:
                            Chart.Series.Add(new PointSeries());
                            PointSeries series3 = (PointSeries)this.Chart.Series[i];
                            series3.CategoryBinding = new PropertyNameDataPointBinding()
                            {
                                PropertyName = "Time"
                            };
                            series3.ValueBinding = new PropertyNameDataPointBinding()
                            {
                                PropertyName = "Value"
                            };
                            break;

                        case ChartType.SplineAreaSeries:
                            Chart.Series.Add(new SplineAreaSeries());
                            SplineAreaSeries series4 = (SplineAreaSeries)this.Chart.Series[i];
                            series4.CategoryBinding = new PropertyNameDataPointBinding()
                            {
                                PropertyName = "Time"
                            };
                            series4.ValueBinding = new PropertyNameDataPointBinding()
                            {
                                PropertyName = "Value"
                            };
                            series4.Stroke          = ChartBrushes[i];
                            series4.StrokeThickness = 2;
                            break;

                        case ChartType.SplineSeries:
                            Chart.Series.Add(new SplineSeries());
                            SplineSeries series5 = (SplineSeries)this.Chart.Series[i];
                            series5.CategoryBinding = new PropertyNameDataPointBinding()
                            {
                                PropertyName = "Time"
                            };
                            series5.ValueBinding = new PropertyNameDataPointBinding()
                            {
                                PropertyName = "Value"
                            };
                            series5.Stroke          = ChartBrushes[i];
                            series5.StrokeThickness = 2;
                            break;

                        case ChartType.StepAreaSeries:
                            Chart.Series.Add(new StepAreaSeries());
                            StepAreaSeries series6 = (StepAreaSeries)this.Chart.Series[i];
                            series6.CategoryBinding = new PropertyNameDataPointBinding()
                            {
                                PropertyName = "Time"
                            };
                            series6.ValueBinding = new PropertyNameDataPointBinding()
                            {
                                PropertyName = "Value"
                            };
                            series6.Stroke          = ChartBrushes[i];
                            series6.StrokeThickness = 2;
                            break;

                        case ChartType.StepLineSeries:
                            Chart.Series.Add(new StepLineSeries());
                            StepLineSeries series7 = (StepLineSeries)this.Chart.Series[i];
                            series7.CategoryBinding = new PropertyNameDataPointBinding()
                            {
                                PropertyName = "Time"
                            };
                            series7.ValueBinding = new PropertyNameDataPointBinding()
                            {
                                PropertyName = "Value"
                            };
                            series7.Stroke          = ChartBrushes[i];
                            series7.StrokeThickness = 2;
                            break;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.LogIndustrialMonitoring(ex);
            }
        }
Пример #6
0
        void WindowChartHistory_ShowDataCompleted(object sender, ShowDataCompletedEventArgs e)
        {
            try
            {
                if (ItemsId.Count == 1)
                {
                    TextBlockTitle.Text = string.Format("{0} {1}-{2}", e.CurrentItem.ItemName, this.StartTime.ToString(), this.EndTime.ToString());
                }
                else
                {
                    TextBlockTitle.Text = string.Format("Compare {0}-{1}", this.StartTime.ToString(), this.EndTime.ToString());
                }

                switch (ChartType)
                {
                case ChartType.AreaSeries:
                    AreaSeries series1 = (AreaSeries)this.Chart.Series[e.ItemId.Key];
                    series1.ItemsSource = e.Data;
                    break;

                case ChartType.LineSeries:
                    LineSeries series2 = (LineSeries)this.Chart.Series[e.ItemId.Key];
                    series2.ItemsSource = e.Data;
                    break;

                case ChartType.PointSeries:
                    PointSeries series3 = (PointSeries)this.Chart.Series[e.ItemId.Key];
                    series3.ItemsSource = e.Data;
                    break;

                case ChartType.SplineAreaSeries:
                    SplineAreaSeries series4 = (SplineAreaSeries)this.Chart.Series[e.ItemId.Key];
                    series4.ItemsSource = e.Data;
                    break;

                case ChartType.SplineSeries:
                    SplineSeries series5 = (SplineSeries)this.Chart.Series[e.ItemId.Key];
                    series5.ItemsSource = e.Data;
                    break;

                case ChartType.StepAreaSeries:
                    StepAreaSeries series6 = (StepAreaSeries)this.Chart.Series[e.ItemId.Key];
                    series6.ItemsSource = e.Data;
                    break;

                case ChartType.StepLineSeries:
                    StepLineSeries series7 = (StepLineSeries)this.Chart.Series[e.ItemId.Key];
                    series7.ItemsSource = e.Data;
                    break;
                }

                Chart.Zoom = new Size(1, 1);

                if (e.GenerateLegend)
                {
                    ChartLegend.Items.Add(new LegendItem()
                    {
                        MarkerFill = ChartBrushes[e.ItemId.Key], Title = e.CurrentItem.ItemName
                    });
                }

                BusyIndicator.IsBusy = false;
            }
            catch (Exception ex)
            {
                Logger.LogIndustrialMonitoring(ex);
            }
        }