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


C# Charts.DataPoint类代码示例

本文整理汇总了C#中Visifire.Charts.DataPoint的典型用法代码示例。如果您正苦于以下问题:C# DataPoint类的具体用法?C# DataPoint怎么用?C# DataPoint使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: ImportLineData

        public void ImportLineData(ArrayList values1, ArrayList values2)
        {
            dsc = new DataSeriesCollection();
            DataSeries ds1 = new DataSeries();
            ds1.RenderAs = RenderAs.Line;
            ds1.LegendText = "ObjValue";
            for (int i = 0; i < values1.Count; i = i + 4)
            {
                DataPoint dp = new DataPoint();
                dp.YValue = (double)values1[i];
                dp.XValue = i;
                ds1.DataPoints.Add(dp);
            }

            DataSeries ds2 = new DataSeries();
            ds2.RenderAs = RenderAs.Line;
            ds2.LegendText = "Variance";
            for (int i = 0; i < values2.Count; i = i + 4)
            {
                DataPoint dp = new DataPoint();
                dp.YValue = (double)values2[i];
                dp.XValue = i;
                ds2.DataPoints.Add(dp);
            }
            dsc.Add(ds1);
            dsc.Add(ds2);

        }
开发者ID:silibili,项目名称:Clustering-Algorithm-in-csharp,代码行数:28,代码来源:ChartHelper.cs

示例2: TestDateTimeWithSingleDataPoint

        public void TestDateTimeWithSingleDataPoint()
        {
            Chart chart = new Chart();
            chart.Width = 500;
            chart.Height = 300;

            _isLoaded = false;
            chart.Loaded += new RoutedEventHandler(chart_Loaded);

            Random rand = new Random();

            TestPanel.Children.Add(chart);

            EnqueueConditional(() => { return _isLoaded; });
            EnqueueDelay(_sleepTime);

            EnqueueCallback(() =>
            {
                DataSeries dataSeries = new DataSeries();
                DataPoint dataPoint = new DataPoint();
                dataPoint.XValue = new DateTime(2009, 1, 1);
                dataPoint.YValue = rand.Next(10, 100);
                dataSeries.DataPoints.Add(dataPoint);

                chart.Series.Add(dataSeries);
            });

            EnqueueCallback(() =>
            {
                Assert.AreEqual(1, chart.Series[0].DataPoints.Count);
            });

            EnqueueDelay(_sleepTime);
            EnqueueTestComplete();
        }
开发者ID:zhangzy0193,项目名称:visifire,代码行数:35,代码来源:DateTimeAxisTest.cs

示例3: TestDateTimeWithSingleDataPoint

        public void TestDateTimeWithSingleDataPoint()
        {
            Chart chart = new Chart();
            chart.Width = 500;
            chart.Height = 300;

            _isLoaded = false;
            chart.Loaded += new RoutedEventHandler(chart_Loaded);

            Random rand = new Random();

            DataSeries dataSeries = new DataSeries();
            DataPoint dataPoint = new DataPoint();
            dataPoint.XValue = new DateTime(2009, 1, 1);
            dataPoint.YValue = rand.Next(10, 100);
            dataSeries.DataPoints.Add(dataPoint);

            chart.Series.Add(dataSeries);

            Window window = new Window();
            window.Content = chart;
            window.Show();
            if (_isLoaded)
            {
                Assert.AreEqual(1, chart.Series[0].DataPoints.Count);
                window.Dispatcher.InvokeShutdown();
                window.Close();
            }
        }
开发者ID:tdhieu,项目名称:openvss,代码行数:29,代码来源:DateTimeAxisTest.cs

示例4: barGraph_Click

 //柱状图
 private void barGraph_Click(object sender, RoutedEventArgs e)
 {
     graphContainer.Children.Clear();
     Chart chart = new Chart();
     chart.Watermark = false;
     chart.View3D = true;
     chart.Width = 300;
     chart.Height = 200;
     Title title = new Title();
     title.Text = "人口类别统计图";
     chart.Titles.Add(title);
     for (int i = 0; i < 8; i++)
     {
         DataSeries dataSeries = new DataSeries();
         dataSeries.ShowInLegend = false;
         dataSeries.RenderAs = RenderAs.Column;
         for (int loopIndex = 0; loopIndex < 3; loopIndex++)
         {
             DataPoint dataPoint = new DataPoint();
             dataPoint.AxisXLabel = pop[loopIndex];
             dataPoint.YValue = points[i, loopIndex];
             dataSeries.DataPoints.Add(dataPoint);
         }
         chart.Series.Add(dataSeries);
     }
     //将柱状图添加到 Grid 控件以固定位置
     graphContainer.VerticalAlignment = VerticalAlignment.Top;
     graphContainer.HorizontalAlignment = HorizontalAlignment.Left;
     graphContainer.Children.Add(chart);
 }
开发者ID:SuperMap,项目名称:iClient-for-Silverlight,代码行数:31,代码来源:ThemeGraph.xaml.cs

示例5: NetSyn_Mydata

 void NetSyn_Mydata(DataStruct msg)
 {
     int packagenumber = msg.trafficRate;
     double rate = packagenumber * 472.0 * 8.0 / 5000.0;
     DataPoint dataPoint = new DataPoint();
     dataPoint.YValue = rate;
     FullFigure.DataPoints.Add(dataPoint);
 }
开发者ID:Tripmaster-zhang,项目名称:Hello_World,代码行数:8,代码来源:TrafficRateFullFigure.xaml.cs

示例6: CreateLcChartSpline

        private void CreateLcChartSpline(int index)
        {
            //添加横坐标
            if (lcChart.AxesX.Count == 0)
            {
                Axis xAxis = new Axis();
                xAxis.Title = "岩层编号";
                lcChart.AxesX.Add(xAxis);
            }

            //添加纵坐标
            if (lcChart.AxesY.Count == 0)
            {
                Axis yAxis = new Axis();
                yAxis.Title = LCDestOpt[index];
                yAxis.IntervalType = IntervalTypes.Number;
                yAxis.ValueFormatString = "f3";
                yAxis.Suffix = "m";
                lcChart.AxesY.Add(yAxis);
            }
            else
            {
                lcChart.AxesY[0].Title = LCDestOpt[index];
            }

            //设置数据点
            lcDataSeries.DataPoints.Clear();
            DataPoint dataPoint;
            int drawCount = keyLayers.Count;
            for (int i = 0; i < drawCount; i++)
            {
                //创建一个数据点的实例
                dataPoint = new DataPoint();
                //设置X轴点
                dataPoint.AxisXLabel = keyLayers[i].ycbh.ToString();
                dataPoint.XValue = i + 1;
                //设置Y轴点
                switch(index)
                {
                    case 0:
                        dataPoint.YValue = keyLayers[i].yczdxcz;
                        break;
                    case 1:
                        dataPoint.YValue = keyLayers[i].jsdjscjwy;
                        break;
                    case 2:
                        dataPoint.YValue = keyLayers[i].jsdjslcwy;
                        break;
                }

                dataPoint.MarkerSize = 8;
                dataPoint.MouseLeftButtonDown += new MouseButtonEventHandler(lcdataPoint_MouseLeftButtonDown);
                //添加数据点
                lcDataSeries.DataPoints.Add(dataPoint);
            }
        }
开发者ID:meikeyuan,项目名称:main,代码行数:56,代码来源:Document.offsetlc.cs

示例7: AddDataToDataSerise

 public static void AddDataToDataSerise(DataSeries ds,List<double> list)
 {
     double allCount = 100;
     double value = allCount / list.Count;
     for (int i = 0; i < list.Count; i++)
     {
         DataPoint dp = new DataPoint() { YValue = System.Math.Abs(list[i]) * 0.1, XValue = i * value };
         ds.DataPoints.Add(dp);
     }
 }
开发者ID:dewade2003,项目名称:DSJL,代码行数:10,代码来源:DataSeriseUtil.cs

示例8: GetDataPointCollection

 public static DataPointCollection GetDataPointCollection( List<double> list)
 {
     DataPointCollection dpc = new DataPointCollection();
     double allCount = 100;
     double value = allCount / list.Count;
     for (int i = 0; i < list.Count; i++)
     {
         DataPoint dp = new DataPoint() { YValue = System.Math.Abs(list[i]) * 0.1, XValue = i * value };
         dpc.Add(dp);
     }
     return dpc;
 }
开发者ID:dewade2003,项目名称:DSJL,代码行数:12,代码来源:DataSeriseUtil.cs

示例9: ColumnChartPerformanceTest

        public void ColumnChartPerformanceTest()
        {
            Double totalDuration = 0;
            DateTime start = DateTime.UtcNow;

            Chart chart = new Chart();
            chart.Width = 500;
            chart.Height = 300;
            chart.View3D = false;

            _isLoaded = false;
            chart.Loaded += new RoutedEventHandler(chart_Loaded);

            Axis axisX = new Axis();
            axisX.Interval = 1;
            chart.AxesX.Add(axisX);

            Random rand = new Random();

            Int32 numberOfSeries = 0;
            DataSeries dataSeries = null;
            Int32 numberofDataPoint = 0;

            String msg = Common.AssertAverageDuration(100, 1, delegate
            {
                dataSeries = new DataSeries();
                dataSeries.RenderAs = RenderAs.Column;

                for (Int32 i = 0; i < 1000; i++)
                {
                    DataPoint dataPoint = new DataPoint();
                    dataPoint.AxisXLabel = "a" + i;
                    dataPoint.YValue = rand.Next(-100, 100);
                    dataSeries.DataPoints.Add(dataPoint);
                    numberofDataPoint++;
                }
                numberOfSeries++;
                chart.Series.Add(dataSeries);
            });

            window = new Window();
            window.Content = chart;
            window.Show();
            if (_isLoaded)
            {
                DateTime end = DateTime.UtcNow;
                totalDuration = (end - start).TotalSeconds;

                MessageBox.Show("Total Chart Loading Time: " + totalDuration + "s" + "\n"  + "Number of Render Count: " + chart.ChartArea._renderCount + "\n" + "Series Calculation: " + msg);
            }
            window.Dispatcher.InvokeShutdown();
        }
开发者ID:tdhieu,项目名称:openvss,代码行数:52,代码来源:PerformanceTests.cs

示例10: TestDataPointPropertyChanged

        public void TestDataPointPropertyChanged()
        {
            Chart chart = new Chart();
            chart.Width = 500;
            chart.Height = 300;

            _isLoaded = false;
            chart.Loaded += new RoutedEventHandler(chart_Loaded);

            Random rand = new Random();

            TestPanel.Children.Add(chart);

            EnqueueConditional(() => { return _isLoaded; });
            EnqueueDelay(_sleepTime);

            DataSeries dataSeries = new DataSeries();
            DataPoint dataPoint = null;

            for (Int32 i = 0; i < 10; i++)
            {
                dataPoint = new DataPoint();
                dataPoint.XValue = i + 1;
                dataPoint.YValue = rand.Next(10, 100);

                dataPoint.PropertyChanged += delegate(Object sender, System.ComponentModel.PropertyChangedEventArgs e)
                {
                    Assert.IsNotNull(e.PropertyName);
                    if (e.PropertyName == "XValue")
                        Assert.AreEqual("XValue", e.PropertyName);
                    else if (e.PropertyName == "YValue")
                        Assert.AreEqual("YValue", e.PropertyName);
                    else
                        Assert.IsNotNull(e.PropertyName);
                };

                dataSeries.DataPoints.Add(dataPoint);
            }

            chart.Series.Add(dataSeries);

            EnqueueCallback(() =>
            {
                dataPoint.XValue = 10;
                dataPoint.YValue = rand.Next(-100, 100);
            });

            EnqueueDelay(_sleepTime);
            EnqueueTestComplete();

        }
开发者ID:tdhieu,项目名称:openvss,代码行数:51,代码来源:DataPointTest.cs

示例11: SetChartData

 private void SetChartData(DataTable dt,string strname, string linecolor)
 {
     Visifire.Charts.DataSeries dataSeries = new Visifire.Charts.DataSeries();
     AddDataSeries(strname, dataSeries, LineStyles.Solid, new SolidColorBrush((Color)ColorConverter.ConvertFromString(linecolor)), Visifire.Charts.RenderAs.QuickLine);
     for (int i = 0; i < dt.Rows.Count; i++)
     {
         Visifire.Charts.DataPoint dataPoint = new DataPoint();
         dataPoint.AxisXLabel = dt.Rows[i]["time"].ToString();
         dataPoint.Color = new SolidColorBrush(Colors.Blue);
         dataPoint.YValue = Convert.ToDouble(dt.Rows[i]["value"]);
         dataPoint.Tag = " ";
         dataSeries.DataPoints.Add(dataPoint);
     }
     this.chartC.Series.Add(dataSeries);
 }
开发者ID:UEChip,项目名称:UENSimulation,代码行数:15,代码来源:ChartLineYearUC.xaml.cs

示例12: TestDataPointPropertyChanged

        public void TestDataPointPropertyChanged()
        {
            Chart chart = new Chart();
            chart.Width = 500;
            chart.Height = 300;

            _isLoaded = false;
            chart.Loaded += new RoutedEventHandler(chart_Loaded);

            Random rand = new Random();

            DataSeries dataSeries = new DataSeries();
            DataPoint dataPoint = null;

            for (Int32 i = 0; i < 10; i++)
            {
                dataPoint = new DataPoint();
                dataPoint.XValue = i + 1;
                dataPoint.YValue = rand.Next(10, 100);

                dataPoint.PropertyChanged += delegate(Object sender, System.ComponentModel.PropertyChangedEventArgs e)
                {
                    Assert.IsNotNull(e.PropertyName);
                    if (e.PropertyName == "XValue")
                        Assert.AreEqual("XValue", e.PropertyName);
                    else
                        Assert.AreEqual("YValue", e.PropertyName);
                        
                };

                dataSeries.DataPoints.Add(dataPoint);
            }
            chart.Series.Add(dataSeries);
            
            Window window = new Window();
            window.Content = chart;
            window.Show();
            if (_isLoaded)
            {
                dataPoint.XValue = 10;
                dataPoint.YValue = rand.Next(-100, 100);
            }
       
            window.Dispatcher.InvokeShutdown();
            window.Close();
        }
开发者ID:zhangzy0193,项目名称:visifire,代码行数:46,代码来源:DataPointTest.cs

示例13: CreateChart

        /// <summary>
        /// Function to create a chart
        /// </summary>
        public void CreateChart()
        {
            // Create a new instance of Chart
            Chart chart = new Chart();

            // Set the chart width and height
            //chart.Width = 500;
            //chart.Height = 300;

            // Create a new instance of Title
            Title title = new Title();

            // Set title property
            title.Text = "Visifire Sample Chart";

            // Add title to Titles collection
            chart.Titles.Add(title);

            // Create a new instance of DataSeries
            DataSeries dataSeries = new DataSeries();

            // Set DataSeries property
            dataSeries.RenderAs = RenderAs.Column;

            // Create a DataPoint
            DataPoint dataPoint;

            for (int i = 0; i < 5; i++) {
                // Create a new instance of DataPoint
                dataPoint = new DataPoint();

                // Set YValue for a DataPoint
                dataPoint.YValue = rand.Next(10, 100);

                // Add dataPoint to DataPoints collection
                dataSeries.DataPoints.Add(dataPoint);
            }

            // Add dataSeries to Series collection.
            chart.Series.Add(dataSeries);

            // Add chart to LayoutRoot
            LayoutRoot.Children.Add(chart);
        }
开发者ID:beginor,项目名称:AssemblyNavigation,代码行数:47,代码来源:ChartPage.xaml.cs

示例14: Bubble3D1

        public Bubble3D1()
        {
            InitializeComponent();

             Chart chart = new Chart();

                // Create a new instance of Title
                Title title = new Title();

                // Set title property
                title.Text = "Election Result";

                // Add title to Titles collection
                chart.Titles.Add(title);

                DataPoint dataPoint;
                PhoneApplicationService.Current.State["GetTopEarnerList"] = GetDataByStatesJSONRequest.dataList;
                 getDataList = (List<DataByState>)PhoneApplicationService.Current.State["GetTopEarnerList"];
                    DataSeries dataSeries = new DataSeries();

                // Set DataSeries property
                dataSeries.RenderAs = RenderAs.Bubble;
                   for (int i = 0; i < getDataList.Count; i++)
                {
                    // Create a new instance of DataPoint
                    dataPoint = new DataPoint();

                    // Set YValue for a DataPoint
                    dataPoint.YValue = Convert.ToDouble(getDataList[i].votes);

                        dataPoint.AxisXLabel = getDataList[i].party;

                    // Add dataPoint to DataPoints collection.
                    dataSeries.DataPoints.Add(dataPoint);
                }

                // Add dataSeries to Series collection.
                   chart.Series.Add(dataSeries);

                // Add chart to LayoutRoot
                LayoutRoot.Children.Add(chart);
        }
开发者ID:jagan27101986,项目名称:WP7,代码行数:42,代码来源:Bubble3D1.xaml.cs

示例15: EarningByCategories

        public void EarningByCategories(string data)
        {
            var categories = Deserializes(data);
            var chart = new Chart {Width = 500, Height = 300, View3D = true};
            chart.Titles.Add(new Title {Text = "Thu nhập theo danh mục"});
            var dataSeries = new DataSeries {RenderAs = RenderAs.Doughnut};

            foreach (var category in categories)
            {
                var dataPoint = new DataPoint
                                    {
                                        YValue = category.Earnings,
                                        AxisXLabel = category.Name,
                                    };
                dataSeries.DataPoints.Add(dataPoint);
            }

            chart.Series.Add(dataSeries);
            LayoutRoot.Children.Clear();
            LayoutRoot.Children.Add(chart);
        }
开发者ID:preguntoncojonero,项目名称:mylifevn,代码行数:21,代码来源:Page.xaml.cs


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