本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}