Exemplo n.º 1
0
        private void GenerarGrafica()
        {
            try {
                var Aux = PageView.SelectedPage;

                if (Aux.Enabled)
                {
                    BarSeries barSeria = new BarSeries();
                    barSeria.DataSource     = oList;
                    barSeria.ValueMember    = Aux.Tag.ToString();
                    barSeria.CategoryMember = "Id";

                    ChartPanZoomController panZoomController = new ChartPanZoomController();
                    panZoomController.PanZoomMode = ChartPanZoomMode.Horizontal;
                    chart1.View.Palette           = KnownPalette.Arctic;

                    chart = chart1;
                    chart.Series.Clear();
                    chart.Series.Add(barSeria);
                    chart.Title       = Aux.Text;
                    chart.ShowPanZoom = true;
                    chart.Controllers.Add(panZoomController);

                    chart.Dock = DockStyle.Fill;
                    Aux.Controls.Add(chart);
                }
            } catch (Exception ex) {
                throw ex;
            }
        }
Exemplo n.º 2
0
        private void GenerarGraficas()
        {
            try {
                var Aux = PageView.SelectedPage;

                if (Aux.Enabled)
                {
                    BarSeries barSeria = new BarSeries();
                    barSeria.DataSource     = Historica || Ensamble ? oHistoria : oList[0].Valores;
                    barSeria.ValueMember    = Aux.Tag.ToString();
                    barSeria.CategoryMember = "Limite";

                    ChartPanZoomController panZoomController = new ChartPanZoomController();
                    panZoomController.PanZoomMode = ChartPanZoomMode.Horizontal;
                    chart1.View.Palette           = KnownPalette.Arctic;

                    chart = chart1;
                    chart.Series.Clear();
                    chart.Series.Add(barSeria);
                    chart.Title       = Aux.Text;
                    chart.ShowPanZoom = true;
                    chart.Controllers.Add(panZoomController);

                    chart.Dock = DockStyle.Fill;
                    Aux.Controls.Add(chart);
                }
            } catch (Exception ex) {
                RadMessageBox.Show("Ocurrio un error generar la gráfica\n" + ex.Message, this.Text, MessageBoxButtons.OK, RadMessageIcon.Error);
            }
        }
Exemplo n.º 3
0
        private void DrawBars()
        {
            for (int i = 0; i < 100; i++)
            {
                radChartView1.Series[0].DataPoints.Add(i);
            }
            ChartPanZoomController zoomController = new ChartPanZoomController();

            zoomController.PanZoomMode = ChartPanZoomMode.Horizontal;
            radChartView1.Controllers.Add(zoomController);
            radChartView1.ShowPanZoom = true;
            radChartView1.Zoom(3, 1);
        }
Exemplo n.º 4
0
        private void Initialize()
        {
            var panZoomController = new ChartPanZoomController {
                PanZoomMode = ChartPanZoomMode.Horizontal
            };

            radChartView1.Controllers.Add(panZoomController);

            radChartView1.ShowPanZoom = true;

            ChartTrackballController controler = new ChartTrackballController();

            controler.TextNeeded += controler_TextNeeded;
            radChartView1.Controllers.Add(controler);

            radChartView1.Controllers.Add(new ChartTooltipController());

            radChartView1.ShowToolTip = false;
            radChartView1.Zoom(85, 1);
            radChartView1.Pan(1000, 0);


            radChartView1.ShowLegend       = true;
            this.radChartView1.LegendTitle = "Legend";
            this.radChartView1.ChartElement.LegendElement.TitleElement.Font = new Font("Arial", 16, FontStyle.Italic);


            //setup the Cartesian Grid
            var area = radChartView1.GetArea <CartesianArea>();

            area.ShowGrid = true;
            CartesianGrid grid = area.GetGrid <CartesianGrid>();

            grid.DrawHorizontalFills        = true;
            grid.BorderDashStyle            = System.Drawing.Drawing2D.DashStyle.Solid;
            grid.ForeColor                  = Color.LightGray;
            grid.DrawHorizontalFills        = true;
            grid.DrawVerticalFills          = true;
            grid.AlternatingVerticalColor   = true;
            grid.AlternatingHorizontalColor = true;
            grid.AlternatingBackColor       = Color.White;
            grid.AlternatingBackColor2      = Color.White;
        }
Exemplo n.º 5
0
        private void GenerarSerie()
        {
            var Aux = PageView.SelectedPage;

            try {
                if (oSeries.Count > 0)
                {
                    ChartPanZoomController panZoomController = new ChartPanZoomController();
                    panZoomController.PanZoomMode = ChartPanZoomMode.Horizontal;
                    chart1.View.Palette           = KnownPalette.Material;

                    chart = chart1;
                    chart.Series.Clear();
                    chart.Title       = Aux.Text;
                    chart.ShowPanZoom = true;
                    chart.Controllers.Add(panZoomController);

                    //Create and add Moving Average indicator
                    BollingerBandsIndicator maIndicator = new BollingerBandsIndicator();
                    maIndicator.CategoryMember     = "Fecha";
                    maIndicator.DataSource         = oSeries;
                    maIndicator.Period             = 1;
                    maIndicator.StandardDeviations = 1;

                    //Create and add hlc series
                    HlcSeries series = new HlcSeries();

                    if (Aux.Tag.ToString() == "Cav1")
                    {
                        maIndicator.ValueMember = "Val1";
                        series.CloseValueMember = "Val1";
                        series.HighValueMember  = "Max1";
                        series.LowValueMember   = "Min1";
                    }
                    if (Aux.Tag.ToString() == "Cav2")
                    {
                        maIndicator.ValueMember = "Val2";
                        series.CloseValueMember = "Val2";
                        series.HighValueMember  = "Max2";
                        series.LowValueMember   = "Min2";
                    }
                    if (Aux.Tag.ToString() == "Cav3")
                    {
                        maIndicator.ValueMember = "Val3";
                        series.CloseValueMember = "Val3";
                        series.HighValueMember  = "Max3";
                        series.LowValueMember   = "Min3";
                    }
                    if (Aux.Tag.ToString() == "Cav4")
                    {
                        maIndicator.ValueMember = "Val4";
                        series.CloseValueMember = "Val4";
                        series.HighValueMember  = "Max4";
                        series.LowValueMember   = "Min4";
                    }
                    if (Aux.Tag.ToString() == "Cav5")
                    {
                        maIndicator.ValueMember = "Val5";
                        series.CloseValueMember = "Val5";
                        series.HighValueMember  = "Max5";
                        series.LowValueMember   = "Min5";
                    }
                    if (Aux.Tag.ToString() == "Cav6")
                    {
                        maIndicator.ValueMember = "Val6";
                        series.CloseValueMember = "Val6";
                        series.HighValueMember  = "Max6";
                        series.LowValueMember   = "Min6";
                    }
                    if (Aux.Tag.ToString() == "Cav7")
                    {
                        maIndicator.ValueMember = "Val7";
                        series.CloseValueMember = "Val7";
                        series.HighValueMember  = "Max7";
                        series.LowValueMember   = "Min7";
                    }
                    if (Aux.Tag.ToString() == "Cav8")
                    {
                        maIndicator.ValueMember = "Val8";
                        series.CloseValueMember = "Val8";
                        series.HighValueMember  = "Max8";
                        series.LowValueMember   = "Min8";
                    }
                    maIndicator.BorderColor = Color.Red;
                    maIndicator.PointSize   = SizeF.Empty;

                    chart.Series.Add(maIndicator);

                    series.CategoryMember = "Fecha";
                    series.DataSource     = oSeries;
                    series.BorderColor    = Color.Green;

                    chart.ShowLegend = false;
                    chart.Dock       = DockStyle.Fill;
                    chart.Series.Add(series);
                    Aux.Controls.Add(chart);
                }
            } catch (Exception ex) {
                RadMessageBox.Show("Ocurrio un error al generar la gráfica\n" + ex.Message, this.Text, MessageBoxButtons.OK, RadMessageIcon.Error);
            } finally {
                oEnsamble = null;
            }
        }
Exemplo n.º 6
0
        private void GenerarGraficas()
        {
            try {
                if (oList.Count > 0)
                {
                    var     Aux  = PageView.SelectedPage;
                    decimal vMin = 0;

                    if (Aux.Enabled)
                    {
                        ChartPanZoomController panZoomController = new ChartPanZoomController();
                        panZoomController.PanZoomMode = ChartPanZoomMode.Horizontal;
                        chart1.View.Palette           = KnownPalette.Material;

                        chart = chart1;
                        chart.Series.Clear();
                        chart.Title       = Aux.Text;
                        chart.ShowPanZoom = true;
                        chart.Controllers.Add(panZoomController);

                        LineSeries lineSeries = new LineSeries();
                        LineSeries Min        = new LineSeries();
                        oList[0].Valores.ForEach(item => {
                            if (Aux.Tag.ToString() == "Cav1")
                            {
                                vMin = oList[0].Norma.Cav1;
                                lineSeries.DataPoints.Add(new CategoricalDataPoint(item.Val1, item.Hora));
                                Min.DataPoints.Add(new CategoricalDataPoint(double.Parse(vMin.ToString()), item.Hora));
                            }
                            if (Aux.Tag.ToString() == "Cav2")
                            {
                                vMin = oList[0].Norma.Cav2;
                                lineSeries.DataPoints.Add(new CategoricalDataPoint(item.Val2, item.Hora));
                                Min.DataPoints.Add(new CategoricalDataPoint(double.Parse(vMin.ToString()), item.Hora));
                            }
                            if (Aux.Tag.ToString() == "Cav3")
                            {
                                vMin = oList[0].Norma.Cav3;
                                lineSeries.DataPoints.Add(new CategoricalDataPoint(item.Val3, item.Hora));
                                Min.DataPoints.Add(new CategoricalDataPoint(double.Parse(vMin.ToString()), item.Hora));
                            }
                            if (Aux.Tag.ToString() == "Cav4")
                            {
                                vMin = oList[0].Norma.Cav4;
                                lineSeries.DataPoints.Add(new CategoricalDataPoint(item.Val4, item.Hora));
                                Min.DataPoints.Add(new CategoricalDataPoint(double.Parse(vMin.ToString()), item.Hora));
                            }
                            if (Aux.Tag.ToString() == "Cav5")
                            {
                                vMin = oList[0].Norma.Cav5;
                                lineSeries.DataPoints.Add(new CategoricalDataPoint(item.Val5, item.Hora));
                                Min.DataPoints.Add(new CategoricalDataPoint(double.Parse(vMin.ToString()), item.Hora));
                            }
                            if (Aux.Tag.ToString() == "Cav6")
                            {
                                vMin = oList[0].Norma.Cav6;
                                lineSeries.DataPoints.Add(new CategoricalDataPoint(item.Val6, item.Hora));
                                Min.DataPoints.Add(new CategoricalDataPoint(double.Parse(vMin.ToString()), item.Hora));
                            }
                            if (Aux.Tag.ToString() == "Cav7")
                            {
                                vMin = oList[0].Norma.Cav7;
                                lineSeries.DataPoints.Add(new CategoricalDataPoint(item.Val7, item.Hora));
                                Min.DataPoints.Add(new CategoricalDataPoint(double.Parse(vMin.ToString()), item.Hora));
                            }
                            if (Aux.Tag.ToString() == "Cav8")
                            {
                                vMin = oList[0].Norma.Cav8;
                                lineSeries.DataPoints.Add(new CategoricalDataPoint(item.Val8, item.Hora));
                                Min.DataPoints.Add(new CategoricalDataPoint(double.Parse(vMin.ToString()), item.Hora));
                            }
                        });

                        lineSeries.LegendTitle = "Valor";
                        Min.LegendTitle        = "Min";

                        chart.ShowLegend = true;
                        chart.Series.Add(lineSeries);
                        chart.Series.Add(Min);
                        chart.Dock = DockStyle.Fill;
                        Aux.Controls.Add(chart);
                    }
                }
                else
                {
                    RadMessageBox.Show("No existen datos a graficar", this.Text, MessageBoxButtons.OK, RadMessageIcon.Info);
                }
            } catch (Exception ex) {
                RadMessageBox.Show("Ocurrio un error al generar la gráfica\n" + ex.Message, this.Text, MessageBoxButtons.OK, RadMessageIcon.Error);
            }
        }