當前位置: 首頁>>代碼示例>>C#>>正文


C# Chart.Update方法代碼示例

本文整理匯總了C#中System.Windows.Forms.DataVisualization.Charting.Chart.Update方法的典型用法代碼示例。如果您正苦於以下問題:C# Chart.Update方法的具體用法?C# Chart.Update怎麽用?C# Chart.Update使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Windows.Forms.DataVisualization.Charting.Chart的用法示例。


在下文中一共展示了Chart.Update方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: GeneratePlot

        public string GeneratePlot(double[] items, string title)
        {
            string file = "";
            chart = new Chart();

            chart.ChartAreas.Add(new ChartArea());
            int i = 1;
            foreach (var item in items)
            {
                SetChart(title, i, item);
                i++;
            }

            DateTime d = DateTime.Now;
            var xxx = String.Format("{0}_{1}_{2}_{3}_{4}_{5}_{6}", d.Year, d.Month, d.Day, d.Hour, d.Minute, d.Second, d.Millisecond);
            String chartFilename = Common.Folder.Data + "\\" + xxx + ".bmp";
            chart.Update();
            chart.SaveImage(chartFilename, System.Drawing.Imaging.ImageFormat.Bmp);
            file = chartFilename;

            return file;
        }
開發者ID:DrZeil,項目名稱:nbn-csharp,代碼行數:22,代碼來源:ResearchNBN.cs

示例2: GetChart

        public Chart GetChart()
        {
            if (ListDescriptors[CurrentDescriptorToDisplay].GetAssociatedType().GetBinNumber() == 1) return null;

            Series CurrentSeries = new Series("ChartSeries" + PosX + "x" + PosY);
            //CurrentSeries.ShadowOffset = 2;

            for (int IdxValue = 0; IdxValue < ListDescriptors[CurrentDescriptorToDisplay].GetAssociatedType().GetBinNumber(); IdxValue++)
                CurrentSeries.Points.Add(ListDescriptors[CurrentDescriptorToDisplay].Getvalue(IdxValue));

            ChartArea CurrentChartArea = new ChartArea("ChartArea" + PosX + "x" + PosY);
            CurrentChartArea.BorderColor = Color.White;

            Chart ChartToReturn = new Chart();
            ChartToReturn.ChartAreas.Add(CurrentChartArea);
               // ChartToReturn.TextAntiAliasingQuality = TextAntiAliasingQuality.High;
            CurrentChartArea.BackColor = Color.White;

            CurrentChartArea.Axes[1].LabelStyle.Enabled = false;
            CurrentChartArea.Axes[1].MajorGrid.Enabled = false;
            CurrentChartArea.Axes[0].Enabled = AxisEnabled.False;
            CurrentChartArea.Axes[1].Enabled = AxisEnabled.False;

            CurrentChartArea.Axes[0].MajorGrid.Enabled = false;
              //  CurrentChartArea.Axes[0].Title = ListDescriptors[CurrentDescriptorToDisplay].GetName();
            CurrentSeries.ChartType = SeriesChartType.Line;
            CurrentSeries.Color = Color.Black;
               // CurrentSeries.BorderWidth = 3;
            CurrentSeries.ChartArea = "ChartArea" + PosX + "x" + PosY;

            CurrentSeries.Name = "Series" + PosX + "x" + PosY;
            ChartToReturn.Series.Add(CurrentSeries);

            Title CurrentTitle = new Title(PosX + "x" + PosY);
               // ChartToReturn.Titles.Add(CurrentTitle);

            ChartToReturn.Width = 100;
            ChartToReturn.Height = 48;

            ChartToReturn.Update();
              //  ChartToReturn.Show();

            return ChartToReturn;
        }
開發者ID:cyrenaique,項目名稱:HCS,代碼行數:44,代碼來源:cWell.cs

示例3: Marker

        //=============================================================
        private void Marker(Chart ch, int SerNum, int PointNum, int opt)
        {
            int serlen;
            switch (opt)
            {
                case 0://change
                    ch.Series[SerNum].Points[PointNum].MarkerStyle = MarkerStyle.Cross;
                    ch.Series[SerNum].Points[PointNum].MarkerSize = 5;
                    ch.Series[SerNum].Points[PointNum].MarkerColor = System.Drawing.Color.Red;
                    ch.Update();
                    break;
                case 1://restore point
                    ch.Series[SerNum].Points[PointNum].MarkerStyle = ch.Series[SerNum].MarkerStyle;
                    ch.Series[SerNum].Points[PointNum].MarkerSize = ch.Series[SerNum].MarkerSize;
                    ch.Series[SerNum].Points[PointNum].MarkerColor = ch.Series[SerNum].MarkerColor;
                    ch.Update();
                    break;
                case 2://restore series ?????????????
                    serlen = ch.Series[SerNum].Points.Count;
                    for (int i = 0; i < serlen; i++)
                    {
                        if (ch.Series[SerNum].Points[i].MarkerStyle != ch.Series[SerNum].MarkerStyle)
                            ch.Series[SerNum].Points[i].MarkerStyle = ch.Series[SerNum].MarkerStyle;
                        if (ch.Series[SerNum].Points[i].MarkerSize != ch.Series[SerNum].MarkerSize)
                            ch.Series[SerNum].Points[i].MarkerSize = ch.Series[SerNum].MarkerSize;
                        if (ch.Series[SerNum].Points[i].MarkerColor != ch.Series[SerNum].MarkerColor)
                            ch.Series[SerNum].Points[i].MarkerColor = ch.Series[SerNum].MarkerColor;
                    }
                    ch.Update();

                    break;
                default:
                    break;
            }
        }
開發者ID:BdGL3,項目名稱:CXPortal,代碼行數:36,代碼來源:MainWindow.xaml.cs


注:本文中的System.Windows.Forms.DataVisualization.Charting.Chart.Update方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。