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);

        }
Beispiel #2
0
        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();
            }
        }
 //柱状图
 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);
 }
        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();
        }
 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);
 }
Beispiel #6
0
        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);
            }
        }
Beispiel #7
0
 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);
     }
 }
Beispiel #8
0
 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;
 }
Beispiel #9
0
        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();
        }
Beispiel #10
0
        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();

        }
        public void ImportLineData(ArrayList values)
        {
            dsc = new DataSeriesCollection();
            DataSeries ds = new DataSeries();
            ds.RenderAs = RenderAs.Line;
            foreach (Object value in values)
            {
                DataPoint dp = new DataPoint();
                dp.YValue = (double)value;
                ds.DataPoints.Add(dp);
            }

            dsc.Add(ds);

        }
 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);
 }
Beispiel #13
0
        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();
        }
        /// <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);
        }
Beispiel #15
0
        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);
        }
Beispiel #16
0
        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);
        }
Beispiel #17
0
        /// <summary>
        /// Function to create a chart
        /// </summary>
        public void CreateChart()
        {
            // Create a new instance of Chart
            chart = new Chart();

            chart.Watermark = false;

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

            // Set DataSeries property
            dataSeries.RenderAs = RenderAs.Line;
            dataSeries.LineStyle = LineStyles.Solid;
            dataSeries.LineThickness = 3;
            dataSeries.LabelEnabled = false;

            // Create a DataPoint
            DataPoint dataPoint;

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

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

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

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

            // Attach a Loaded event to chart in order to attach a timer's Tick event
            chart.Loaded += new RoutedEventHandler(chart_Loaded);

            // Add chart to Chart Grid
            ChartGrid.Children.Add(chart);
        }
Beispiel #18
0
        public void DataSeriesColumnChecking()
        {
            Chart chart = new Chart();
            chart.Width = 500;
            chart.Height = 300;
            chart.View3D = true;

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

            Random rand = new Random();

            DataSeries dataSeries1 = new DataSeries();
            dataSeries1.RenderAs = RenderAs.Column;

            Int32 numberOfDataPoints = 0;
            Common.AssertAverageDuration(300, 1,
                delegate
                {
                    for (Int32 i = 0; i < 100; i++)
                    {
                        DataPoint dataPoint = new DataPoint();
                        dataPoint.XValue = i + 1;
                        dataPoint.YValue = rand.Next(-500, 500);
                        dataSeries1.DataPoints.Add(dataPoint);
                        numberOfDataPoints++;
                    }
                    chart.Series.Add(dataSeries1);
                });

            Window window = new Window();
            window.Content = chart;
            window.Show();
            if (_isLoaded)
            {
                window.Dispatcher.InvokeShutdown();
                window.Close();
            }
        }
Beispiel #19
0
        public void ExpenseByCategories(string data)
        {
            var categories = Deserializes(data);
            var chart = new Chart {Width = 500, Height = 300, View3D = true};
            chart.Titles.Add(new Title {Text = "Chi tiêu theo danh mục"});
            var dataSeries = new DataSeries {RenderAs = RenderAs.Doughnut};

            foreach (var category in categories)
            {
                var dataPoint = new DataPoint
                {
                    YValue = Math.Abs(category.Expenses),
                    AxisXLabel = category.Name,
                    //Color = BuildBrush(category.ColorHex)
                };
                dataSeries.DataPoints.Add(dataPoint);
            }

            chart.Series.Add(dataSeries);
            LayoutRoot.Children.Clear();
            LayoutRoot.Children.Add(chart);
        }
Beispiel #20
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.UserControl = ((Apollo.TrafficRateBullet)(target));
                return;

            case 2:
                this.LayoutRoot = ((System.Windows.Controls.Grid)(target));
                return;

            case 3:
                this.myTrendlineLabel = ((Visifire.Charts.TrendLine)(target));
                return;

            case 4:
                this.myBulletValue = ((Visifire.Charts.DataPoint)(target));
                return;
            }
            this._contentLoaded = true;
        }
        void NetSyn_Mydata(DataStruct msg)
        {
            //int packagenumber = msg.trafficRate;//*******************

            if (msg.cpudet == 1)
                trafficRate_odd = msg.trafficRate;
            else
                trafficRate_even = msg.trafficRate;

            packagenumber = trafficRate_even + trafficRate_odd;

            double rate = packagenumber * 448.0 * 8.0 * 1000000.0 / 7 / 600.0 / 1024 / 1024 / 1024;//该公式待修改。**************************
            currentRate.Content = ((int)(rate*1000))/1000.0;//待修改~~等待数据过来完全无问题后可用于直接显示吞吐量。
			CurRate.Text = "The Last One Minute Throughput (一分钟内的吞吐量)       Cur(当前速率):" + ((int)(rate*1000))/1000.0 + "Gbps";
            DataPoint dataPoint = new DataPoint();
            dataPoint.YValue = rate;
            Realtime.DataPoints.Add(dataPoint);
            while (Realtime.DataPoints.Count > numbertoshow)
            {
                Realtime.DataPoints.Remove(Realtime.DataPoints[0]);
            }
        }
Beispiel #22
0
        /// <summary>
        /// Create DataSeries
        /// </summary>
        /// <returns></returns>
        private DataSeries CreateDataSeries()
        {
            Random rand = new Random();

            DataSeries dataSeries = new DataSeries();
            dataSeries.RenderAs = RenderAs.Column;

            for (Int32 i = 0; i < 10; i++)
            {
                DataPoint dataPoint = new DataPoint();
                dataPoint.AxisXLabel = "Label" + i;
                dataPoint.XValue = i + 1;
                dataPoint.YValue = rand.Next(-100, 100);
                dataSeries.DataPoints.Add(dataPoint);
            }
            return dataSeries;
        }
Beispiel #23
0
        public void AreaDataSeriesStressTest()
        {
            System.Windows.Browser.HtmlPage.Plugin.SetStyleAttribute("height", "400px");

            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);

            TestPanel.Children.Add(chart);

            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(200, 2, delegate
            {
                dataSeries = new DataSeries();
                dataSeries.RenderAs = RenderAs.Area;

                for (Int32 i = 0; i < 500; 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);
            });

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

            EnqueueCallback(() =>
            {
                DateTime end = DateTime.UtcNow;
                totalDuration = (end - start).TotalSeconds;
            });

            EnqueueCallback(() =>
            {
                _htmlElement1 = Common.GetDisplayMessageButton(_htmlElement1);
                _htmlElement1.SetStyleAttribute("width", "900px");
                _htmlElement1.SetProperty("value", dataSeries.RenderAs + " chart with " + numberOfSeries + " DataSeries having " + numberofDataPoint + " DataPoints. Total Chart Loading Time: " + totalDuration + "s. Number of Render Count: " + chart.ChartArea._renderCount);
                _htmlElement2 = Common.GetDisplayMessageButton(_htmlElement2);
                _htmlElement2.SetStyleAttribute("top", "540px");
                _htmlElement2.SetProperty("value", "Total Calculation: " + msg + " Click here to exit.");
                System.Windows.Browser.HtmlPage.Document.Body.AppendChild(_htmlElement1);
                System.Windows.Browser.HtmlPage.Document.Body.AppendChild(_htmlElement2);
            });

            EnqueueDelay(_sleepTime);
            EnqueueCallback(() =>
            {
                _htmlElement2.AttachEvent("onclick", new EventHandler<System.Windows.Browser.HtmlEventArgs>(this.HtmlElement_OnClick));
            });
        }
Beispiel #24
0
        public void PieStressChecking()
        {
            System.Windows.Browser.HtmlPage.Plugin.SetStyleAttribute("height", "400px");

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

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

            TestPanel.Children.Add(chart);

            Random rand = new Random();

            DataSeries dataSeries = new DataSeries();
            dataSeries.RenderAs = RenderAs.Pie;
            dataSeries.ShowInLegend = false;

            Int32 numberOfDataPoints = 0;
            Double totalDuration = 0;
            DateTime start = DateTime.UtcNow;
            String msg = Common.AssertAverageDuration(200, 1,
                delegate
                {
                    for (Int32 i = 0; i < 500; i++)
                    {
                        DataPoint dataPoint = new DataPoint();
                        dataPoint.XValue = i + 1;
                        dataPoint.YValue = rand.Next(-500, 500);
                        dataPoint.Exploded = true;
                        dataSeries.DataPoints.Add(dataPoint);
                        numberOfDataPoints++;
                    }
                    chart.Series.Add(dataSeries);
                });

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

            EnqueueCallback(() =>
            {
                DateTime end = DateTime.UtcNow;
                totalDuration = (end - start).TotalSeconds;
            });

            EnqueueCallback(() =>
            {
                _htmlElement1 = Common.GetDisplayMessageButton(_htmlElement1);
                _htmlElement1.SetStyleAttribute("width", "900px");
                _htmlElement1.SetProperty("value", dataSeries.RenderAs + " chart with " + numberOfDataPoints + " DataPoints. Total Chart Loading Time: " + totalDuration + "s. Number of Render Count: " + chart.ChartArea._renderCount);
                _htmlElement2 = Common.GetDisplayMessageButton(_htmlElement2);
                _htmlElement2.SetStyleAttribute("top", "540px");
                _htmlElement2.SetProperty("value", "Total Series Calculation: " + msg + " Click here to exit");
                System.Windows.Browser.HtmlPage.Document.Body.AppendChild(_htmlElement1);
                System.Windows.Browser.HtmlPage.Document.Body.AppendChild(_htmlElement2);
            });

            EnqueueCallback(() =>
            {
                _htmlElement2.AttachEvent("onclick", new EventHandler<System.Windows.Browser.HtmlEventArgs>(this.HtmlElement_OnClick));
            });
        }
Beispiel #25
0
        public void TestDataPointsCollectionChanged()
        {
            Chart chart = new Chart();
            chart.Width = 600;
            chart.Height = 300;


            Int32 dataPointsAdded = 0;

            chart.Loaded += new System.Windows.RoutedEventHandler(chart_Loaded);

            TestPanel.Children.Add(chart);

            DataSeries dataSeries = new DataSeries();

            Random rand = new Random();

            for (Int32 i = 0; i < 10; i++)
            {
                DataPoint dataPoint = new DataPoint();
                dataPoint.AxisXLabel = "Label" + i;
                dataPoint.XValue = i + 1;
                dataPoint.YValue = rand.Next(-100, 100);
                dataSeries.DataPoints.Add(dataPoint);
            }

            chart.Series.Add(dataSeries);

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

            dataSeries.DataPoints.CollectionChanged += (object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
                =>
            {
                if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add)
                {
                    dataPointsAdded += e.NewItems.Count;
                    Assert.AreEqual(1, e.NewItems.Count);
                }
            };

            EnqueueCallback(() =>
            {
                DataPoint dataPoint = new DataPoint();
                dataPoint.AxisXLabel = "Label";
                dataPoint.YValue = rand.Next(-100, 100);
                dataSeries.DataPoints.Add(dataPoint);
            }
            );

            EnqueueCallback(() =>
            {
                Assert.AreEqual(1, dataPointsAdded);
            });

            EnqueueDelay(_sleepTime);
            EnqueueTestComplete();
        }
Beispiel #26
0
        public void TestingMovingMarkerInLineOnSomeDataseries()
        {
            System.Windows.Browser.HtmlPage.Plugin.SetStyleAttribute("height", "400px");

            _chart = new Chart();
            _chart.Width = 500;
            _chart.Height = 300;

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

            TestPanel.Children.Add(_chart);

            Random rand = new Random();

            for (Int32 j = 0; j < 5; j++)
            {
                DataSeries dataSeries = new DataSeries();
                dataSeries.RenderAs = RenderAs.Line;
                if (j < 4)
                    dataSeries.MovingMarkerEnabled = true;

                for (Int32 i = 0; i < 6; i++)
                {
                    DataPoint dataPoint = new DataPoint();
                    dataPoint.YValue = rand.Next(100, 500);
                    dataSeries.DataPoints.Add(dataPoint);

                }
                _chart.Series.Add(dataSeries);
            }

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

            EnqueueCallback(() =>
            {
                _htmlElement1 = Common.GetDisplayMessageButton(_htmlElement1);
                _htmlElement1.SetStyleAttribute("width", "900px");
                _htmlElement1.SetProperty("value", "Move mouse on PlotArea.");
                _htmlElement2 = Common.GetDisplayMessageButton(_htmlElement2);
                _htmlElement2.SetStyleAttribute("top", "540px");
                _htmlElement2.SetProperty("value", "Click here to exit.");
                System.Windows.Browser.HtmlPage.Document.Body.AppendChild(_htmlElement1);
                System.Windows.Browser.HtmlPage.Document.Body.AppendChild(_htmlElement2);
            });

            EnqueueCallback(() =>
            {
                _htmlElement2.AttachEvent("onclick", new EventHandler<System.Windows.Browser.HtmlEventArgs>(this.Exit_OnClick));
            });

        }
Beispiel #27
0
        public void ExplodedPieChecking()
        {
            System.Windows.Browser.HtmlPage.Plugin.SetStyleAttribute("height", "400px");

            _chart = new Chart();
            _chart.Width = 500;
            _chart.Height = 300;

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

            TestPanel.Children.Add(_chart);

            Random rand = new Random();

            DataSeries dataSeries = new DataSeries();
            dataSeries.RenderAs = RenderAs.Pie;

            for (Int32 i = 0; i < 20; i++)
            {
                DataPoint dataPoint = new DataPoint();
                dataPoint.YValue = rand.Next(100, 500);
                dataSeries.DataPoints.Add(dataPoint);

            }
            _chart.Series.Add(dataSeries);

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

            EnqueueCallback(() =>
            {
                _htmlElement1 = Common.GetDisplayMessageButton(_htmlElement1);
                _htmlElement1.SetStyleAttribute("width", "900px");
                _htmlElement1.SetProperty("value", "Click here to View3D(true/false).");
                _htmlElement2 = Common.GetDisplayMessageButton(_htmlElement2);
                _htmlElement2.SetStyleAttribute("top", "540px");
                _htmlElement2.SetProperty("value", "Switch Pie/Doughnut.");
                _htmlElement3 = Common.GetDisplayMessageButton(_htmlElement3);
                _htmlElement3.SetStyleAttribute("top", "560px");
                _htmlElement3.SetProperty("value", "Number of Render Count: " + _chart.ChartArea._renderCount + ". Click here to exit.");
                System.Windows.Browser.HtmlPage.Document.Body.AppendChild(_htmlElement1);
                System.Windows.Browser.HtmlPage.Document.Body.AppendChild(_htmlElement2);
                System.Windows.Browser.HtmlPage.Document.Body.AppendChild(_htmlElement3);
            });

            EnqueueCallback(() =>
            {
                _htmlElement1.AttachEvent("onclick", new EventHandler<System.Windows.Browser.HtmlEventArgs>(this.View3D_OnClick));
            });

            EnqueueCallback(() =>
            {
                _htmlElement2.AttachEvent("onclick", new EventHandler<System.Windows.Browser.HtmlEventArgs>(this.SwitchDataSeries_OnClick));
            });

            EnqueueCallback(() =>
            {
                _htmlElement3.AttachEvent("onclick", new EventHandler<System.Windows.Browser.HtmlEventArgs>(this.Exit_OnClick));
            });

        }
Beispiel #28
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.buttonDig = ((System.Windows.Controls.Button)(target));

            #line 31 "..\..\KeyDig.xaml"
                this.buttonDig.Click += new System.Windows.RoutedEventHandler(this.btDig);

            #line default
            #line hidden
                return;

            case 2:
                this.buttonExport = ((System.Windows.Controls.Button)(target));

            #line 32 "..\..\KeyDig.xaml"
                this.buttonExport.Click += new System.Windows.RoutedEventHandler(this.btExport);

            #line default
            #line hidden
                return;

            case 3:
                this.sliderGrade = ((System.Windows.Controls.Slider)(target));
                return;

            case 4:
                this.IncludeKey = ((Xceed.Wpf.Toolkit.WatermarkTextBox)(target));
                return;

            case 5:
                this.cbBaidu = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 6:
                this.cb360 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 7:
                this.cbSogou = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 8:
                this.pbQuery = ((System.Windows.Controls.ProgressBar)(target));
                return;

            case 9:
                this.txtQueryKey = ((Xceed.Wpf.Toolkit.WatermarkTextBox)(target));
                return;

            case 10:
                this.lbDigKey = ((System.Windows.Controls.ListView)(target));

            #line 71 "..\..\KeyDig.xaml"
                this.lbDigKey.AddHandler(System.Windows.Controls.Primitives.ButtonBase.ClickEvent, new System.Windows.RoutedEventHandler(this.GridViewColumnHeader_Click));

            #line default
            #line hidden
                return;

            case 11:
                this.gvKey = ((System.Windows.Controls.GridView)(target));
                return;

            case 12:
                this.MyChart = ((Visifire.Charts.Chart)(target));
                return;

            case 13:
                this.ChartTitle = ((Visifire.Charts.Title)(target));
                return;

            case 14:
                this.dataSeries = ((Visifire.Charts.DataSeries)(target));
                return;

            case 15:
                this.Baidu = ((Visifire.Charts.DataPoint)(target));
                return;

            case 16:
                this.So = ((Visifire.Charts.DataPoint)(target));
                return;

            case 17:
                this.Sogou = ((Visifire.Charts.DataPoint)(target));
                return;
            }
            this._contentLoaded = true;
        }
Beispiel #29
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.Tab = ((System.Windows.Controls.TabControl)(target));
                return;

            case 2:
                this.txtQueryKey = ((System.Windows.Controls.TextBox)(target));
                return;

            case 3:
                this.cbCondition = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 4:

            #line 35 "..\..\ConditionQuery.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btClear);

            #line default
            #line hidden
                return;

            case 5:
                this.rbOneMode = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 6:
                this.rbTwoMode = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 7:
                this.rbThreeMode = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 8:
                this.Rand10 = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 9:
                this.Rand20 = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 10:
                this.Rand50 = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 11:
                this.Rand100 = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 12:
                this.RandCustom = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 13:
                this.iudCustomBDPages = ((Xceed.Wpf.Toolkit.IntegerUpDown)(target));

            #line 61 "..\..\ConditionQuery.xaml"
                this.iudCustomBDPages.GotFocus += new System.Windows.RoutedEventHandler(this.iudCustomBDPages_GotFocus);

            #line default
            #line hidden
                return;

            case 14:
                this.chkSimulation = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 15:

            #line 72 "..\..\ConditionQuery.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btDelDomain);

            #line default
            #line hidden
                return;

            case 16:
                this.chkBaidu = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 17:
                this.chk360 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 18:
                this.chkSogou = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 19:

            #line 85 "..\..\ConditionQuery.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Query);

            #line default
            #line hidden
                return;

            case 20:
                this.tbTotal = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 21:
                this.btReturn = ((System.Windows.Controls.Button)(target));

            #line 101 "..\..\ConditionQuery.xaml"
                this.btReturn.Click += new System.Windows.RoutedEventHandler(this.ReturnQuery);

            #line default
            #line hidden
                return;

            case 22:
                this.btAll = ((System.Windows.Controls.Button)(target));

            #line 109 "..\..\ConditionQuery.xaml"
                this.btAll.Click += new System.Windows.RoutedEventHandler(this.AllResult);

            #line default
            #line hidden
                return;

            case 23:
                this.btExport = ((System.Windows.Controls.Button)(target));

            #line 116 "..\..\ConditionQuery.xaml"
                this.btExport.Click += new System.Windows.RoutedEventHandler(this.ResultExport);

            #line default
            #line hidden
                return;

            case 24:
                this.NowKey = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 25:
                this.tvKey = ((System.Windows.Controls.ListBox)(target));

            #line 138 "..\..\ConditionQuery.xaml"
                this.tvKey.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.tvKey_SelectionChanged);

            #line default
            #line hidden
                return;

            case 26:
                this.dgQueryResult = ((System.Windows.Controls.DataGrid)(target));
                return;

            case 27:
                this.wbSimulation = ((System.Windows.Controls.WebBrowser)(target));

            #line 164 "..\..\ConditionQuery.xaml"
                this.wbSimulation.Navigated += new System.Windows.Navigation.NavigatedEventHandler(this.wbSimulation_Navigated);

            #line default
            #line hidden

            #line 164 "..\..\ConditionQuery.xaml"
                this.wbSimulation.LoadCompleted += new System.Windows.Navigation.LoadCompletedEventHandler(this.wbSimulation_LoadCompleted);

            #line default
            #line hidden
                return;

            case 28:
                this.MyChart = ((Visifire.Charts.Chart)(target));
                return;

            case 29:
                this.ChartTitle = ((Visifire.Charts.Title)(target));
                return;

            case 30:
                this.dataSeries = ((Visifire.Charts.DataSeries)(target));
                return;

            case 31:
                this.Paiming = ((Visifire.Charts.DataPoint)(target));
                return;

            case 32:
                this.noPaiming = ((Visifire.Charts.DataPoint)(target));
                return;

            case 33:
                this.pbQuery = ((System.Windows.Controls.ProgressBar)(target));
                return;
            }
            this._contentLoaded = true;
        }
Beispiel #30
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.Tab = ((System.Windows.Controls.TabControl)(target));
                return;

            case 2:
                this.txtQueryKey = ((System.Windows.Controls.TextBox)(target));
                return;

            case 3:
                this.cbCondition = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 4:

            #line 34 "..\..\LinksExtracted.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btClear);

            #line default
            #line hidden
                return;

            case 5:
                this.rbOneMode = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 6:
                this.rbTwoMode = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 7:
                this.Rand10 = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 8:
                this.Rand20 = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 9:
                this.Rand50 = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 10:
                this.Rand100 = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 11:

            #line 57 "..\..\LinksExtracted.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Query);

            #line default
            #line hidden
                return;

            case 12:
                this.tbTotal = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 13:
                this.tbInclude = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 14:
                this.tbIncludeRate = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 15:

            #line 76 "..\..\LinksExtracted.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.ReturnQuery);

            #line default
            #line hidden
                return;

            case 16:
                this.tvKey = ((System.Windows.Controls.ListBox)(target));

            #line 97 "..\..\LinksExtracted.xaml"
                this.tvKey.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.tvKey_SelectionChanged);

            #line default
            #line hidden
                return;

            case 17:
                this.dgQueryResult = ((System.Windows.Controls.DataGrid)(target));
                return;

            case 18:
                this.MyChart = ((Visifire.Charts.Chart)(target));
                return;

            case 19:
                this.ChartTitle = ((Visifire.Charts.Title)(target));
                return;

            case 20:
                this.dataSeries = ((Visifire.Charts.DataSeries)(target));
                return;

            case 21:
                this.Paiming = ((Visifire.Charts.DataPoint)(target));
                return;

            case 22:
                this.noPaiming = ((Visifire.Charts.DataPoint)(target));
                return;

            case 23:
                this.pbQuery = ((System.Windows.Controls.ProgressBar)(target));
                return;
            }
            this._contentLoaded = true;
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.Tab = ((System.Windows.Controls.TabControl)(target));
                return;

            case 2:
                this.txtQueryKey = ((System.Windows.Controls.TextBox)(target));
                return;

            case 3:
                this.cbCondition = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 4:

            #line 35 "..\..\CreativeCollection.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btClear);

            #line default
            #line hidden
                return;

            case 5:
                this.rbNameMode = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 6:
                this.rbDomainMode = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 7:
                this.chkLeftRank = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 8:
                this.chkRightRank = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 9:
                this.iudRefreshNum = ((Xceed.Wpf.Toolkit.IntegerUpDown)(target));
                return;

            case 10:

            #line 66 "..\..\CreativeCollection.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btDelDomain);

            #line default
            #line hidden
                return;

            case 11:
                this.chkBaidu = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 12:
                this.chk360 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 13:
                this.chkSogou = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 14:

            #line 79 "..\..\CreativeCollection.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Query);

            #line default
            #line hidden
                return;

            case 15:
                this.tbTotal = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 16:
                this.btReturn = ((System.Windows.Controls.Button)(target));

            #line 95 "..\..\CreativeCollection.xaml"
                this.btReturn.Click += new System.Windows.RoutedEventHandler(this.ReturnQuery);

            #line default
            #line hidden
                return;

            case 17:
                this.btAll = ((System.Windows.Controls.Button)(target));

            #line 103 "..\..\CreativeCollection.xaml"
                this.btAll.Click += new System.Windows.RoutedEventHandler(this.AllResult);

            #line default
            #line hidden
                return;

            case 18:
                this.btExport = ((System.Windows.Controls.Button)(target));

            #line 110 "..\..\CreativeCollection.xaml"
                this.btExport.Click += new System.Windows.RoutedEventHandler(this.ResultExport);

            #line default
            #line hidden
                return;

            case 19:
                this.NowKey = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 20:
                this.tvKey = ((System.Windows.Controls.ListBox)(target));

            #line 132 "..\..\CreativeCollection.xaml"
                this.tvKey.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.tvKey_SelectionChanged);

            #line default
            #line hidden
                return;

            case 21:
                this.dgQueryResult = ((System.Windows.Controls.DataGrid)(target));
                return;

            case 22:
                this.MyChart = ((Visifire.Charts.Chart)(target));
                return;

            case 23:
                this.ChartTitle = ((Visifire.Charts.Title)(target));
                return;

            case 24:
                this.dataSeries = ((Visifire.Charts.DataSeries)(target));
                return;

            case 25:
                this.Paiming = ((Visifire.Charts.DataPoint)(target));
                return;

            case 26:
                this.noPaiming = ((Visifire.Charts.DataPoint)(target));
                return;

            case 27:
                this.pbQuery = ((System.Windows.Controls.ProgressBar)(target));
                return;
            }
            this._contentLoaded = true;
        }
Beispiel #32
0
        /// <summary>
        /// Create DataSeries with ZValue
        /// </summary>
        /// <returns></returns>
        private DataSeries CreateDataSeries2()
        {
            Random rand = new Random();

            DataSeries dataSeries = new DataSeries();

            for (Int32 i = 0; i < 10; i++)
            {
                DataPoint dataPoint = new DataPoint();
                dataPoint.AxisXLabel = "Label" + i;
                dataPoint.YValue = rand.Next(-100, 100);
                dataPoint.ZValue = rand.Next(100, 200);
                dataSeries.DataPoints.Add(dataPoint);
            }
            return dataSeries;
        }
Beispiel #33
0
        public void TestingMultipleSelectionInArea()
        {
            System.Windows.Browser.HtmlPage.Plugin.SetStyleAttribute("height", "400px");

            _chart = new Chart();
            _chart.Width = 500;
            _chart.Height = 300;
            _chart.View3D = true;

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

            TestPanel.Children.Add(_chart);

            Random rand = new Random();

            for (Int32 j = 0; j < 2; j++)
            {
                DataSeries dataSeries = new DataSeries();
                dataSeries.RenderAs = RenderAs.Area;
                dataSeries.MarkerEnabled = true;
                dataSeries.SelectionEnabled = true;
                dataSeries.SelectionMode = SelectionModes.Multiple;

                for (Int32 i = 0; i < 6; i++)
                {
                    DataPoint dataPoint = new DataPoint();
                    dataPoint.YValue = rand.Next(100, 500);
                    if (i == 0)
                        dataPoint.Selected = true;
                    dataSeries.DataPoints.Add(dataPoint);

                }
                _chart.Series.Add(dataSeries);
            }

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

            EnqueueCallback(() =>
            {
                _htmlElement1 = Common.GetDisplayMessageButton(_htmlElement1);
                _htmlElement1.SetStyleAttribute("width", "900px");
                _htmlElement1.SetProperty("value", "Click on DataPoints to select.");
                _htmlElement2 = Common.GetDisplayMessageButton(_htmlElement2);
                _htmlElement2.SetStyleAttribute("top", "540px");
                _htmlElement2.SetProperty("value", "Switch 2D/3D.");
                _htmlElement3 = Common.GetDisplayMessageButton(_htmlElement3);
                _htmlElement3.SetStyleAttribute("top", "560px");
                _htmlElement3.SetProperty("value", "Click here to exit.");
                System.Windows.Browser.HtmlPage.Document.Body.AppendChild(_htmlElement1);
                System.Windows.Browser.HtmlPage.Document.Body.AppendChild(_htmlElement2);
                System.Windows.Browser.HtmlPage.Document.Body.AppendChild(_htmlElement3);
            });

            EnqueueCallback(() =>
            {
                _htmlElement2.AttachEvent("onclick", new EventHandler<System.Windows.Browser.HtmlEventArgs>(this.View3D_OnClick));
            });

            EnqueueCallback(() =>
            {
                _htmlElement3.AttachEvent("onclick", new EventHandler<System.Windows.Browser.HtmlEventArgs>(this.Exit_OnClick));
            });

        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.UserControl = ((Apollo.TrafficRateDistribution)(target));
                return;

            case 2:
                this.LayoutRoot = ((System.Windows.Controls.Grid)(target));
                return;

            case 3:
                this.VisualStateGroup = ((System.Windows.VisualStateGroup)(target));
                return;

            case 4:
                this.GridOn = ((System.Windows.VisualState)(target));
                return;

            case 5:
                this.GridOff = ((System.Windows.VisualState)(target));
                return;

            case 6:
                this.grid1 = ((System.Windows.Controls.Grid)(target));
                return;

            case 7:
                this.lessthan2 = ((Visifire.Charts.DataPoint)(target));
                return;

            case 8:
                this.between24 = ((Visifire.Charts.DataPoint)(target));
                return;

            case 9:
                this.between46 = ((Visifire.Charts.DataPoint)(target));
                return;

            case 10:
                this.between68 = ((Visifire.Charts.DataPoint)(target));
                return;

            case 11:
                this.between89 = ((Visifire.Charts.DataPoint)(target));
                return;

            case 12:
                this.between910 = ((Visifire.Charts.DataPoint)(target));
                return;

            case 13:
                this.between1011 = ((Visifire.Charts.DataPoint)(target));
                return;

            case 14:
                this.morethan11 = ((Visifire.Charts.DataPoint)(target));
                return;

            case 15:
                this.grid = ((System.Windows.Controls.Grid)(target));
                return;

            case 16:
                this.numberOfPoints = ((System.Windows.Controls.Label)(target));
                return;
            }
            this._contentLoaded = true;
        }
Beispiel #35
0
        /// <summary>
        /// Metodo de graficación.
        /// </summary>
        /// <returns></returns>
        public Chart Draw(params string[] filtros)
        {
            // Create a new instance of Chart
            Chart chart = new Chart();

            chart.AnimationEnabled = true;
            // Create a new instance of Title
            Title title = new Title();
            // Set title property
            title.Text = "Efectividad MDZ";
            // 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.Line;
            #region configuracion eje X
            // Creating AxisX
            Axis axisX = new Axis();
            // Date time standard format
            axisX.ValueFormatString = "000000";
            // To avoid auto skip

            chart.AxesX.Add(axisX);
            #endregion
            // Create a DataPoint
            DataPoint dataPoint;
            #region consulta
            DataTable kpis;
            try
            {
                kpis = new DataTable();
                Consultas consulta = new Consultas();
                kpis = consulta.SelectKPI_EfectividadMDZ(filtros).Tables[0];
                consulta = null;
                string serAnt = "-5555";
                string ser = "-1111";
                foreach (DataRow g in kpis.Rows)
                {
                    Decimal? y = g["EfectivenessByBrand"]!=DBNull.Value?(Decimal?)g["EfectivenessByBrand"]:null;
                    long x = (long)g["TimeId"];
                    ser = (string)g["ProductSubfamilyDescription"];
                    //Creando las series
                    if (serAnt != ser)
                    {
                        if (serAnt != "-5555")
                        {
                            chart.Series.Add(dataSeries);
                        }
                        // Create a new instance of DataSeries
                        dataSeries = new DataSeries();
                        dataSeries.Name = ser;
                        // Set DataSeries property
                        dataSeries.RenderAs = RenderAs.Line;
                        dataSeries.MarkerType = Visifire.Commons.MarkerTypes.Circle;
                        dataSeries.SelectionEnabled = true;
                        dataSeries.LineThickness = 3;

                    }
                    // Create a new instance of DataPoint
                    dataPoint = new DataPoint();
                    // Set YValue for a DataPoint
                    if (x != null) dataPoint.AxisXLabel = x.ToString();
                    if (!ciclos.Contains(x.ToString()))  ciclos.Add(x.ToString());
                    dataPoint.YValue = System.Convert.ToDouble(y);
                    // Add dataPoint to DataPoints collection.
                    dataSeries.DataPoints.Add(dataPoint);
                    serAnt = ser;
                }
            }
            catch (Exception Error)
            {
                throw (new Exception(Error.ToString()));
            }
            #endregion
            // Add dataSeries to Series collection.
            chart.Series.Add(dataSeries);
            return chart;
        }
Beispiel #36
0
        public void MultiSeriesBarChartCheckingWithSecondaryAxis()
        {
            System.Windows.Browser.HtmlPage.Plugin.SetStyleAttribute("height", "500px");
            Chart chart = new Chart();
            chart.Width = 350;
            chart.Height = 500;
            chart.View3D = true;

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

            Int32 numberOfDataPoints = 0;

            Random rand = new Random();

            TestPanel.Children.Add(chart);

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

            EnqueueCallback(() =>
            {
                isDataSeriesAdded = false;
                DataSeries dataSeries1 = new DataSeries();
                dataSeries1.RenderAs = RenderAs.Bar;
                numberOfDataPoints = 0;
                for (Int32 i = 0; i < 20; i++)
                {
                    DataPoint dataPoint = new DataPoint();
                    dataPoint.XValue = i + 1;
                    dataPoint.YValue = rand.Next(100, 400);
                    dataSeries1.DataPoints.Add(dataPoint);
                    numberOfDataPoints++;
                }
                chart.Series.Add(dataSeries1);
                Assert.AreEqual(1, chart.Series.Count);
                isDataSeriesAdded = true;
                _htmlElement1.SetProperty("value", dataSeries1.RenderAs + " with " + numberOfDataPoints + " DataPoints. Number of Render Count: " + chart.ChartArea._renderCount);
            });

            EnqueueConditional(() => isDataSeriesAdded);
            EnqueueDelay(_sleepTime);

            EnqueueCallback(() =>
            {
                isDataSeriesAdded = false;
                DataSeries dataSeries2 = new DataSeries();
                dataSeries2.RenderAs = RenderAs.StackedBar;
                numberOfDataPoints = 0;
                for (Int32 i = 0; i < 20; i++)
                {
                    DataPoint dataPoint = new DataPoint();
                    dataPoint.XValue = i + 1;
                    dataPoint.YValue = rand.Next(100, 300);
                    dataSeries2.DataPoints.Add(dataPoint);
                    numberOfDataPoints++;
                }
                chart.Series.Add(dataSeries2);
                Assert.AreEqual(2, chart.Series.Count);
                isDataSeriesAdded = true;
                _htmlElement1.SetProperty("value", dataSeries2.RenderAs + " with " + numberOfDataPoints + " DataPoints. Number of Render Count: " + chart.ChartArea._renderCount);
            });

            EnqueueConditional(() => isDataSeriesAdded);
            EnqueueDelay(_sleepTime);

            EnqueueCallback(() =>
            {
                isDataSeriesAdded = false;
                DataSeries dataSeries3 = new DataSeries();
                dataSeries3.RenderAs = RenderAs.StackedBar100;
                dataSeries3.AxisYType = AxisTypes.Secondary;
                numberOfDataPoints = 0;
                for (Int32 i = 0; i < 20; i++)
                {
                    DataPoint dataPoint = new DataPoint();
                    dataPoint.XValue = i + 1;
                    dataPoint.YValue = rand.Next(0, 500);
                    dataSeries3.DataPoints.Add(dataPoint);
                    numberOfDataPoints++;
                }
                chart.Series.Add(dataSeries3);
                Assert.AreEqual(3, chart.Series.Count);
                isDataSeriesAdded = true;
                _htmlElement1.SetProperty("value", dataSeries3.RenderAs + " with " + numberOfDataPoints + " DataPoints. Number of Render Count: " + chart.ChartArea._renderCount);
            });

            EnqueueConditional(() => isDataSeriesAdded);
            EnqueueDelay(_sleepTime);

            EnqueueCallback(() =>
            {
                isDataSeriesAdded = false;
                DataSeries dataSeries4 = new DataSeries();
                dataSeries4.RenderAs = RenderAs.StackedBar;
                dataSeries4.AxisYType = AxisTypes.Secondary;
                numberOfDataPoints = 0;
                for (Int32 i = 0; i < 20; i++)
                {
                    DataPoint dataPoint = new DataPoint();
                    dataPoint.XValue = i + 1;
                    dataPoint.YValue = rand.Next(50, 350);
                    dataSeries4.DataPoints.Add(dataPoint);
                    numberOfDataPoints++;
                }
                chart.Series.Add(dataSeries4);
                Assert.AreEqual(4, chart.Series.Count);
                isDataSeriesAdded = true;
                _htmlElement1.SetProperty("value", dataSeries4.RenderAs + " with " + numberOfDataPoints + " DataPoints. Number of Render Count: " + chart.ChartArea._renderCount);
            });

            EnqueueConditional(() => isDataSeriesAdded);
            EnqueueDelay(_sleepTime);

            EnqueueCallback(() =>
            {
                isDataSeriesAdded = false;
                DataSeries dataSeries5 = new DataSeries();
                dataSeries5.RenderAs = RenderAs.StackedBar;
                dataSeries5.AxisYType = AxisTypes.Secondary;
                numberOfDataPoints = 0;
                for (Int32 i = 0; i < 20; i++)
                {
                    DataPoint dataPoint = new DataPoint();
                    dataPoint.XValue = i + 1;
                    dataPoint.YValue = rand.Next(50, 350);
                    dataSeries5.DataPoints.Add(dataPoint);
                    numberOfDataPoints++;
                }
                chart.Series.Add(dataSeries5);
                Assert.AreEqual(5, chart.Series.Count);
                isDataSeriesAdded = true;
                _htmlElement1.SetProperty("value", dataSeries5.RenderAs + " with " + numberOfDataPoints + " DataPoints. Number of Render Count: " + chart.ChartArea._renderCount);
            });

            EnqueueConditional(() => isDataSeriesAdded);
            EnqueueDelay(_sleepTime);

            EnqueueCallback(() =>
            {
                isDataSeriesAdded = false;
                DataSeries dataSeries6 = new DataSeries();
                dataSeries6.RenderAs = RenderAs.StackedBar;
                numberOfDataPoints = 0;
                for (Int32 i = 0; i < 20; i++)
                {
                    DataPoint dataPoint = new DataPoint();
                    dataPoint.XValue = i + 1;
                    dataPoint.YValue = rand.Next(50, 350);
                    dataSeries6.DataPoints.Add(dataPoint);
                    numberOfDataPoints++;
                }
                chart.Series.Add(dataSeries6);
                Assert.AreEqual(6, chart.Series.Count);
                isDataSeriesAdded = true;
                _htmlElement1.SetProperty("value", dataSeries6.RenderAs + " with " + numberOfDataPoints + " DataPoints. Number of Render Count: " + chart.ChartArea._renderCount);
            });

            EnqueueConditional(() => isDataSeriesAdded);
            EnqueueDelay(_sleepTime);

            EnqueueCallback(() =>
            {
                isDataSeriesAdded = false;
                DataSeries dataSeries7 = new DataSeries();
                dataSeries7.RenderAs = RenderAs.Bar;
                dataSeries7.AxisYType = AxisTypes.Secondary;
                numberOfDataPoints = 0;
                for (Int32 i = 0; i < 20; i++)
                {
                    DataPoint dataPoint = new DataPoint();
                    dataPoint.XValue = i + 1;
                    dataPoint.YValue = rand.Next(0, 250);
                    dataSeries7.DataPoints.Add(dataPoint);
                    numberOfDataPoints++;
                }
                chart.Series.Add(dataSeries7);
                Assert.AreEqual(7, chart.Series.Count);
                isDataSeriesAdded = true;
                _htmlElement1.SetProperty("value", dataSeries7.RenderAs + " with " + numberOfDataPoints + " DataPoints. Number of Render Count: " + chart.ChartArea._renderCount);
            });

            EnqueueConditional(() => isDataSeriesAdded);
            isDataSeriesAdded = false;
            EnqueueDelay(_sleepTime);

            EnqueueCallback(() =>
            {
                EnqueueTestComplete();
            });

            _htmlElement1 = Common.GetDisplayMessageButton(_htmlElement1);
            _htmlElement1.SetStyleAttribute("width", "900px");
            System.Windows.Browser.HtmlPage.Document.Body.AppendChild(_htmlElement1);
        }