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


C# BarSeries類代碼示例

本文整理匯總了C#中BarSeries的典型用法代碼示例。如果您正苦於以下問題:C# BarSeries類的具體用法?C# BarSeries怎麽用?C# BarSeries使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: CargarFormularioChartPorSexo

 private void CargarFormularioChartPorSexo()
 {
     //conexionBD.Add(dataSource);
     //conexionBD.Add(initialCatalog);
     //conexionBD.Add(user);
     //conexionBD.Add(password);
     rcView.Series.Clear();
     BarSeries barSeries = new BarSeries("Performance", "RepresentativeName");
     barSeries.Name = "Q1";
     BarSeries barSeries2 = new BarSeries("Performance", "RepresentativeName");
     barSeries2.Name = "Q2";
     BarSeries barSeries3 = new BarSeries("Performance", "RepresentativeName");
     barSeries3.Name = "Q2";
     SisOxibariterapiaDataSetTableAdapters.spr_ReporteEnfermedadesPorSexoTableAdapter da = new SisOxibariterapiaDataSetTableAdapters.spr_ReporteEnfermedadesPorSexoTableAdapter();
     SisOxibariterapiaDataSet.spr_ReporteEnfermedadesPorSexoDataTable dt = new WinUI.SisOxibariterapiaDataSet.spr_ReporteEnfermedadesPorSexoDataTable();
     da.Connection.ConnectionString = cadenaConexion;
     da.Fill(dt);
     foreach (DataRow dr in dt.Rows)
     {
         barSeries.DataPoints.Add(new CategoricalDataPoint(Convert.ToDouble(dr["Paciente"].ToString()), dr["nombre"].ToString()));
         barSeries.ShowLabels = true;
         barSeries2.DataPoints.Add(new CategoricalDataPoint(Convert.ToDouble(dr["Femenino"].ToString()), dr["nombre"].ToString()));
         barSeries3.DataPoints.Add(new CategoricalDataPoint(Convert.ToDouble(dr["Masculino"].ToString()), dr["nombre"].ToString()));
         barSeries2.ShowLabels = true;
         barSeries3.ShowLabels = true;
     }
     rcView.View.Palette = KnownPalette.Cold;
     //rcView.ShowToolTip = true;
     this.rcView.Series.Add(barSeries);
     this.rcView.Series.Add(barSeries2);
     this.rcView.Series.Add(barSeries3);
     pbLeyenda.Image = global::SisOxi.WinUI.Properties.Resources.LeyendaSexo1;
 }
開發者ID:hatredlab,項目名稱:SisOxi2.0.Copia,代碼行數:33,代碼來源:ReportesUI.cs

示例2: OnStrategyStart

    public override void OnStrategyStart()
    {
        series = new BarSeries();

        if (VolatilityExitEnabled || VolatilityBarrierEnabled)
        {
            rangeSeries = new TimeSeries();
            
            rangeSMA = new SMA(rangeSeries, VolatilitySMALength);
        }
        
        if (TickBarrierEnabled)
            barrier = TickSize * BarrierSize;
        
        lowestLowSeries   = new TimeSeries();
        highestHighSeries = new TimeSeries();		
        channelLowSeries  = new TimeSeries();
        channelHighSeries = new TimeSeries();
        
        lowestLowSeries  .Color = Color.Blue;
        highestHighSeries.Color = Color.Blue;
        channelLowSeries .Color = Color.Brown;
        channelHighSeries.Color = Color.Brown;
        
        Draw(lowestLowSeries  , 0);
        Draw(highestHighSeries, 0);
        Draw(channelLowSeries , 0);
        Draw(channelHighSeries, 0);
    }
開發者ID:heber,項目名稱:FreeOQ,代碼行數:29,代碼來源:code.cs

示例3: createChart

        private RadCartesianChartView createChart()
        {
            //Create the Chart View
            RadCartesianChartView chart = new RadCartesianChartView(this.Activity);

            //Create the bar series and attach axes and value bindings.
            BarSeries barSeries = new BarSeries();

            barSeries.ValueBinding  = new ValueBinding();
            barSeries.CategoryBinding = new CategoryBinding();

            LinearAxis verticalAxis = new LinearAxis();
            //The values in the linear axis will not have values after the decimal point.
            verticalAxis.LabelFormat = "%.0f";
            CategoricalAxis horizontalAxis = new CategoricalAxis();
            barSeries.VerticalAxis = verticalAxis;
            barSeries.HorizontalAxis = horizontalAxis;

            //Bind series to data
            barSeries.Data  = this.getData();

            //Add series to chart
            chart.Series.Add(barSeries);

            CartesianPlotBandAnnotation annotation = new CartesianPlotBandAnnotation(verticalAxis, 6, 8);
            chart.Annotations.Add(annotation);
            annotation.FillColor = Color.Argb(150, 0, 148, 255);
            annotation.StrokeColor = Color.Argb(150, 0, 74, 127);
            annotation.StrokeColor = 4;
            annotation.ZIndex = 1001;

            return chart;
        }
開發者ID:camlt,項目名稱:Android-samples,代碼行數:33,代碼來源:GridLineAnnotationFragment.cs

示例4: MetroWindow_Loaded

        private void MetroWindow_Loaded(object sender, RoutedEventArgs e)
        {
            if (Datos == null || Datos.Count() == 0)
            {
                return;
            }

            var plotModel1 = new PlotModel();
            plotModel1.Title = "Idiomas";

            var categoryAxis1 = new CategoryAxis();
            categoryAxis1.Position = AxisPosition.Left;
            plotModel1.Axes.Add(categoryAxis1);

            var linearAxis1 = new LinearAxis();
            linearAxis1.AxislineStyle = LineStyle.Solid;
            linearAxis1.Position = AxisPosition.Bottom;
            plotModel1.Axes.Add(linearAxis1);
            var barSeries1 = new BarSeries();

            foreach (var item in Datos)
            {
                categoryAxis1.ActualLabels.Add(item.Idioma);
                barSeries1.Items.Add(new BarItem(item.Certeza));
            }

            plotModel1.Series.Add(barSeries1);

            Grafica.Model = plotModel1;
        }
開發者ID:umggt,項目名稱:lang-detector,代碼行數:30,代碼來源:MasInfoWindow.xaml.cs

示例5: PerformanceChart_Loaded

        void PerformanceChart_Loaded(object sender, RoutedEventArgs e)
        {
            if (radChart.DataContext != null)
            {
                Employee employee = (Employee)radChart.DataContext;

                if (radChart.Series.Count == 0)
                {
                    radChart.HorizontalAxis = new DateTimeCategoricalAxis () { LabelFormat = "dd/MM" };
                    radChart.VerticalAxis = new LinearAxis() { LabelFormat = "C0" };


                    IEnumerable<Order> orders = (from o in employee.Orders
                                                  orderby o.OrderDate
                                                  select o).Skip(employee.Orders.Count() - 10);

                    BarSeries series = new BarSeries();

                    foreach (Order order in orders)
                    {
                        CategoricalDataPoint dataPoint = new CategoricalDataPoint();
                        dataPoint.Value = (from orderDetail in order.Details
                                                     select orderDetail.Quantity * orderDetail.UnitPrice *
                                                         (1 - orderDetail.Discount)).Sum();
                        dataPoint.Category = order.OrderDate;
                        series.DataPoints.Add(dataPoint);
                    }

                    radChart.Series.Add(series);
                }
            }
        }
開發者ID:netintellect,項目名稱:PluralsightSpaJumpStartFinal,代碼行數:32,代碼來源:PerformanceChart.xaml.cs

示例6: BarSeries

        public static PlotModel BarSeries()
        {
            var model = new PlotModel
                            {
                                Title = "BarSeries",
                                LegendPlacement = LegendPlacement.Outside,
                                LegendPosition = LegendPosition.BottomCenter,
                                LegendOrientation = LegendOrientation.Horizontal,
                                LegendBorderThickness = 0
                            };

            var s1 = new BarSeries { Title = "Series 1", StrokeColor = OxyColors.Black, StrokeThickness = 1 };
            s1.Items.Add(new BarItem { Value = 25 });
            s1.Items.Add(new BarItem { Value = 137 });
            s1.Items.Add(new BarItem { Value = 18 });
            s1.Items.Add(new BarItem { Value = 40 });

            var s2 = new BarSeries { Title = "Series 2", StrokeColor = OxyColors.Black, StrokeThickness = 1 };
            s2.Items.Add(new BarItem { Value = 12 });
            s2.Items.Add(new BarItem { Value = 14 });
            s2.Items.Add(new BarItem { Value = 120 });
            s2.Items.Add(new BarItem { Value = 26 });

            var categoryAxis = new CategoryAxis { Position = AxisPosition.Left };
            categoryAxis.Labels.Add("Category A");
            categoryAxis.Labels.Add("Category B");
            categoryAxis.Labels.Add("Category C");
            categoryAxis.Labels.Add("Category D");
            var valueAxis = new LinearAxis { Position = AxisPosition.Bottom, MinimumPadding = 0, MaximumPadding = 0.06, AbsoluteMinimum = 0 };
            model.Series.Add(s1);
            model.Series.Add(s2);
            model.Axes.Add(categoryAxis);
            model.Axes.Add(valueAxis);
            return model;
        }
開發者ID:3r1k0n,項目名稱:documentation-examples,代碼行數:35,代碼來源:BarSeriesExamples.cs

示例7: createChart

        private RadCartesianChartView createChart() {
            //Create the Chart View
            RadCartesianChartView chart = new RadCartesianChartView(this.Activity);

            LinearAxis verticalAxis = new LinearAxis();
            //The values in the linear axis will not have values after the decimal point.
            verticalAxis.LabelFormat = "%.0f";
            CategoricalAxis horizontalAxis = new CategoricalAxis();
            chart.VerticalAxis = verticalAxis;
            chart.HorizontalAxis = horizontalAxis;


            for (int i = 0; i < 3; i++) {
                //Create the bar series and attach axes and value bindings.
                BarSeries barSeries = new BarSeries();

                //We want to stack the different area series.
                barSeries.CombineMode = ChartSeriesCombineMode.Stack;

                barSeries.ValueBinding = new ValueBinding();
                barSeries.CategoryBinding = new CategoryBinding();

                //Bind series to data
                barSeries.Data = this.getData();

                //Add series to chart
                chart.Series.Add(barSeries);
            }

            return chart;
        }
開發者ID:bmccool,項目名稱:Android-samples,代碼行數:31,代碼來源:StackBarSeriesFragment.cs

示例8: createChart

        private RadCartesianChartView createChart(){
            RadCartesianChartView chart = new RadCartesianChartView(this.Activity);

            CategoricalAxis horizontalAxis = new CategoricalAxis();
            chart.HorizontalAxis = horizontalAxis;

            LinearAxis vertical1 = new LinearAxis();
            vertical1.LabelFormat = "%.0f";

            LinearAxis vertical2 = new LinearAxis();
            vertical2.LabelFormat = "%.0f";

            BarSeries series1 = new BarSeries();

            ArrayList data = this.getData();

            series1.ValueBinding = new ValueBinding1();
            series1.CategoryBinding = new CategoryBinding();
            series1.VerticalAxis = vertical1;
            series1.Data = data;

            chart.Series.Add(series1);

            LineSeries series2 = new LineSeries();

            series2.ValueBinding = new ValueBinding2();
            series2.CategoryBinding = new CategoryBinding();
            series2.VerticalAxis = (vertical2);
            vertical2.HorizontalLocation = AxisHorizontalLocation.Right;
            series2.Data = data;

            chart.Series.Add(series2);

            return chart;
        }
開發者ID:bmccool,項目名稱:Android-samples,代碼行數:35,代碼來源:MultipleAxesFragment.cs

示例9: createChart

        private RadCartesianChartView createChart(){
            //Create the Chart View
            RadCartesianChartView chart = new RadCartesianChartView(this.Activity);

            //Create the bar series and attach axes and value bindings.
            BarSeries barSeries = new BarSeries();

            barSeries.ValueBinding  = new ValueBinding();
            barSeries.CategoryBinding = new CategoryBinding();

            LinearAxis verticalAxis = new LinearAxis();
            //The values in the linear axis will not have values after the decimal point.
            verticalAxis.LabelFormat = "%.0f";
            CategoricalAxis horizontalAxis = new CategoricalAxis();
            horizontalAxis.LabelFitMode = AxisLabelFitMode.MultiLine;

            barSeries.VerticalAxis = verticalAxis;
            barSeries.HorizontalAxis = horizontalAxis;

            //Bind series to data
            barSeries.Data = this.getData();

            //Add series to chart
            chart.Series.Add(barSeries);

            ChartSelectionBehavior sb = new ChartSelectionBehavior();
            sb.DataPointsSelectionMode = ChartSelectionMode.Single;

            chart.Behaviors.Add(sb);

            return chart;
        }
開發者ID:bmccool,項目名稱:Android-samples,代碼行數:32,代碼來源:SelectionBehaviorFragment.cs

示例10: SetDataSumValuesList

        public void SetDataSumValuesList(Dictionary<string, double> data, ChartBy chartBy)
        {
            // lets clear previous chart
            this.SumValuesCollection.Clear();
            this.MainChart.Series.Clear();

            // copy columns data into our observable collection
            foreach (var column in data)
            {
                this.SumValuesCollection.Add(new DataSumValuesCollection
                    {
                        new DataSumValues
                            {
                                Header = (chartBy == ChartBy.Cols ? "Column " : "Row ") + column.Key,
                                SumValues = column.Value
                            }
                    });
            }

            foreach (var item in this.SumValuesCollection)
            {
                BarSeries columnSeries = new BarSeries { SelectionMode = SelectionMode.Series };

                BindableDataSeries bindableData = new BindableDataSeries
                {
                    Title = item[0].Header,
                    ItemsSource = item,
                    XValueBinding = new Binding("SumValues"),
                    YValueBinding = new Binding("Header"),
                };
                columnSeries.DataSeries = bindableData;

                this.MainChart.Series.Add(columnSeries);
            }
        }
開發者ID:DVitinnik,項目名稱:UniversityApps,代碼行數:35,代碼來源:BarChart.xaml.cs

示例11: createChart

        private RadCartesianChartView createChart(){
            //Create the Chart View
            RadCartesianChartView chart = new RadCartesianChartView(this.Activity);

            //Create the bar series and attach axes and value bindings.
            BarSeries barSeries = new BarSeries();

            barSeries.ValueBinding  = new ValueBinding();
            barSeries.CategoryBinding = new CategoryBinding();

            LinearAxis verticalAxis = new LinearAxis();
            //The values in the linear axis will not have values after the decimal point.
            verticalAxis.LabelFormat = "%.0f";
            CategoricalAxis horizontalAxis = new CategoricalAxis();
            barSeries.VerticalAxis = verticalAxis;
            barSeries.HorizontalAxis = horizontalAxis;

            //Bind series to data
            barSeries.Data  = this.getData();

            //Add series to chart
            chart.Series.Add(barSeries);

            CartesianGridLineAnnotation annotation = new CartesianGridLineAnnotation(verticalAxis, 3);
            chart.Annotations.Add(annotation);
            annotation.LabelHorizontalAlignment = HorizontalAlignment.Left;
            annotation.StrokeColor = Color.Argb(255, 235, 100, 32);
            annotation.StrokeWidth = 4;
            annotation.ZIndex = 1001;
            annotation.Label = "This is Grid Line annotation";

            return chart;
        }
開發者ID:bmccool,項目名稱:Android-samples,代碼行數:33,代碼來源:GridLineAnnotationFragment.cs

示例12: GetSampleContent

 public override View GetSampleContent(Context context)
  {
      var chart = new SfChart(context);;
      chart.SetBackgroundColor(Color.White);
      chart.PrimaryAxis = new CategoryAxis();
      chart.SecondaryAxis = new NumericalAxis {Interval = 20, EdgeLabelsDrawingMode = EdgeLabelsDrawingMode.Shift};
      var series = new BarSeries
      {
          DataSource = MainPage.GetData1(),
      };
      series.DataMarker.ShowLabel = true;
      chart.Series.Add(series);
      return chart;
  }
開發者ID:IanLeatherbury,項目名稱:tryfsharpforms,代碼行數:14,代碼來源:Bar.cs

示例13: Compress

        public BarSeries Compress(DataEntryEnumerator enumerator)
        {
            BarSeries series = new BarSeries();
            this.NewCompressedBar += delegate(object sender, CompressedBarEventArgs args)
            {
                series.Add(args.Bar);
            };
            while (enumerator.MoveNext())
            {
                this.Add(enumerator.Current);
            }
            this.Flush();
            return series;
        }
開發者ID:houzhongxu,項目名稱:OpenQuant.API,代碼行數:14,代碼來源:BarCompressor.cs

示例14: prepareChart

        private void prepareChart() {
            CategoricalAxis horizontalAxis = new CategoricalAxis();
            this.chartView.HorizontalAxis = horizontalAxis;

            LinearAxis verticalAxis = new LinearAxis();
            verticalAxis.LabelFormat = "%.0f";
            this.chartView.VerticalAxis = verticalAxis;

            for (int i = 0; i < 5; i++){
                BarSeries series = new BarSeries();
                series.LegendTitle = "Series " + (i + 1);
                series.CategoryBinding = new CategoryBinding();
                series.ValueBinding = new ValueBinding();
                series.Data = this.getData();
                this.chartView.Series.Add(series);
            }
        }
開發者ID:bmccool,項目名稱:Android-samples,代碼行數:17,代碼來源:ChartLegendFragment.cs

示例15: TornadoDiagram1

        public static PlotModel TornadoDiagram1()
        {
            // http://en.wikipedia.org/wiki/Tornado_diagram
            var model = new PlotModel("Tornado diagram 1") { LegendPlacement = LegendPlacement.Outside };

            var s1 = new BarSeries
                {
                    Title = "High",
                    IsStacked = true,
                    FillColor = OxyColor.FromRgb(216, 82, 85),
                    BaseValue = 7,
                    StrokeColor = OxyColors.Black,
                    StrokeThickness = 1
                };
            s1.Items.Add(new BarItem(1));
            s1.Items.Add(new BarItem(1));
            s1.Items.Add(new BarItem(4));
            s1.Items.Add(new BarItem(5));

            var s2 = new BarSeries
                {
                    Title = "Low",
                    IsStacked = true,
                    FillColor = OxyColor.FromRgb(84, 138, 209),
                    BaseValue = 7,
                    StrokeColor = OxyColors.Black,
                    StrokeThickness = 1
                };
            s2.Items.Add(new BarItem(-1));
            s2.Items.Add(new BarItem(-3));
            s2.Items.Add(new BarItem(-2));
            s2.Items.Add(new BarItem(-3));

            var categoryAxis = new CategoryAxis { Position = AxisPosition.Left };
            categoryAxis.Labels.Add("F/X rate");
            categoryAxis.Labels.Add("Inflation");
            categoryAxis.Labels.Add("Price");
            categoryAxis.Labels.Add("Conversion");
            var valueAxis = new LinearAxis(AxisPosition.Bottom) { ExtraGridlines = new[] { 7.0 } };
            model.Series.Add(s1);
            model.Series.Add(s2);
            model.Axes.Add(categoryAxis);
            model.Axes.Add(valueAxis);
            return model;
        }
開發者ID:aleksanderkobylak,項目名稱:oxyplot,代碼行數:45,代碼來源:TornadoBarSeriesExamples.cs


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