FormatConditionBar Class

A format condition used to visualize numeric values using bars.

Namespace: DevExpress.DashboardCommon

Assembly: DevExpress.Dashboard.v21.1.Core.dll


public class FormatConditionBar :


To create a format condition to display bars with lengths proportional to corresponding values, do the following.

Assign the resulting FormatConditionBar object to the DashboardItemFormatRule.Condition property.


The Bar format condition (FormatConditionBar) allows you to visualize numeric values using bars.

This example shows how to display data bars within grid cells. Note that bars corresponding to positive and negative values are colored differently.

View Example

Imports DevExpress.DashboardCommon
Imports DevExpress.DashboardWin

Namespace Grid_IconRangeCondition
    Partial Public Class Form1
        Inherits DevExpress.XtraEditors.XtraForm

        Public Sub New()
            Dim dashboard As New Dashboard()
            dashboardViewer1.Dashboard = dashboard
            Dim grid As GridDashboardItem = CType(dashboard.Items("gridDashboardItem1"), GridDashboardItem)
            Dim extendedPrice As GridMeasureColumn = CType(grid.Columns(1), GridMeasureColumn)

            Dim barRule As New GridItemFormatRule(extendedPrice)
            Dim barCondition As New FormatConditionBar()
            barCondition.StyleSettings = New BarStyleSettings(FormatConditionAppearanceType.PaleBlue)
            barCondition.NegativeStyleSettings = New BarStyleSettings(FormatConditionAppearanceType.PaleRed)
            barCondition.BarOptions.AllowNegativeAxis = checkBox1.Checked
            barCondition.BarOptions.DrawAxis = True
            barRule.Condition = barCondition

        End Sub

        Private Sub checkBox1_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) _
            Handles checkBox1.CheckedChanged
        End Sub

        Private Sub checkBox2_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) _
            Handles checkBox2.CheckedChanged
        End Sub

        Private Sub checkBox3_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) _
            Handles checkBox3.CheckedChanged
        End Sub

        Private Sub UpdateBarOptions()
            Dim grid As GridDashboardItem = CType(dashboardViewer1.Dashboard.Items(0), GridDashboardItem)
            Dim barOptions As FormatConditionBarOptions =
                CType((grid.FormatRules(0)).Condition, FormatConditionBar).BarOptions
            barOptions.AllowNegativeAxis = checkBox1.Checked
            barOptions.DrawAxis = checkBox2.Checked
            barOptions.ShowBarOnly = checkBox3.Checked
        End Sub
    End Class
End Namespace
See Also