• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Charts.Axis类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: SolidColorBrush

        SolidColorBrush twoSDBrush = new SolidColorBrush(Color.FromArgb(50,3, 3, 247)); //平均曲线颜色,红色

        #endregion Fields

        #region Constructors

        public PageAvgCurve()
        {
            InitializeComponent();

            chart1 = new Chart();
            chart2 = new Chart();
            chart2.ScrollingEnabled = chart1.ScrollingEnabled = false;
            chart1.BorderThickness = chart2.BorderThickness = new Thickness(0, 0, 0, 0);

            Axis yOACAxis = new Axis();
            Axis yEACAxis = new Axis();
            yOACAxis.Suffix = yEACAxis.Suffix = "(Nm)";
            chart1.AxesY.Add(yOACAxis);
            chart2.AxesY.Add(yEACAxis);

            Axis xAxisOAC = new Axis();
            Axis xAxisEAC = new Axis();
            xAxisEAC.AxisMinimum = xAxisOAC.AxisMinimum = 0;
            xAxisOAC.AxisMaximum = xAxisEAC.AxisMaximum = 100;
            xAxisEAC.Suffix = xAxisOAC.Suffix = "%";
            chart1.AxesX.Add(xAxisOAC);
            chart2.AxesX.Add(xAxisEAC);

            grid1.Children.Add(chart1);
            grid2.Children.Add(chart2);
        }
开发者ID:dewade2003,项目名称:DSJL,代码行数:32,代码来源:PageAvgCurve.xaml.cs


示例2: CreateChart

        public Chart CreateChart(ChartInformation ci)
        {
            Chart m_chart = new Chart();
            m_chart.BorderThickness = ci.m_BorderThickness;
            m_chart.Theme = ci.m_Theme;
            m_chart.View3D = ci.m_View3D;

            Axis m_axisX = new Axis();
            m_axisX.Title = ci.m_axisXTitle;
            m_chart.AxesX.Add(m_axisX);

            Axis m_asixY = new Axis();
            m_asixY.Title = ci.m_axisYTitle;
            m_asixY.Enabled = true;
            m_asixY.StartFromZero = true;
            m_asixY.AxisType = AxisTypes.Primary;
            m_asixY.AxisMaximum = ci.m_axisYMaximum;
            m_asixY.Interval = ci.m_axisYInterval;
            m_chart.AxesY.Add(m_asixY);
            for(int i = 0;i<ci.dsc.Count;i++)
            {
                DataSeries ds = new DataSeries();
                ds.LegendText = ci.dsc[i].LegendText;
                ds.RenderAs = ci.dsc[i].RenderAs;
                ds.AxisYType = ci.dsc[i].AxisYType;
                ds.DataPoints = new DataPointCollection(ci.dsc[i].DataPoints);
                m_chart.Series.Add(ds);
            }
            m_chart.Rendered+=new EventHandler(chart_Rendered);
            return m_chart;
        }
开发者ID:dalinhuang,项目名称:presidentproject,代码行数:31,代码来源:ChartHelper.cs


示例3: LineThicknessDefaultValue

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

            Common.CreateAndAddDefaultDataSeries(chart);
            ChartGrid grid = new ChartGrid();
            Axis axis = new Axis();
            axis.Grids.Add(grid);
            chart.AxesY.Add(axis);
            
            _isLoaded = false;
            chart.Loaded += new RoutedEventHandler(chart_Loaded);

            Window window = new Window();
            window.Content = chart;
            window.Show();
            if (_isLoaded)
            {
                Assert.AreEqual(0.25, grid.LineThickness);
            }

            window.Dispatcher.InvokeShutdown();
            window.Close();
        }
开发者ID:tdhieu,项目名称:openvss,代码行数:26,代码来源:ChartGridTest.cs


示例4: Refresh

        public void Refresh(object sender)
        {
            Layout.Children.Clear();
            MultiChartControl.MultiChart MyChart = new MultiChartControl.MultiChart();
            DashBoardGraphViewModel vm = (DashBoardGraphViewModel)sender;
            MyChart.Series.Clear();

            for (int i = 0; i < vm.Datos.Count; i++)
            {
                MyChart.Series.Add(c.GetSerie(DashBoardGraph)[i]);
            }
            MyChart.Style = (Style)FindResource("ChartStyle");
            Axis a = new Axis();
            a.ValueFormatString = "0%";
            MyChart.AxesY.Add(a);
            Layout.Children.Add(MyChart);
            lblAnio.Content = AnioMesView.SelectedAnio.Anio;
            lblMes.Content = AnioMesView.SelectedMes.MesName;
            try
            {
                lblDireccion.Text = DashBoradTable.SelectedItem.Organigrama.JerarquiaName;
            }
            catch (Exception)
            {
                lblDireccion.Text = "OCAVM";
            }
        }
开发者ID:ZERUELX,项目名称:GestionDocumental20140711,代码行数:27,代码来源:DashBoardGraphView.xaml.cs


示例5: CheckDefaultLineThickness

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

            Common.CreateAndAddDefaultDataSeries(chart);
            Ticks tick = new Ticks();
            Axis axis = new Axis();
            axis.Ticks.Add(tick);
            chart.AxesX.Add(axis);
              
            _isLoaded = false;
            chart.Loaded += new RoutedEventHandler(chart_Loaded);

            Window window = new Window();
            window.Content = chart;
            window.Show();
            if (_isLoaded)
            {
                Assert.AreEqual(0.5, tick.LineThickness);
            }

            window.Dispatcher.InvokeShutdown();
            window.Close();
        }
开发者ID:tdhieu,项目名称:openvss,代码行数:26,代码来源:MajorTicksTest.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: PlotGroup

        /// <summary>
        /// Initializes a new instance of the Visifire.Charts.PlotGroup class.
        /// </summary>
        /// <param name="renderAs">RenderAs</param>
        /// <param name="axisX">axisX</param>
        /// <param name="axisY">AxisY</param>
        public PlotGroup(RenderAs renderAs, Axis axisX, Axis axisY)
        {
            DataSeriesList = new List<DataSeries>();
            
            XWiseStackedDataList = new Dictionary<Double, XWiseStackedData>();

            RenderAs = renderAs;
            AxisX = axisX;
            AxisY = axisY;
        }
开发者ID:tdhieu,项目名称:openvss,代码行数:16,代码来源:PlotGroup.cs


示例8: DataPointDecimalXValueChecking

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

            Axis axisX = new Axis();
            axisX.Interval = 1;
            chart.AxesX.Add(axisX);
                   
            _isLoaded = false;
            chart.Loaded += new RoutedEventHandler(chart_Loaded);

            Random rand = new Random();

            DataSeries dataSeries1 = new DataSeries();

            List<Double> xList = new List<Double>();
            List<Double> yList = new List<Double>();
            Double y = 0;
            for (Double i = 0; i < 10; i++)
            {
                DataPoint dataPoint = new DataPoint();
                dataPoint.XValue = i + 1;
                xList.Add(i);
                dataPoint.YValue = (y = rand.Next(-100, 100));
                yList.Add(y);
                dataSeries1.DataPoints.Add(dataPoint);
            }

            chart.Series.Add(dataSeries1);

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

            Double j = 0.5;
            for (Int32 i = 0; i < 10; i++)
            {
                DataPoint dataPoint = new DataPoint();
                dataPoint.XValue = j;
                dataPoint.YValue = yList[i];
                dataSeries2.DataPoints.Add(dataPoint);
                j++;
            }
            chart.Series.Add(dataSeries2);
             
            Window window = new Window();
            window.Content = chart;
            window.Show();
            if (_isLoaded)
            {
                window.Dispatcher.InvokeShutdown();
                window.Close();
            }
        }
开发者ID:zhangzy0193,项目名称:visifire,代码行数:55,代码来源:DataPointTest.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: WindowMain

 /// <summary>
 /// Show form
 /// </summary>
 public WindowMain()
 {
     InitializeComponent();
     // Create Y axis
     Axis yAxis = new Axis();
     yAxis.AxisMaximum = 1;
     yAxis.Title = "Probability";
     chart.AxesY.Add(yAxis);
     // Create X axis
     Axis xAxis = new Axis();
     //xAxis.AxisMaximum = 100;
     xAxis.Title = "% (percent)";
     chart.AxesX.Add(xAxis);
 }
开发者ID:sergey-podolsky,项目名称:university,代码行数:17,代码来源:WindowMain.xaml.cs


示例11: TestAxisDecimalIntervalWithAxisXLabel

        public void TestAxisDecimalIntervalWithAxisXLabel()
        {
            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();
            dataSeries.RenderAs = RenderAs.Column;
            for (Int32 i = 0; i < 10; i++)
                dataSeries.DataPoints.Add(new DataPoint() { AxisXLabel = "Visifire", YValue = rand.Next(10, 100) });
            chart.Series.Add(dataSeries);

            EnqueueCallback(() =>
            {
                Axis axis = new Axis();
                axis.Interval = 0.1;
                chart.AxesX.Add(axis);
            });

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


示例12: TextWrapNewValue

        public void TextWrapNewValue()
        {
            Chart chart = new Chart();
            chart.Width = 400;
            chart.Height = 300;

            _axisX = new Axis();

            _axisX.AxisLabels = new AxisLabels();

            _axisX.AxisLabels.TextWrap = 0.5;
            _axisX.AxisLabels.Angle = 0;
            _axisX.Interval = 1;
            _axisX.AxisLabels.Rows = 1;
            chart.AxesX.Add(_axisX);

            DataSeries dataSeries = new DataSeries();

            dataSeries.RenderAs = RenderAs.Column;

            Random rand = new Random();

            for (Int32 i = 0; i < 5; i++)
            {
                DataPoint datapoint = new DataPoint();
                datapoint.AxisXLabel = "VisifireSilverlight" + i;
                datapoint.YValue = rand.Next(0, 100);
                datapoint.XValue = i + 1;
                dataSeries.DataPoints.Add(datapoint);
            }

            chart.Series.Add(dataSeries);

            CreateAsyncTest(chart,
                () => Assert.AreEqual(0.5, _axisX.AxisLabels.TextWrap, Common.HighPrecisionDelta));

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


示例13: CheckAxisLabelsAutoPlacement2

        public void CheckAxisLabelsAutoPlacement2()
        {
            System.Windows.Browser.HtmlPage.Plugin.SetStyleAttribute("height", "400px");

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

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

            TestPanel.Children.Add(chart);

            Axis axisX = new Axis();
            axisX.AxisLabels = new AxisLabels();
            axisX.AxisLabels.FontColor = new SolidColorBrush(Colors.Red);
            chart.AxesX.Add(axisX);

            DataSeries dataSeries = new DataSeries();
            dataSeries.RenderAs = RenderAs.Line;
            
            Random rand = new Random();

            Int32 numberOfDataPoint = 0;
            Double totalDuration = 0;
            DateTime start = DateTime.UtcNow;
            String msg = Common.AssertAverageDuration(80, 1, delegate
            {
                for (Int32 i = 0; i < 500; i++)
                {
                    DataPoint datapoint = new DataPoint();
                    datapoint.AxisXLabel = "Visifire Label" + i;
                    datapoint.YValue = rand.Next(0, 100);
                    dataSeries.DataPoints.Add(datapoint);
                    numberOfDataPoint++;
                }

                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", numberOfDataPoint + " AxisLabels are added. Click here to exit.");
                _htmlElement2 = Common.GetDisplayMessageButton(_htmlElement2);
                _htmlElement2.SetStyleAttribute("top", "540px");
                _htmlElement2.SetProperty("value", msg + " Total Chart Loading Time: " + totalDuration + "s");
                System.Windows.Browser.HtmlPage.Document.Body.AppendChild(_htmlElement1);
                System.Windows.Browser.HtmlPage.Document.Body.AppendChild(_htmlElement2);
            });

            EnqueueCallback(() =>
            {
                _htmlElement1.AttachEvent("onclick", new EventHandler<System.Windows.Browser.HtmlEventArgs>(this.HtmlElement_OnClick));
            });
        }
开发者ID:zhangzy0193,项目名称:visifire,代码行数:67,代码来源:AxisLabelsTest.cs


示例14: FontWeightNewValue

        public void FontWeightNewValue()
        {
            Chart chart = new Chart();
            chart.Width = 400;
            chart.Height = 300;

            _axisX = new Axis();
            _axisY = new Axis();

            _axisX.AxisLabels = new AxisLabels();
            _axisY.AxisLabels = new AxisLabels();

            _axisX.AxisLabels.FontWeight = FontWeights.Bold;
            _axisY.AxisLabels.FontWeight = FontWeights.Bold;

            chart.AxesX.Add(_axisX);
            chart.AxesY.Add(_axisY);

            Common.CreateAndAddDefaultDataSeries(chart);
            EnqueueDelay(_sleepTime);

            CreateAsyncTask(chart,
                () => Assert.AreEqual(FontWeights.Bold, _axisX.AxisLabels.FontWeight),
                () => Assert.AreEqual(FontWeights.Bold, _axisY.AxisLabels.FontWeight));

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


示例15: RowsNewValue

        public void RowsNewValue()
        {
            Chart chart = new Chart();
            chart.Width = 400;
            chart.Height = 300;

            _axisX = new Axis();

            _axisX.AxisLabels = new AxisLabels();

            _axisX.AxisLabels.Rows = 2;
            chart.AxesX.Add(_axisX);

            Common.CreateAndAddDefaultDataSeries(chart);
            EnqueueDelay(_sleepTime);

            CreateAsyncTest(chart,
                () => Assert.AreEqual(2, _axisX.AxisLabels.Rows));

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


示例16: DataPointRandomXValuesChecking

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

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

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

            Random rand = new Random();

            DataSeries dataSeries1 = new DataSeries();

            for (Int32 i = 0; i < 5; i++)
            {
                DataPoint dataPoint = new DataPoint();
                dataPoint.XValue = rand.Next(1, 10);
                dataPoint.YValue = rand.Next(-500, 500);
                dataSeries1.DataPoints.Add(dataPoint);
            }
            for (Int32 i = 0; i < 5; i++)
            {
                DataPoint dataPoint = new DataPoint();
                dataPoint.XValue = rand.Next(1, 10);
                dataPoint.YValue = rand.Next(-500, 500);
                dataSeries1.DataPoints.Add(dataPoint);
            }

            chart.Series.Add(dataSeries1);

            Window window = new Window();
            window.Content = chart;
            window.Show();
            if (_isLoaded)
            {
                window.Dispatcher.InvokeShutdown();
                window.Close();
            }
        }
开发者ID:zhangzy0193,项目名称:visifire,代码行数:43,代码来源:DataPointTest.cs


示例17: FontColorNewValue

        public void FontColorNewValue()
        {
            Chart chart = new Chart();
            chart.Width = 400;
            chart.Height = 300;

            _axisX = new Axis();
            _axisY = new Axis();

            _axisX.AxisLabels = new AxisLabels();
            _axisY.AxisLabels = new AxisLabels();

            _axisX.AxisLabels.FontColor = new SolidColorBrush(Colors.Red);
            _axisY.AxisLabels.FontColor = new SolidColorBrush(Colors.Red);

            chart.AxesX.Add(_axisX);
            chart.AxesY.Add(_axisY);

            Common.CreateAndAddDefaultDataSeries(chart);
            EnqueueDelay(_sleepTime);

            CreateAsyncTask(chart,
                () => Common.AssertBrushesAreEqual(new SolidColorBrush(Colors.Red), _axisX.AxisLabels.FontColor),
                () => Common.AssertBrushesAreEqual(new SolidColorBrush(Colors.Red), _axisY.AxisLabels.FontColor));

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


示例18: TextAlignmentNewValue

        public void TextAlignmentNewValue()
        {
            Chart chart = new Chart();
            chart.Width = 400;
            chart.Height = 300;

            _axisX = new Axis();
            _axisY = new Axis();

            _axisX.AxisLabels = new AxisLabels();
            _axisY.AxisLabels = new AxisLabels();

            _axisX.AxisLabels.TextAlignment = TextAlignment.Center;
            _axisY.AxisLabels.TextAlignment = TextAlignment.Center;

            chart.AxesX.Add(_axisX);
            chart.AxesY.Add(_axisY);

            Common.CreateAndAddDefaultDataSeries(chart);
            EnqueueDelay(_sleepTime);

            CreateAsyncTask(chart,
                () => Assert.AreEqual(TextAlignment.Center, _axisX.AxisLabels.TextAlignment),
                () => Assert.AreEqual(TextAlignment.Center, _axisY.AxisLabels.TextAlignment));

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


示例19: IntervalNewValue

        public void IntervalNewValue()
        {
            Chart chart = new Chart();
            chart.Width = 400;
            chart.Height = 300;

            _axisX = new Axis();
            _axisY = new Axis();

            _axisX.AxisLabels = new AxisLabels();
            _axisY.AxisLabels = new AxisLabels();

            _axisX.AxisLabels.Interval = 2;
            _axisY.AxisLabels.Interval = 20;

            chart.AxesX.Add(_axisX);
            chart.AxesY.Add(_axisY);

            Common.CreateAndAddDefaultDataSeries(chart);
            EnqueueDelay(_sleepTime);

            CreateAsyncTask(chart,
                () => Assert.AreEqual(2, _axisX.AxisLabels.Interval),
                () => Assert.AreEqual(20, _axisY.AxisLabels.Interval));

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


示例20: AreaDataSeriesStressTest

        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));
            });
        }
开发者ID:zhangzy0193,项目名称:visifire,代码行数:70,代码来源:DataSeriesTest.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Charts.Chart类代码示例发布时间:2022-05-26
下一篇:
C# ExportImport.PlatformExportManifest类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap