当前位置: 首页>>代码示例>>C#>>正文


C# DataPoint.SetValueY方法代码示例

本文整理汇总了C#中System.Windows.Forms.DataVisualization.Charting.DataPoint.SetValueY方法的典型用法代码示例。如果您正苦于以下问题:C# DataPoint.SetValueY方法的具体用法?C# DataPoint.SetValueY怎么用?C# DataPoint.SetValueY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.DataVisualization.Charting.DataPoint的用法示例。


在下文中一共展示了DataPoint.SetValueY方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: phodiemthi_Load

        private void phodiemthi_Load(object sender, EventArgs e)
        {
            dataGridView1.Hide();
            dbVeMTDataContext db = new dbVeMTDataContext();
            dataGridView1.Rows.Clear();
            var results = from p in db.vemts
                          group p by p.diem into g
                          select new { diem = g.Key , soluong = g.Count() };
            dataGridView1.DataSource = results;
            db.SubmitChanges();
            //Tìm và đặt giá trị MAX cho trục Y
            int max = Convert.ToInt32(dataGridView1.Rows[0].Cells[0].Value);
            for (int i = 1; i <= dataGridView1.SelectedRows.Count; i++)
                if (max < Convert.ToInt32(dataGridView1.Rows[i].Cells[0].Value))
                    max = Convert.ToInt32(dataGridView1.Rows[i].Cells[0].Value);
            if (chart1.ChartAreas[0].AxisY.Maximum < max) chart1.ChartAreas[0].AxisY.Maximum = max;

            chart1.Series.Clear();

            Series s = new Series();
            for (int i = 0; i < dataGridView1.Rows.Count; i++)
            {
                s.ChartType = SeriesChartType.Line;
                DataPoint p = new DataPoint();
                p.XValue = i;
                p.SetValueY(Convert.ToDouble(dataGridView1.Rows[i].Cells[1].Value));
                //p.AxisLabel = "Điểm " + dataGridView1.Rows[i].Cells[0].Value.ToString() +"";
                p.AxisLabel = "điểm" + i.ToString(); ;
                s.Points.Add(p);
            }
            chart1.Series.Add(s);
        }
开发者ID:hokhacnam,项目名称:DATN,代码行数:32,代码来源:phodiemthi.cs

示例2: MitPie

        public MitPie(int miID, int akPro)
        {
            InitializeComponent();
            this.MinimumSize = new Size(300, 300);
            this.MaximumSize = new Size(800, 500);
            chart1.Size = new Size(this.Width - 10, this.Height - 10);
            DataTable arbeiter = SqlConnection.SelectStatement("SELECT prName,sum( zeDauer ) as sum,miName,miVorname FROM tzeiterfassung LEFT JOIN tProjekt using (prID) LEFT JOIN tMitarbeiter using (miID) WHERE miID =" + miID + " GROUP BY prID");
            DataTableReader reader = arbeiter.CreateDataReader();

            Series a = chart1.Series[0];

            if (reader.HasRows)
            {
                while (reader.Read())
                {

                    DataPoint p = new DataPoint();
                    p.SetValueY(Convert.ToDouble(reader["sum"].ToString()));
                    p.AxisLabel = reader["prName"].ToString();
                    p.IsValueShownAsLabel = true;
                    a.Points.Add(p);

                }
                Mitarbeiter.Text = reader["miVorname"].ToString() + " " + reader["miName"].ToString();
            }
        }
开发者ID:Gasbuddel,项目名称:Zeiterfassungsprojekt,代码行数:26,代码来源:MitPie.cs

示例3: ResultGraph

        public ResultGraph(List<Vote> votes, List<string> options, string title)
        {
            InitializeComponent();

            this.questionTextBox.Text = title;

            this.resultsChart.Series.Clear();

            for (int i=0; i<options.Count; i++)
            {
                int value = 0;
                foreach (Vote v in votes)
                    if (v.choice == i)
                        value++;

                string s = options[i];
                this.resultsChart.Series.Add(s);
                DataPoint d = new DataPoint();
                d.SetValueY(value);
                this.resultsChart.Series[s].Points.Add(d);
            }
        }
开发者ID:CareyJWilliams,项目名称:microbit-quiz,代码行数:22,代码来源:ResultGraph.cs

示例4: button1_Click

        private void button1_Click(object sender, EventArgs e)
        {
            int max = Convert.ToInt32(dataGridView1.Rows[0].Cells[0].Value);
            for (int i = 1; i <= dataGridView1.SelectedRows.Count; i++)
                if (max < Convert.ToInt32(dataGridView1.Rows[i].Cells[0].Value))
                    max = Convert.ToInt32(dataGridView1.Rows[i].Cells[0].Value);
            if (chart1.ChartAreas[0].AxisY.Maximum < max) chart1.ChartAreas[0].AxisY.Maximum = max;

            chart1.Series.Clear();

            Series s = new Series();
            for (int i = 0; i < dataGridView1.Rows.Count; i++)
            {
                s.ChartType = SeriesChartType.Line;
                DataPoint p = new DataPoint();
                p.XValue = i;
                p.SetValueY(Convert.ToDouble(dataGridView1.Rows[i].Cells[1].Value));
                p.AxisLabel =  dataGridView1.Rows[i].Cells[0].Value.ToString();
                //p.AxisLabel = dataGridView1.Rows[i].Cells[0].Value.ToString();
                s.Points.Add(p);
            }
            chart1.Series.Add(s);
        }
开发者ID:hokhacnam,项目名称:DATN,代码行数:23,代码来源:phodiemthi.cs

示例5: writeChartData

        private void writeChartData()
        {
            while (true)
            {
                chart1.Invoke(new Action(delegate()
                    {
                        chart1.Series["Series1"].Points.Clear();
                        for (int i = 0; i < 100; i++)
                        {
                            DataPoint p = new DataPoint();
                            p.SetValueY(pts[i]);
                            if (pts[i] > offset)
                                p.Color = Color.OrangeRed;
                            else
                                p.Color = Color.DodgerBlue;
                            chart1.Series["Series1"].Points.Add(p);
                        }

                    }));
            }
        }
开发者ID:shopen93,项目名称:serialPortGraph,代码行数:21,代码来源:Form1.cs

示例6: ToolStripMenuItem_PasteFromClipboard

        private void ToolStripMenuItem_PasteFromClipboard(object sender, EventArgs e)
        {
            ToolStripMenuItem TMI = (ToolStripMenuItem)sender;
            cExtendedTable ET = (cExtendedTable)TMI.Tag;

            Series TmpSerie = new Series();

            for (int i = 0; i < ET[0].Count; i++)
            {
                DataPoint DP = new DataPoint();
                // DP.XValue = ET[0][i];

                List<double> LD = new List<double>();

                for (int j = 1; j < ET.Count; j++)
                {
                    LD.Add(ET[j][i]);
                }

                DP.SetValueY(LD.ToArray());

                TmpSerie.Points.Add(DP);

                //TmpSerie.
            }

            CurrentSeries.Add(TmpSerie);

            this.Run();

            //Run();

            //if (this.GraphBelow != null)
            //{
            //    if (this.GraphBelow.GetType() == typeof(cChart1DGraph))
            //    {
            //        //  ((cChart1DGraph)this.GraphBelow).Run();
            //    }
            //}

            //   ListInput = new cListExtendedTable();
            //  ListInput.Add(ET);

            ///  this.Run();

            // cExtendedTable doc = sender.GetType();
        }
开发者ID:cyrenaique,项目名称:HCSA,代码行数:47,代码来源:cChart1DGraph.cs

示例7: Plot

        public void Plot(IEnumerable ys, string seriesName = null, string chartType = "Line")
        {
            var isNested = false;
            if (!CheckDataType(ys, out isNested))
                throw new NotSupportedException("The provided Y values type is not supported. "+SupportedTypes);

            var series = seriesName != null ? new Series(seriesName) : new Series();
            foreach (var value in ys)
            {
                var point = new DataPoint();
                if (!isNested)
                {
                    point.SetValueY(value);
                }
                else
                {
                    var yValues = ((IEnumerable) value).Cast<object>().ToArray();
                    point.SetValueY(yValues);
                }
                series.Points.Add(point);
            }
            series.ChartTypeName = chartType;
            Plot(series);
        }
开发者ID:CedarLogic,项目名称:CShell,代码行数:24,代码来源:PlotSinkViewModel.cs


注:本文中的System.Windows.Forms.DataVisualization.Charting.DataPoint.SetValueY方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。