corelibraries-devexpress-dot-xtracharts-d54539de.md
Represents a series view of the Manhattan Bar type.
Namespace : DevExpress.XtraCharts
Assembly : DevExpress.XtraCharts.v25.2.dll
NuGet Package : DevExpress.Charts
public class ManhattanBarSeriesView :
Bar3DSeriesView
Public Class ManhattanBarSeriesView
Inherits Bar3DSeriesView
The ManhattanBarSeriesView class provides the functionality of a series view of the manhattan bar type within a chart control.
The ManhattanBarSeriesView class inherits properties and methods from the base Bar3DSeriesView class which define the common settings of the 3D bar series views.
Note that a particular view type can be defined for a series via its SeriesBase.View property.
For more information on series views of the 3D bar type please see the Manhattan Bar Chart topic.
The following example demonstrates how to create a ChartControl with two series of the ManhattanBarSeriesView type, set its general properties, and add this chart to a form at runtime. Before proceeding with this example, first create a Windows Forms Application in Visual Studio, and include all necessary assemblies to the References list of your project.
Then, add the following code to the Form.Load event handler.
using System;
using System.Windows.Forms;
using DevExpress.XtraCharts;
// ...
private void Form1_Load(object sender, EventArgs e) {
// Create a new chart.
ChartControl ManhattanBarChart = new ChartControl();
// Add a bar series to it.
Series series1 = new Series("Series 1", ViewType.ManhattanBar);
Series series2 = new Series("Series 2", ViewType.ManhattanBar);
// Add points to the series.
series1.Points.Add(new SeriesPoint("A", 10));
series1.Points.Add(new SeriesPoint("B", 12));
series1.Points.Add(new SeriesPoint("C", 14));
series1.Points.Add(new SeriesPoint("D", 17));
series2.Points.Add(new SeriesPoint("A", 5));
series2.Points.Add(new SeriesPoint("B", 4));
series2.Points.Add(new SeriesPoint("C", 10));
series2.Points.Add(new SeriesPoint("D", 12));
// Add both series to the chart.
ManhattanBarChart.Series.AddRange(new Series[] { series1, series2 });
// Access labels of the first series.
((BarSeriesLabel)series1.Label).Visible = true;
((BarSeriesLabel)series1.Label).ResolveOverlappingMode =
ResolveOverlappingMode.Default;
// Access the series options.
series1.PointOptions.PointView = PointView.ArgumentAndValues;
// Customize the view-type-specific properties of the series.
Bar3DSeriesView myView = (Bar3DSeriesView)series2.View;
myView.BarDepthAuto = false;
myView.BarDepth = 1;
myView.Transparency = 80;
myView.ShowFacet = false;
myView.Model = Bar3DModel.Cylinder;
// Access the diagram's options.
((XYDiagram3D)ManhattanBarChart.Diagram).ZoomPercent = 110;
// Add a title to the chart and hide the legend.
ChartTitle chartTitle1 = new ChartTitle();
chartTitle1.Text = "Manhattan Bar Chart";
ManhattanBarChart.Titles.Add(chartTitle1);
ManhattanBarChart.Legend.Visible = false;
// Add the chart to the form.
ManhattanBarChart.Dock = DockStyle.Fill;
this.Controls.Add(ManhattanBarChart);
}
Imports System
Imports System.Windows.Forms
Imports DevExpress.XtraCharts
' ...
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
' Create a new chart.
Dim ManhattanBarChart As New ChartControl()
' Add a bar series to it.
Dim series1 As New Series("Series 1", ViewType.ManhattanBar)
Dim series2 As New Series("Series 2", ViewType.ManhattanBar)
' Add points to the series.
series1.Points.Add(New SeriesPoint("A", 10))
series1.Points.Add(New SeriesPoint("B", 12))
series1.Points.Add(New SeriesPoint("C", 14))
series1.Points.Add(New SeriesPoint("D", 17))
series2.Points.Add(New SeriesPoint("A", 5))
series2.Points.Add(New SeriesPoint("B", 4))
series2.Points.Add(New SeriesPoint("C", 10))
series2.Points.Add(New SeriesPoint("D", 12))
' Add both series to the chart.
ManhattanBarChart.Series.AddRange(New Series() { series1, series2 })
' Access labels of the first series.
CType(series1.Label, BarSeriesLabel).Visible = True
CType(series1.Label, BarSeriesLabel).ResolveOverlappingMode = ResolveOverlappingMode.Default
' Access the series options.
series1.PointOptions.PointView = PointView.ArgumentAndValues
' Customize the view-type-specific properties of the series.
Dim myView As Bar3DSeriesView = CType(series2.View, Bar3DSeriesView)
myView.BarDepthAuto = False
myView.BarDepth = 1
myView.Transparency = 80
myView.ShowFacet = False
myView.Model = Bar3DModel.Cylinder
' Access the diagram's options.
CType(ManhattanBarChart.Diagram, XYDiagram3D).ZoomPercent = 110
' Add a title to the chart and hide the legend.
Dim chartTitle1 As New ChartTitle()
chartTitle1.Text = "Manhattan Bar Chart"
ManhattanBarChart.Titles.Add(chartTitle1)
ManhattanBarChart.Legend.Visible = False
' Add the chart to the form.
ManhattanBarChart.Dock = DockStyle.Fill
Me.Controls.Add(ManhattanBarChart)
End Sub
IXtraSupportDeserializeCollectionItem
Object ChartElement SeriesViewBase XYDiagram3DSeriesViewBase SeriesView3DColorEachSupportBase Bar3DSeriesView ManhattanBarSeriesView
See Also