Data Dynamics Reports Online Help
Data Bar
See Also Support Forum
User Guide > Creating Reports > Building Reports > Expressions > Data Visualization > Data Bar

Glossary Item Box

The Data Bar data visualization displays a 96 by 96 dpi bar image.  The Value argument determines the amount of colored bar to render to the right of the Zero argument (or to the left in the case of a negative value).

The Minimum and Maximum arguments determine the range of data. The area between the Value argument and the Maximum argument is transparent (or between the Value and the Minimum in the case of a negative value).

Parameters

You can use static values or aggregate functions (e.g. Min or Max) to set the parameters. For more information on these and other aggregate functions, see the Functions topic.

Syntax

=DataBar(Value, Minimum, Maximum, Zero, Color)
=DataBar(Value, Minimum, Maximum, Zero, Color, Alternate Color)

Simple Example

=DataBar(Fields!TotalAmount.Value, (Min(Fields!TotalAmount.Value, Nothing)), 
(Max(Fields!TotalAmount.Value, Nothing)), 0, "BlueViolet")

Usage

Use an expression like the example in either the BackgroundImage property of a TextBox or the Value property of an Image. This renders a bar in the color specified, the width of which changes depending on the number returned by the Value parameter, in the case of the example, TotalAmount.  If your data contains only positive values, Zero corresponds with Minimum at the left edge of the Data Bar. The area between the Value and the Maximum is transparent.

Example Using Negative Values

=DataBar(Fields!Difference.Value, -10, 25, 0, 
IIf(Fields!Difference.Value < 0, "Red", "Blue"))

When your data contains negative as well as positive values, you can use an Immediate If expression for the Color parameter. In the example above, if the Difference value is negative, it is rendered in red, while positive values are rendered in blue. You can also see that negative values are rendered to the left of Zero and positive values are rendered to the right.

Default Behavior

The function returns null (i.e. no image is rendered) in any of the following cases:

  1. The Maximum is less than or equal to the Minimum.
  2. The expression is placed in a property which does not take an image.
  3. The Source property of the image is not set to Database.

If the argument for any of the parameters cannot be converted to the required data type, the default value is used instead.

Parameter Default Value
Value 0
Minimum 0
Maximum 0
Zero 0
Color Green
Alternate Color null

Dialog

Selecting <Data Visualizer...> from the Smart Panel or Property Grid for a property that supports this data visualization will launch the following dialog.  To build the data visualizer expression, just select the appropriate values for each of the options on the dialog.

Data Bar Data Visualizer dialog

See Also

©2010. GrapeCity, inc. All Rights Reserved.