当前位置: 首页>>代码示例>>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;未经允许,请勿转载。