Example #1
0
        private ChartControl getPieChartControl(string variableName, Dictionary <string, int> platformDict, int chartIndex)
        {
            ChartControl chartControl1 = new ChartControl();

            // normalConfigure
            chartControl1.Dock = System.Windows.Forms.DockStyle.Top;
            chartControl1.EmptyChartText.Text = "\r\n";
            chartControl1.Legend.Visible      = false;
            chartControl1.Location            = new System.Drawing.Point(0, 0);
            chartControl1.Name = "chartControl" + chartIndex;

            //configure pie series
            DevExpress.XtraCharts.Series series1 = new DevExpress.XtraCharts.Series();
            series1.Label.PointOptions.PointView = PointView.ArgumentAndValues;
            series1.Label.PointOptions.ValueNumericOptions.Format = DevExpress.XtraCharts.NumericFormat.Percent;
            series1.Label.LineVisible = true;
            series1.LabelsVisibility  = DevExpress.Utils.DefaultBoolean.True;
            series1.Name = "Series 1";

            List <SeriesPoint> seriesPointLIst = new List <SeriesPoint>();
            int pointIndex = 0;

            foreach (KeyValuePair <string, int> kv in platformDict)
            {
                DevExpress.XtraCharts.SeriesPoint seriesPoint = new DevExpress.XtraCharts.SeriesPoint(kv.Key, new object[] {
                    ((object)(kv.Value))
                }, pointIndex);
                seriesPointLIst.Add(seriesPoint);
                pointIndex++;
            }
            series1.Points.AddRange(seriesPointLIst.ToArray());
            DevExpress.XtraCharts.PieSeriesView pieSeriesView1 = new DevExpress.XtraCharts.PieSeriesView();
            pieSeriesView1.RuntimeExploding = false;
            series1.View = pieSeriesView1;

            // configure chart series array
            chartControl1.SeriesSerializable = new DevExpress.XtraCharts.Series[] {
                series1
            };

            DevExpress.XtraCharts.ChartTitle chartTitle1 = new DevExpress.XtraCharts.ChartTitle();
            chartTitle1.Text      = variableName;
            chartTitle1.TextColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            chartControl1.Titles.AddRange(new DevExpress.XtraCharts.ChartTitle[] {
                chartTitle1
            });


            chartControl1.SeriesTemplate.Label.PointOptions.ValueNumericOptions.Format = DevExpress.XtraCharts.NumericFormat.General;
            chartControl1.SeriesTemplate.Label.LineVisible = true;

            //configure chart seriesTemplate View
            DevExpress.XtraCharts.PieSeriesView pieSeriesView2 = new DevExpress.XtraCharts.PieSeriesView();
            pieSeriesView2.RuntimeExploding   = false;
            chartControl1.SeriesTemplate.View = pieSeriesView2;
            chartControl1.Size     = new System.Drawing.Size(500, 500);
            chartControl1.TabIndex = chartIndex;

            return(chartControl1);
        }
Example #2
0
        private void xrLabel4_SummaryGetResult(object sender, DevExpress.XtraReports.UI.SummaryGetResultEventArgs e)
        {
            string strin_f = ts1.TotalHours.ToString();//(0,2) + ":" + ts.Minutes.ToString();
            string itog;

            // e.TotalValue = strin_f;
            if (strin_f.Contains(",") == true)
            {
                int len = strin_f.IndexOf(',', 0);
                if (ts1.Minutes.ToString().Length > 1)
                {
                    itog     = strin_f.Substring(0, len) + ":" + ts1.Minutes.ToString();
                    e.Result = itog;
                }
                else
                {
                    itog     = strin_f.Substring(0, len) + ":0" + ts1.Minutes.ToString();
                    e.Result = itog;
                }
            }
            else
            {
                if (ts1.Minutes.ToString().Length > 1)
                {
                    itog     = strin_f + ":" + ts1.Minutes.ToString();
                    e.Result = itog;
                }
                else
                {
                    itog     = strin_f + ":0" + ts1.Minutes.ToString();
                    e.Result = itog;
                }
            }

            e.Handled = true;

            if (xrLabel7.Text.Equals("Отпуск"))
            {
                return;
            }

            double[] d = new double[1];
            DevExpress.XtraCharts.SeriesPoint w = new DevExpress.XtraCharts.SeriesPoint();
            w.Argument = xrLabel7.Text;
            double dd = double.Parse(strin_f);

            d[0]     = dd;
            w.Values = d;
            xrChart1.Series["Ряд 2"].Points.Add(w);
        }
Example #3
0
 private void ChartFill()
 {
     foreach (DataRow dr in dataTable.Rows)
     {
         double[] d = new double[1];
         DevExpress.XtraCharts.SeriesPoint w = new DevExpress.XtraCharts.SeriesPoint();
         double dd    = double.Parse(dr["minutes"].ToString());
         var    other = dr["other"].ToString();
         w.Argument = String.IsNullOrEmpty(other)?" ":other;
         d[0]       = dd;
         w.Values   = d;
         xrChart1.Series["Ряд 2"].Points.Add(w);
     }
 }
 private void InichartControl3()
 {
     //chartControl3.Series[0].DataSource
     statisticGlobalBean = BizBusiness.getStatisticGlabolInfo(_sdate.DateTime, _edate.DateTime);
     chartControl3.Series[0].Points.Clear();
     foreach (var a in CreateChartData3(statisticGlobalBean))
     {
         string  name  = a.Name;
         decimal vaule = a.Value;
         DevExpress.XtraCharts.SeriesPoint seriesPoint = new DevExpress.XtraCharts.SeriesPoint(name, new object[] {
             vaule
         });
         chartControl3.Series[0].Points.Add(seriesPoint);
     }
 }
Example #5
0
        public void bindData()
        {
            station            mStation   = mCurrentMonitorLb.Tag as station;
            List <sat>         mSatGPS    = MainForm.SatList.Where(p => p.sId == mStation.sId && p.sPrn < 30).ToList();
            List <sat>         mSatGLO    = MainForm.SatList.Where(p => p.sId == mStation.sId && p.sPrn > 30 && p.sPrn < 60).ToList();
            List <sat>         mSatBD     = MainForm.SatList.Where(p => p.sId == mStation.sId && p.sPrn > 60).ToList();
            List <SeriesPoint> mPointsGPS = new List <SeriesPoint>();
            List <SeriesPoint> mPointsGLO = new List <SeriesPoint>();
            List <SeriesPoint> mPointsBD  = new List <SeriesPoint>();

            foreach (var sat in mSatGPS)
            {
                SeriesPoint point = new DevExpress.XtraCharts.SeriesPoint(sat.sAzm, sat.sElev);
                point.Tag = sat.sPrn;
                mPointsGPS.Add(point);
            }
            foreach (var sat in mSatGLO)
            {
                SeriesPoint point = new DevExpress.XtraCharts.SeriesPoint(sat.sAzm, sat.sElev);
                point.Tag = sat.sPrn;
                mPointsGLO.Add(point);
            }
            foreach (var sat in mSatBD)
            {
                SeriesPoint point = new DevExpress.XtraCharts.SeriesPoint(sat.sAzm, sat.sElev);
                point.Tag = sat.sPrn;
                mPointsBD.Add(point);
            }
            mXkt.SetPoints(mPointsGPS, mPointsGLO, mPointsBD);

            List <sat>         mSatXZB     = MainForm.SatList.Where(p => p.sId == mStation.sId).ToList();
            List <SeriesPoint> mPointsXZB1 = new List <SeriesPoint>();
            List <SeriesPoint> mPointsXZB2 = new List <SeriesPoint>();

            foreach (var sat in mSatXZB)
            {
                SeriesPoint point1 = new DevExpress.XtraCharts.SeriesPoint(sat.sPrn, sat.sL1);
                SeriesPoint point2 = new DevExpress.XtraCharts.SeriesPoint(sat.sPrn, sat.sL2);
                point1.Tag = sat.sPrn;
                point2.Tag = sat.sPrn;
                mPointsXZB1.Add(point1);
                mPointsXZB2.Add(point2);
            }
            mXzb.SetPoints(mPointsXZB1, mPointsXZB2);
        }
Example #6
0
        public void SetContorl(DataTable dt, string dicName)
        {
            try
            {
                if (dt != null && dt.Rows.Count > 0)
                {
                    chartControl1.Series[0].Points.Clear();
                    chartControl1.Series[0].Name = dicName;

                    int index = 0;
                    foreach (DataRow dsrow in dt.Rows)
                    {
                        if (dsrow["mt_time"] != null && !string.IsNullOrEmpty(dsrow["mt_time"].ToString()))
                        {
                            index = index + 1;
                            string fvalue     = "";
                            string pinputTime = dsrow["mt_time"].ToString();
                            pinputTime = "*" + pinputTime;
                            fvalue     = dsrow["mt_valuetext"].ToString();//空腹血糖

                            var op2 = new DevExpress.XtraCharts.SeriesPoint(pinputTime, new object[] { ((object)(fvalue)) });

                            chartControl1.Series[0].Points.Add(op2);
                        }
                    }


                    var xyd = (XYDiagram)chartControl1.Diagram;

#pragma warning disable 618
                    xyd.AxisX.Range.Auto             = false;
                    xyd.AxisX.Range.MaxValueInternal = 20; //在不拉滚动条的时候,X轴显示多个值,既固定的X轴长度。
#pragma warning restore 618
                    xyd.EnableAxisXScrolling = true;       //启用X轴滚动条
                }
                else
                {
                    chartControl1.Series[0].Points.Clear();
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
            }
        }
Example #7
0
File: Wxzt.cs Project: chliam/dam
        public void bindData()
        {
            station mStation = mCurrentMonitorLb.Tag as station;
            List<sat> mSatGPS = MainForm.SatList.Where(p => p.sId == mStation.sId && p.sPrn < 30).ToList();
            List<sat> mSatGLO = MainForm.SatList.Where(p => p.sId == mStation.sId && p.sPrn > 30 && p.sPrn < 60).ToList();
            List<sat> mSatBD = MainForm.SatList.Where(p => p.sId == mStation.sId && p.sPrn > 60).ToList();
            List<SeriesPoint> mPointsGPS = new List<SeriesPoint>();
            List<SeriesPoint> mPointsGLO = new List<SeriesPoint>();
            List<SeriesPoint> mPointsBD = new List<SeriesPoint>();
            foreach (var sat in mSatGPS) {
                SeriesPoint point = new DevExpress.XtraCharts.SeriesPoint(sat.sAzm, sat.sElev);
                point.Tag = sat.sPrn;
                mPointsGPS.Add(point);
            }
            foreach (var sat in mSatGLO)
            {
                SeriesPoint point = new DevExpress.XtraCharts.SeriesPoint(sat.sAzm, sat.sElev);
                point.Tag = sat.sPrn;
                mPointsGLO.Add(point);
            }
            foreach (var sat in mSatBD)
            {
                SeriesPoint point = new DevExpress.XtraCharts.SeriesPoint(sat.sAzm, sat.sElev);
                point.Tag = sat.sPrn;
                mPointsBD.Add(point);
            }
            mXkt.SetPoints(mPointsGPS, mPointsGLO, mPointsBD);

            List<sat> mSatXZB = MainForm.SatList.Where(p => p.sId == mStation.sId).ToList();
            List<SeriesPoint> mPointsXZB1 = new List<SeriesPoint>();
            List<SeriesPoint> mPointsXZB2 = new List<SeriesPoint>();
            foreach (var sat in mSatXZB)
            {
                SeriesPoint point1 = new DevExpress.XtraCharts.SeriesPoint(sat.sPrn, sat.sL1);
                SeriesPoint point2 = new DevExpress.XtraCharts.SeriesPoint(sat.sPrn, sat.sL2);
                point1.Tag = sat.sPrn;
                point2.Tag = sat.sPrn;
                mPointsXZB1.Add(point1);
                mPointsXZB2.Add(point2);
            }
            mXzb.SetPoints(mPointsXZB1, mPointsXZB2);
        }
Example #8
0
        /// <summary>
        /// Handles the Click event of the btnStatistics control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        /// 整理人:桂书丛
        /// 整理时间:2013-03-04
        private void btnStatistics_Click(object sender, EventArgs e)
        {
            string paramStartDateTime = this.txtStartData.Text.Trim() + " " + this.tmeStartInGoods.Text.Trim();
            string paramEndDateTime   = this.txtEndData.Text.Trim() + " " + this.tmeEndInGoods.Text.Trim();

            myDataTable = myBUCMS_InGoods.GetDateMoney(Convert.ToDateTime(paramStartDateTime), Convert.ToDateTime(paramEndDateTime));
            for (int i = 0; i < myDataTable.Rows.Count; i++)
            {
                foreach (Series s in chartInGoodsDate.Series)
                {
                    if (myDataTable.Rows[i]["Name"].ToString() == s.Name)
                    {
                        mySeriesPoint          = new DevExpress.XtraCharts.SeriesPoint();
                        mySeriesPoint.Argument = myDataTable.Rows[i]["Name"].ToString();
                        mySeriesPoint.Values   = new double[] { Convert.ToDouble(myDataTable.Rows[i]["Total"].ToString()) };
                        s.Points.Add(mySeriesPoint);
                    }
                }
            }
        }
Example #9
0
        private void ChartFill()
        {
            string lastWork = "";

            foreach (DataRow dr in dataSet.Tables[0].Rows)
            {
                if (dr["work"].ToString().Equals(lastWork))
                {
                    continue;
                }
                lastWork = dr["work"].ToString();
                double[] d = new double[1];
                DevExpress.XtraCharts.SeriesPoint w = new DevExpress.XtraCharts.SeriesPoint();
                double dd = double.Parse(dr["work_minutes"].ToString());
                w.Argument = dr["work"].ToString();
                d[0]       = dd;
                w.Values   = d;
                xrChart1.Series["Ряд 2"].Points.Add(w);
            }
        }
Example #10
0
        private void FRMInsideInspectionReport_Load(object sender, EventArgs e)
        {
            DataTable t1 = tablelist[0];
            DataTable t2 = tablelist[1];

            gridControl1.DataSource = t1;
            gridControl2.DataSource = t2;

            gridView2.OptionsView.ColumnAutoWidth = false;
            gridView1.OptionsView.ColumnAutoWidth = false;
            gridControl1.Refresh();
            gridControl2.Refresh();
            chartControl1.Series.Clear();
            DevExpress.XtraCharts.Series      s  = new DevExpress.XtraCharts.Series("", ViewType.Pie);
            DevExpress.XtraCharts.SeriesPoint sp = new DevExpress.XtraCharts.SeriesPoint();
            s.Points.Add(new DevExpress.XtraCharts.SeriesPoint("小于1米", t2.Rows[0][2]));
            s.Points.Add(new DevExpress.XtraCharts.SeriesPoint(">1米且≤2米", t2.Rows[1][2]));
            s.Points.Add(new DevExpress.XtraCharts.SeriesPoint("大于2米", t2.Rows[2][2]));
            ((DevExpress.XtraCharts.PieSeriesLabel)s.Label).PointOptions.Pattern = "{A}: {V}";
            ((DevExpress.XtraCharts.PieSeriesLabel)s.Label).Position             = DevExpress.XtraCharts.PieSeriesLabelPosition.TwoColumns;
            // Detect overlapping of series labels.
            ((DevExpress.XtraCharts.PieSeriesLabel)s.Label).ResolveOverlappingMode = DevExpress.XtraCharts.ResolveOverlappingMode.Default;
            PieSeriesView myView = (PieSeriesView)s.View;

            myView.ExplodedPointsFilters.Add(new SeriesPointFilter(SeriesPointKey.Value_1,
                                                                   DataFilterCondition.GreaterThanOrEqual, 9));
            myView.ExplodedPointsFilters.Add(new SeriesPointFilter(SeriesPointKey.Argument,
                                                                   DataFilterCondition.NotEqual, "Others"));
            myView.ExplodeMode = PieExplodeMode.UseFilters;
            myView.ExplodedDistancePercentage = 30;
            myView.RuntimeExploding           = true;
            myView.HeightToWidthRatio         = 0.75;
            chartControl1.Series.Add(s);

            //microChart1.Text = "内检测对齐分析";
            //microChart1.ChartType = DevComponents.DotNetBar.eMicroChartType.Pie;

            //microChart1.DataPoints = new List<double>() {Convert.ToDouble(t2.Rows[0][2]), Convert.ToDouble(t2.Rows[1][2]) ,Convert.ToDouble(t2.Rows[2][2])};
            //microChart1.DataPointTooltips = new List<string>() { "≤1米", ">1米且≤2米", "大于2米" };
        }
Example #11
0
        private void reporting_Load(object sender, EventArgs e)
        {
            dt.Columns.Add("utilisateur");
            dt.Columns.Add("Charges");
            dt.Columns.Add("Produits");

            ChartControl lineChart = new ChartControl();

            chartControl1.Visible = true;
            Series s1 = new Series("ecriture", ViewType.Bar);
            Series s2 = new Series("ecriture", ViewType.Bar);
            Series s3 = new Series("ecriture", ViewType.Bar);

            chartControl1.Series.Clear();
            foreach (DataRow rw in dt.Rows)
            {
                DevExpress.XtraCharts.SeriesPoint seriesPoint1 = new DevExpress.XtraCharts.SeriesPoint(rw[0].ToString(), new object[] {
                    ((object)(format_devise(rw[1].ToString())))
                });
                MessageBox.Show(rw[1].ToString());
                s1.Points.Add(seriesPoint1);
                DevExpress.XtraCharts.SeriesPoint seriesPoint2 = new DevExpress.XtraCharts.SeriesPoint(rw[0].ToString(), new object[] {
                    ((object)(format_devise(rw[2].ToString())))
                });
                MessageBox.Show(rw[2].ToString());
                s2.Points.Add(seriesPoint2);

                DevExpress.XtraCharts.SeriesPoint seriesPoint3 = new DevExpress.XtraCharts.SeriesPoint(rw[0].ToString(), new object[] {
                    ((object)(format_devise(rw[2].ToString())))
                });
                MessageBox.Show(rw[2].ToString());
                s3.Points.Add(seriesPoint3);
            }
            chartControl1.Series.Add(s1);
            chartControl1.Series.Add(s2);
            chartControl1.Series.Add(s3);
        }
Example #12
0
        public void SetContorl(DataTable dt, string dicName)
        {
            try
            {
                if (dt != null && dt.Rows.Count > 0)
                {
                    dt.Columns.Add("realValue", typeof(string));
                    foreach (DataRow dsrow in dt.Rows)
                    {
                        string fvalue = "";
                        if (_mtValuetype == "0")
                        {
                            fvalue = dsrow["mt_valueint"].ToString();//空腹血糖
                        }
                        else if (_mtValuetype == "1")
                        {
                            fvalue = dsrow["mt_valuefloat"].ToString();//空腹血糖
                        }
                        else if (_mtValuetype == "2")
                        {
                            fvalue = dsrow["mt_valuetext"].ToString();//空腹血糖
                        }
                        dsrow["realValue"] = fvalue;
                        dsrow["mt_time"]   = dsrow["mt_time"].ToString();
                    }
                }

                if (dt != null && dt.Rows.Count > 0)
                {
                    if (chartControl1.Series.Count > 0)
                    {
                        chartControl1.Series[0].Points.Clear();
                        _seriesold = (Series)chartControl1.Series[0].Clone();
                    }
                    _seriesold.Points.Clear();
                    Series series = _seriesold;
                    series.Points.Clear();
                    series.Name = dicName;
                    chartControl1.Series.Clear();
                    int index = 0;
                    foreach (DataRow dsrow in dt.Rows)
                    {
                        if (dsrow["mt_time"] != null && !string.IsNullOrEmpty(dsrow["mt_time"].ToString()))
                        {
                            index = index + 1;
                            string fvalue     = "";
                            string pinputTime = dsrow["mt_time"].ToString();
                            pinputTime = "*" + pinputTime;
                            if (_mtValuetype == "0")
                            {
                                fvalue = dsrow["mt_valueint"].ToString();//空腹血糖
                            }
                            else if (_mtValuetype == "1")
                            {
                                fvalue = dsrow["mt_valuefloat"].ToString();//空腹血糖
                            }
                            else if (_mtValuetype == "2")
                            {
                                fvalue = dsrow["mt_valuetext"].ToString();//空腹血糖
                            }
                            var op2 = new DevExpress.XtraCharts.SeriesPoint(pinputTime, new object[] { ((object)(fvalue)) });

                            series.Points.Add(op2);
                        }
                    }
                    chartControl1.Series.Add(series);
                }
                else
                {
                    _seriesold = (Series)chartControl1.Series[0].Clone();
                    _seriesold.Points.Clear();
                    chartControl1.Series.Clear();
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
            }
        }
Example #13
0
        public void SetXueYaContorl(DataTable dt)
        {
            try
            {
                DataTable dtnew = null;
                if (dt != null && dt.Rows.Count > 0)
                {
                    dt.Columns.Add("realValue", typeof(string));
                    dtnew = dt.Clone();
                    foreach (DataRow dsrow in dt.Select("mt_code='100'"))
                    {
                        DataRow drnew = dtnew.NewRow();
                        drnew["realValue"]      = dsrow["mt_valueint"].ToString();//空腹血糖
                        drnew["mt_normalrange"] = "(90-120)/(60-90)";
                        drnew["mt_time"]        = dsrow["mt_time"].ToString();
                        drnew["mt_unit"]        = dsrow["mt_unit"].ToString();
                        string mttim = dsrow["mt_time"].ToString();
                        foreach (DataRow row in dt.Select("mt_code='101'"))
                        {
                            if (mttim == row["mt_time"].ToString())
                            {
                                drnew["realValue"] = row["mt_valueint"] + "/" + dsrow["mt_valueint"];
                            }
                        }

                        dtnew.Rows.Add(drnew);
                    }
                }


                if (dt != null && dt.Rows.Count > 0)
                {
                    if (chartControl1.Series.Count > 0)
                    {
                        chartControl1.Series[0].Points.Clear();
                        _seriesold = (Series)chartControl1.Series[0].Clone();
                    }
                    _seriesold.Points.Clear();
                    var series = (Series)_seriesold.Clone();
                    series.Points.Clear();
                    series.Name = @"舒张压";
                    Series series2 = _seriesold;
                    series2.Points.Clear();
                    series2.Name = @"收缩压";
                    chartControl1.Series.Clear();

                    int index = 0;
                    foreach (DataRow dsrow in dt.Select("mt_code='101'"))
                    {
                        if (dsrow["mt_time"] != null && !string.IsNullOrEmpty(dsrow["mt_time"].ToString()))
                        {
                            index = index + 1;
                            string fvalue     = dsrow["mt_valueint"].ToString();//空腹血糖
                            string pinputTime = dsrow["mt_time"].ToString();

                            pinputTime = "*" + pinputTime;
                            var op2 = new DevExpress.XtraCharts.SeriesPoint(pinputTime, new object[] { ((object)(fvalue)) });

                            series2.Points.Add(op2);
                        }
                    }

                    foreach (DataRow dsrow in dt.Select("mt_code='100'"))
                    {
                        if (dsrow["mt_time"] != null && !string.IsNullOrEmpty(dsrow["mt_time"].ToString()))
                        {
                            index = index + 1;
                            string fvalue     = dsrow["mt_valueint"].ToString();//空腹血糖
                            string pinputTime = dsrow["mt_time"].ToString();

                            pinputTime = "*" + pinputTime;
                            var op2 = new DevExpress.XtraCharts.SeriesPoint(pinputTime, new object[] { ((object)(fvalue)) });


                            series.Points.Add(op2);
                        }
                    }
                    chartControl1.Series.Add(series2);
                    chartControl1.Series.Add(series);
                }
                else
                {
                    _seriesold = (Series)chartControl1.Series[0].Clone();
                    _seriesold.Points.Clear();
                    chartControl1.Series.Clear();
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
            }
        }
Example #14
0
        public void SetContorl(DataTable dt, string dicName, int page, bool isclear = false)
        {
            try
            {
                if (page == 1)
                {
                    if (isclear)
                    {
                        dicRows.Clear();
                    }
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        for (int i = 1; i < 13; i++)
                        {
                            dicRows.Add(i, dt.Select("id<=" + (i * 60) + " and id>" + (i - 1) * 60).ToList());
                        }
                    }
                    else
                    {
                        chartControl1.Series[0].Points.Clear();
                    }
                }

                chartControl1.Series[0].Points.Clear();
                chartControl1.Series[0].Name = dicName;

                int index = 0;
                if (dicRows[page].Count <= 0)
                {
                    return;
                }
                foreach (DataRow dsrow in dicRows[page])
                {
                    if (dsrow["mt_time"] != null && !string.IsNullOrEmpty(dsrow["mt_time"].ToString()))
                    {
                        index = index + 1;
                        string fvalue     = "";
                        string pinputTime = dsrow["mt_time"].ToString();
                        pinputTime = "*" + pinputTime;
                        fvalue     = dsrow["mt_valuetext"].ToString();//空腹血糖

                        var op2 = new DevExpress.XtraCharts.SeriesPoint(pinputTime, new object[] { ((object)(fvalue)) });

                        chartControl1.Series[0].Points.Add(op2);
                    }
                }


                var xyd = (XYDiagram)chartControl1.Diagram;

                   #pragma warning disable 618
                xyd.AxisX.Range.Auto             = false;
                xyd.AxisX.Range.MaxValueInternal = 20; //在不拉滚动条的时候,X轴显示多个值,既固定的X轴长度。
                   #pragma warning restore 618
                xyd.EnableAxisXScrolling = true;       //启用X轴滚动条
            }
            catch (Exception ex)
            {
                string message = ex.Message;
            }
        }
Example #15
0
        public AgenteGestion(dynamic viewBag, Rp3.AgendaComercial.Models.Consulta.View.AgenteReporteGestion model, Rp3.AgendaComercial.Models.Consulta.View.AgenteReporteGestionModo modo, bool mostrarFotos)
        {
            InitializeComponent();
            this.bindingSource.DataSource   = model;
            this.xrPictureBoxLogo.BackColor = Color.FromArgb(52, 56, 60);
            this.cellTitulo.BackColor       = Color.FromArgb(52, 56, 60);
            this.cellRangoFechas.BackColor  = Color.FromArgb(52, 56, 60);
            this.cellAgente.BackColor       = Color.FromArgb(52, 56, 60);
            this.cellAgente.Text            = string.Format("Agente: {0}", viewBag.Agente);
            this.cellRangoFechas.Text       = viewBag.RangoFechas;
            this.cellEmitidoEl.Text         = DateTime.Now.ToString("g");
            this.cellEmitidoPor.Text        = Rp3.Web.Mvc.Session.LogonName;
            this.rowObservacion.Visible     = modo == AgendaComercial.Models.Consulta.View.AgenteReporteGestionModo.Detallado;
            this.rowFotos.Visible           = mostrarFotos;
            this.foto1.Visible = mostrarFotos;
            this.foto2.Visible = mostrarFotos;
            this.foto3.Visible = mostrarFotos;
            DevExpress.XtraCharts.Series      serie            = this.xrChartMarcaciones.SeriesSerializable[0];
            DevExpress.XtraCharts.SeriesPoint pointAsistencias = new DevExpress.XtraCharts.SeriesPoint("Asistencias", new object[] { ((object)(model.Asistencias)) }, 0);
            DevExpress.XtraCharts.SeriesPoint pointAusencias   = new DevExpress.XtraCharts.SeriesPoint("Ausencias", new object[] { ((object)(model.Ausencias)) }, 1);
            DevExpress.XtraCharts.SeriesPoint pointAtrasos     = new DevExpress.XtraCharts.SeriesPoint("Atrasos", new object[] { ((object)(model.Atrasos)) }, 2);
            serie.Points.AddRange(new DevExpress.XtraCharts.SeriesPoint[] { pointAsistencias, pointAusencias, pointAtrasos });

            this.GroupFooterSinEfectividad.Visible = model.Gestionados.Count == 0 & model.ClientesNoVisitados.Count == 0 & model.Proximos.Count == 0;
            this.DetailEfectividad.Visible         = !this.GroupFooterSinEfectividad.Visible;

            this.GroupHeaderGruposResumen.Visible = model.GruposResumen.Count != 0;
            this.DetailGruposResumen.Visible      = model.GruposResumen.Count != 0;
            this.GroupFooterGruposResumen.Visible = model.GruposResumen.Count != 0;
            this.GroupFooterSinResumen.Visible    = model.GruposResumen.Count == 0;

            this.GroupHeaderGruposClientesCreados.Visible = model.ClientesCreados.Count != 0;
            this.DetailGruposClientesCreados.Visible      = model.ClientesCreados.Count != 0;
            this.DetailReportClientesCreados.Visible      = model.ClientesCreados.Count != 0;

            this.GroupHeaderGruposNoVisitados.Visible    = model.GruposNoVisitados.Count != 0;
            this.DetailGruposNoVisitados.Visible         = model.GruposNoVisitados.Count != 0;
            this.DetailReportNoVisitadosClientes.Visible = model.GruposNoVisitados.Count != 0;
            this.GroupFooterSinNoVisitados.Visible       = model.GruposNoVisitados.Count == 0;

            this.GroupHeaderGruposVisitados.Visible    = model.GruposVisitados.Count != 0;
            this.DetailGruposVisitados.Visible         = model.GruposVisitados.Count != 0;
            this.DetailReportVisitadosClientes.Visible = model.GruposVisitados.Count != 0;
            this.GroupFooterSinVisitados.Visible       = model.GruposVisitados.Count == 0;

            this.GroupHeaderGruposPendientes.Visible    = model.GruposPendientes.Count != 0;
            this.DetailGruposPendientes.Visible         = model.GruposPendientes.Count != 0;
            this.DetailReportPendientesClientes.Visible = model.GruposPendientes.Count != 0;
            this.GroupFooterSinPendientes.Visible       = model.GruposPendientes.Count == 0;

            this.GroupHeaderMarcaciones.Visible         = model.Marcaciones.Count != 0;
            this.DetailMarcaciones.Visible              = model.Marcaciones.Count != 0;
            this.GroupFooterMarcaciones.Visible         = model.Marcaciones.Count != 0;
            this.DetailReportGraficoMarcaciones.Visible = model.Marcaciones.Count != 0;
            this.GroupFooterSinMarcaciones.Visible      = model.Marcaciones.Count == 0;

            this.GroupFooterSinClientesCreados.Visible = model.ClientesCreados.Count == 0;

            this.GroupHeaderPermisos.Visible    = model.PermisosJustificaciones.Count != 0;
            this.DetailPermisos.Visible         = model.PermisosJustificaciones.Count != 0;
            this.GroupFooterSinPermisos.Visible = model.PermisosJustificaciones.Count == 0;

            this.GroupHeaderOportunidades.Visible    = model.Oportunidades.Count != 0;
            this.DetailOportunidades.Visible         = model.Oportunidades.Count != 0;
            this.GroupFooterOportunidades.Visible    = model.Oportunidades.Count != 0;
            this.GroupFooterSinOportunidades.Visible = model.Oportunidades.Count == 0;
        }
Example #16
0
 public frmChartView(DataTable data, string type)
 {
     InitializeComponent();
     if (data == null || data.Rows.Count == 0)
     {
         MessageBox.Show("Dữ liệu rỗng! Xin vui lòng chọn lại dữ liệu", "Thông báo",
             MessageBoxButtons.OK, MessageBoxIcon.Warning);
         //this.Close();
         return;
     }
     myInit();
     switch (type)
     {
         case "ByDate":
                 DevExpress.XtraCharts.Series series = new DevExpress.XtraCharts.Series();
                 for (int i = 0; i < data.Rows.Count; i++)
                 {
                     DevExpress.XtraCharts.SeriesPoint point = new DevExpress.XtraCharts.SeriesPoint();
                     point.Argument = Convert.ToString(data.Rows[i]["Ngayxuat"]);
                     double[] temp = new double[1];
                     if (!(data.Rows[i]["ThanhTien"] is DBNull || (data.Rows[i]["ThanhTien"]).ToString() == ""))
                     {
                         temp[0] = Convert.ToDouble(data.Rows[i]["ThanhTien"]);
                     }
                     else
                         temp[0] = 0;
                     point.Values = temp;
                     series.Points.Add(point);
                     series.ArgumentScaleType = DevExpress.XtraCharts.ScaleType.DateTime;
                 }
                 chartControl1.Series.Add(series);
             chartControl1.Titles[0].Text = "Sản phẩm bán thống kê theo ngày";
             break;
         case "ByMonth":
                 DevExpress.XtraCharts.Series series1 = new DevExpress.XtraCharts.Series();
                 //series.LegendText = productName;
                 for (int i = 0; i < data.Rows.Count; i++)
                 {
                     DevExpress.XtraCharts.SeriesPoint point = new DevExpress.XtraCharts.SeriesPoint();
                     point.Argument = Convert.ToString(data.Rows[i]["Ngayxuat"]);
                     double[] temp = new double[1];
                     if (!(data.Rows[i]["ThanhTien"] is DBNull))
                     {
                         temp[0] = Convert.ToDouble(data.Rows[i]["ThanhTien"]);
                     }
                     else
                         temp[0] = 0;
                     point.Values = temp;
                     series1.Points.Add(point);
                 }
                 chartControl1.Series.Add(series1);
             chartControl1.Titles[0].Text = "Sản phẩm bán thống kê theo tháng";
             break;
         default:
             break;
     }
 }
        public frmChartView(DataTable data, string type)
        {
            InitializeComponent();
            if (data == null || data.Rows.Count == 0)
            {
                MessageBox.Show("Dữ liệu rỗng! Xin vui lòng chọn lại dữ liệu", "Thông báo",
                                MessageBoxButtons.OK, MessageBoxIcon.Warning);
                //this.Close();
                return;
            }
            myInit();
            switch (type)
            {
            case "ByDate":
                DevExpress.XtraCharts.Series series = new DevExpress.XtraCharts.Series();
                for (int i = 0; i < data.Rows.Count; i++)
                {
                    DevExpress.XtraCharts.SeriesPoint point = new DevExpress.XtraCharts.SeriesPoint();
                    point.Argument = Convert.ToString(data.Rows[i]["Ngayxuat"]);
                    double[] temp = new double[1];
                    if (!(data.Rows[i]["ThanhTien"] is DBNull || (data.Rows[i]["ThanhTien"]).ToString() == ""))
                    {
                        temp[0] = Convert.ToDouble(data.Rows[i]["ThanhTien"]);
                    }
                    else
                    {
                        temp[0] = 0;
                    }
                    point.Values = temp;
                    series.Points.Add(point);
                    series.ArgumentScaleType = DevExpress.XtraCharts.ScaleType.DateTime;
                }
                chartControl1.Series.Add(series);
                chartControl1.Titles[0].Text = "Sản phẩm bán thống kê theo ngày";
                break;

            case "ByMonth":
                DevExpress.XtraCharts.Series series1 = new DevExpress.XtraCharts.Series();
                //series.LegendText = productName;
                for (int i = 0; i < data.Rows.Count; i++)
                {
                    DevExpress.XtraCharts.SeriesPoint point = new DevExpress.XtraCharts.SeriesPoint();
                    point.Argument = Convert.ToString(data.Rows[i]["Ngayxuat"]);
                    double[] temp = new double[1];
                    if (!(data.Rows[i]["ThanhTien"] is DBNull))
                    {
                        temp[0] = Convert.ToDouble(data.Rows[i]["ThanhTien"]);
                    }
                    else
                    {
                        temp[0] = 0;
                    }
                    point.Values = temp;
                    series1.Points.Add(point);
                }
                chartControl1.Series.Add(series1);
                chartControl1.Titles[0].Text = "Sản phẩm bán thống kê theo tháng";
                break;

            default:
                break;
            }
        }
        private void IniPie(ChartControl chartControl, DataTable table, MouseEventHandler mouseEventHandler, string PaletteColorName)
        {
            try
            {
                int      iCount      = table.Rows.Count;
                int      i           = 0;
                Series[] ArraySeries = new Series[iCount];
                foreach (DataRow dr in table.Rows)
                {
                    DevExpress.XtraCharts.Series            series             = new DevExpress.XtraCharts.Series();
                    DevExpress.XtraCharts.PieSeriesView     pieSeriesView      = new DevExpress.XtraCharts.PieSeriesView();
                    DevExpress.XtraCharts.PieSeriesLabel    pieSeriesLabel1    = new DevExpress.XtraCharts.PieSeriesLabel();
                    DevExpress.XtraCharts.SeriesTitle       seriesTitle1       = new DevExpress.XtraCharts.SeriesTitle();
                    DevExpress.XtraCharts.PieWidenAnimation pieWidenAnimation1 = new DevExpress.XtraCharts.PieWidenAnimation();
                    //
                    ((System.ComponentModel.ISupportInitialize)(chartControl)).BeginInit();
                    ((System.ComponentModel.ISupportInitialize)(pieSeriesLabel1)).BeginInit();
                    ((System.ComponentModel.ISupportInitialize)(series)).BeginInit();
                    ((System.ComponentModel.ISupportInitialize)(pieSeriesView)).BeginInit();
                    //
                    chartControl.Legend.Visibility    = DevExpress.Utils.DefaultBoolean.False;
                    pieSeriesLabel1.BackColor         = System.Drawing.Color.Transparent;
                    pieSeriesLabel1.Border.Visibility = DevExpress.Utils.DefaultBoolean.False;
                    pieSeriesLabel1.ColumnIndent      = 20;
                    pieSeriesLabel1.Font        = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Bold);
                    pieSeriesLabel1.LineLength  = 30;
                    pieSeriesLabel1.Position    = DevExpress.XtraCharts.PieSeriesLabelPosition.Inside;
                    pieSeriesLabel1.TextPattern = "{A}\n{V}";
                    pieSeriesLabel1.Font        = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                    //
                    seriesTitle1.Dock = DevExpress.XtraCharts.ChartTitleDockStyle.Bottom;
                    pieSeriesView.Titles.AddRange(new DevExpress.XtraCharts.SeriesTitle[] {
                        seriesTitle1
                    });
                    pieSeriesView.Animation = pieWidenAnimation1;
                    //
                    series.Label = pieSeriesLabel1;
                    series.View  = pieSeriesView;
                    series.Name  = dr["Name"].ToString();
                    series.Tag   = dr["DSA"];

                    DevExpress.XtraCharts.SeriesPoint seriesPoint = new DevExpress.XtraCharts.SeriesPoint(dr["Value"], dr["Count"], 0);
                    seriesPoint.Tag = dr["Name"].ToString();
                    if (PaletteColorName.Length > 0)
                    {
                        seriesPoint.ColorSerializable = ToHexColor(this.chartControl1.PaletteRepository["Chameleon"][i].Color);
                    }
                    else
                    {
                        seriesPoint.ColorSerializable = ToHexColor(Color.Wheat);
                    }
                    series.Points.Add(seriesPoint);
                    ArraySeries[i++] = series;

                    //
                    ((System.ComponentModel.ISupportInitialize)(pieSeriesLabel1)).EndInit();
                    ((System.ComponentModel.ISupportInitialize)(series)).EndInit();
                    ((System.ComponentModel.ISupportInitialize)(pieSeriesView)).EndInit();
                    ((System.ComponentModel.ISupportInitialize)(chartControl)).EndInit();
                    //
                }
                chartControl.AnimationStartMode = DevExpress.XtraCharts.ChartAnimationMode.OnDataChanged;
                chartControl.SelectionMode      = ElementSelectionMode.Single;
                chartControl.SeriesSerializable = ArraySeries;
                chartControl.Dock        = DockStyle.Fill;
                chartControl.MouseClick += mouseEventHandler;
                chartControl.BorderOptions.Visibility = DevExpress.Utils.DefaultBoolean.False;
            }
            catch { }
        }