Back to Devexpress

WholeRange.AlwaysShowZeroLevel Property

corelibraries-devexpress-dot-xtracharts-dot-wholerange.md

latest7.3 KB
Original Source

WholeRange.AlwaysShowZeroLevel Property

Gets or sets the value that indicates whether to show an axis zero level.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
public bool AlwaysShowZeroLevel { get; set; }
vb
Public Property AlwaysShowZeroLevel As Boolean

Property Value

TypeDescription
Boolean

true if zero values should be displayed; otherwise false.

|

Remarks

Use the AlwaysShowZeroLevel property to control whether the zero level should always be visible when the y-axis range is calculated automatically (the Range.Auto property is set to true ). The Chart Control calculates a new optimal minimum value for the y-axis when AlwaysShowZeroLevel is disabled. The AlwaysShowZeroLevel property value is ignored if the Range.Auto property is set to false.

Note that you cannot enable the AlwaysShowZeroLevel property for a date-time y-axis.

The following images demonstrate the AlwaysShowZeroLevel property in action:

AlwaysShowZeroLevel = falseAlwaysShowZeroLevel = true
csharp
XYDiagram xyDiagram { get { return chartControl1.Diagram as XYDiagram; } }
// ...
xyDiagram.AxisY.WholeRange.AlwaysShowZeroLevel = false;
vb
Private ReadOnly Property xyDiagram As XYDiagram
    Get
        Return CType(chartControl1.Diagram,XYDiagram)
    End Get
End Property
' ...
xyDiagram.AxisY.WholeRange.AlwaysShowZeroLevel = false

Refer to Visual Ranges and Whole Ranges for more information about axis ranges.

The following code snippets (auto-collected from DevExpress Examples) contain references to the AlwaysShowZeroLevel property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-charts-create-model-for-custom-chart-element/CS/CustomChartElementModel/Form1.cs#L132

csharp
diagram.AxisX.WholeRange.SideMarginsValue = 1.2;
diagram.AxisY.WholeRange.AlwaysShowZeroLevel = false;

winforms-charts-create-real-time-chart/CS/RealTimeChartUpdates/Form1.cs#L34

csharp
diagram.DependentAxesYRange = DefaultBoolean.True;
diagram.AxisY.WholeRange.AlwaysShowZeroLevel = false;

winforms-charts-create-real-time-chart-and-collect-data-in-separate-thread/CS/RealTimeChartUpdates/Form1.cs#L43

csharp
diagram.DependentAxesYRange = DefaultBoolean.True;
diagram.AxisY.WholeRange.AlwaysShowZeroLevel = false;

winforms-charts-create-a-side-by-side-stacked-bars/CS/SideBySideStackedBarChart/Form1.cs#L40

csharp
diagram.AxisX.Tickmarks.MinorVisible = false;
diagram.AxisY.WholeRange.AlwaysShowZeroLevel = false;

winforms-chart-add-a-trend-line/CS/Form1.cs#L48

csharp
// Define the Y-axis range.
myView.AxisY.WholeRange.AlwaysShowZeroLevel = false;

winforms-charts-create-model-for-custom-chart-element/VB/CustomChartElementModel/Form1.vb#L190

vb
diagram.AxisX.WholeRange.SideMarginsValue = 1.2
diagram.AxisY.WholeRange.AlwaysShowZeroLevel = False
chart.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False

winforms-charts-create-real-time-chart/VB/RealTimeChartUpdates/Form1.vb#L38

vb
diagram.DependentAxesYRange = DefaultBoolean.True
diagram.AxisY.WholeRange.AlwaysShowZeroLevel = False
Dim timer As Timer = New Timer()

winforms-charts-create-real-time-chart-and-collect-data-in-separate-thread/VB/RealTimeChartUpdates/Form1.vb#L53

vb
diagram.DependentAxesYRange = DefaultBoolean.True
diagram.AxisY.WholeRange.AlwaysShowZeroLevel = False
Dim timer As Windows.Forms.Timer = New Windows.Forms.Timer()

winforms-charts-create-a-side-by-side-stacked-bars/VB/SideBySideStackedBarChart/Form1.vb#L40

vb
diagram.AxisX.Tickmarks.MinorVisible = False
diagram.AxisY.WholeRange.AlwaysShowZeroLevel = False
AddHandler chart.BoundDataChanged, AddressOf Chart_BoundDataChanged

winforms-chart-add-a-trend-line/VB/Form1.vb#L43

vb
' Define the Y-axis range.
myView.AxisY.WholeRange.AlwaysShowZeroLevel = False
' Add the trendline to the series collection of indicators.

See Also

Axis Ranges

WholeRange Class

WholeRange Members

DevExpress.XtraCharts Namespace