Back to Devexpress

AxisTitle.Visibility Property

corelibraries-devexpress-dot-xtracharts-dot-axistitle-2bfe565f.md

latest5.3 KB
Original Source

AxisTitle.Visibility Property

Gets or sets a value which specifies whether to show an axis title on a diagram.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
[XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)]
public DefaultBoolean Visibility { get; set; }
vb
<XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)>
Public Property Visibility As DefaultBoolean

Property Value

TypeDescription
DefaultBoolean

Default - the axis title visibility is defined according to the adaptive layout algorithm when the chart is resized; True - X and Y-axes titles are visible on a diagram; False - X and Y-axes titles are hidden. The default is DefaultBoolean.Default.

|

Available values:

NameDescriptionReturn Value
True

The value is true.

|

0

| | False |

The value is false.

|

1

| | Default |

The value is specified by a global option or a higher-level object.

|

2

|

Remarks

Use the Visibility property to show or hide the X and Y- axes titles on a diagram.

Note

The Default returned value of the Visibility property is in affect when the adaptive layout feature is enabled. So, ensure the ChartControl.AutoLayout property is set to true.

The adaptive layout feature is used to maintain a better chart appearance and layout when the chart becomes smaller.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Visibility 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-heatmap-bind-to-data-source/CS/Form1.cs#L64

csharp
heatmap.AxisX.Title.Text = "Region";
heatmap.AxisX.Title.Visibility = DevExpress.Utils.DefaultBoolean.True;
heatmap.AxisX.Label.Staggered = false;

winforms-chart-create-and-customize-an-axis-title/CS/AxisTitle/Form1.cs#L34

csharp
// Customize the appearance of the X-axis title.
diagram.AxisX.Title.Visibility = DevExpress.Utils.DefaultBoolean.True;
diagram.AxisX.Title.Alignment = StringAlignment.Center;

winforms-chart-colorize-charts-using-the-color-object-colorizer/CS/ColorObjectColorizerExample/Form1.cs#L39

csharp
((XYDiagram)chartControl1.Diagram).AxisY.Title.Text = "GDP per capita, $";
    ((XYDiagram)chartControl1.Diagram).AxisY.Title.Visibility = DevExpress.Utils.DefaultBoolean.True;
}

winforms-heatmap-bind-to-data-source/VB/Form1.vb#L42

vb
Me.heatmap.AxisX.Title.Text = "Region"
Me.heatmap.AxisX.Title.Visibility = DevExpress.Utils.DefaultBoolean.[True]
Me.heatmap.AxisX.Label.Staggered = False

winforms-chart-create-and-customize-an-axis-title/VB/AxisTitle/Form1.vb#L33

vb
' Customize the appearance of the X-axis title.
diagram.AxisX.Title.Visibility = DevExpress.Utils.DefaultBoolean.True
diagram.AxisX.Title.Alignment = StringAlignment.Center

winforms-chart-colorize-charts-using-the-color-object-colorizer/VB/ColorObjectColorizerExample/Form1.vb#L31

vb
CType(chartControl1.Diagram, XYDiagram).AxisY.Title.Text = "GDP per capita, $"
    CType(chartControl1.Diagram, XYDiagram).AxisY.Title.Visibility = DevExpress.Utils.DefaultBoolean.True
End Sub

See Also

AxisTitle Class

AxisTitle Members

DevExpress.XtraCharts Namespace