ActiveReports 18 .NET Edition
Report Authors / Report Controls / Report Controls in Page/RDLX Report / Chart / Rules / Use Rules to Customize Chart Appearance
In This Topic
    Use Rules to Customize Chart Appearance
    In This Topic

    You can customize the chart appearance by changing these target properties of the chart plot.

    Note: If the chart legend is set to display and a rule condition changes the color of a part of the chart, the color of the legend will not change. The color of the legend will match the chart color only if the whole chart changes color.

    DataPoint Styles

    DataPoint Styles include such target properties as BackgroundColor, LineColor, LineStyle, and LineWidth. These properties are applicable to the chart types that are composed of data points, for example, Bar, Column, Pie, Bubble, etc.

    This topic uses a report with a Column chart that displays global sales by year.

    BackgroundColor

    To change the BackgroundColor target property of the chart, you can add a rule with the following settings.

    Property Value
    RuleDesigner Collection Editor > Condition =Chart!CurrentData<110
    RulePropertyDesigner Collection Editor > TargetProperty BackgroundColor
    RulePropertyDesigner Collection Editor > Value Red

    At preview, you will see Sales with the data below 110 get the green background color.

    Chart Rules Background Color 

    LineColor

    Add the LineColor target property to the same condition (see previous image) for the chart with the following settings:

    Property Value
    RulePropertyDesigner Collection Editor > TargetProperty LineColor
    RulePropertyDesigner Collection Editor > Value Black

    LineStyle

    Add the LineStyle target property to the same condition (see previous image) for the chart with the following settings:

    Property Value
    RulePropertyDesigner Collection Editor > TargetProperty LineStyle
    RulePropertyDesigner Collection Editor > Value Double

    LineWidth

    Add the LineWidth target property to the same condition (see previous image) for the chart with the following settings:

    Property Value
    RulePropertyDesigner Collection Editor > TargetProperty LineWidth
    RulePropertyDesigner Collection Editor > Value 2

    The final chart looks as follows.

    Chart Rules Line Width 

    DataPoint Symbol Styles

    DataPoint Symbol Styles include such target properties as SymbolBackgroundColor, SymbolLineColor, SymbolLineStyle, and SymbolLineWidth. These properties are applicable to the chart types that are composed of data point symbols, for example, Line, Radar Line, etc.

    This topic uses a report with a Line chart that displays global sales by year.

    SymbolBackgroundColor

    To change the SymbolBackgroundColor target property of the chart, you can add a rule with the following settings.

    Property Value
    RuleDesigner Collection Editor > Condition =Chart!CurrentData<110
    RulePropertyDesigner Collection Editor > TargetProperty SymbolBackgroundColor
    RulePropertyDesigner Collection Editor > Value Green

    SymbolLineColor

    To change the SymbolLineColor target property of the chart, you can add a rule with the following settings.

    Property Value
    RulePropertyDesigner Collection Editor > TargetProperty SymbolLineColor
    RulePropertyDesigner Collection Editor > Value Red

    SymbolLineStyle

    To change the SymbolLineStyle target property of the chart, you can add a rule with the following settings:

    Property Value
    RulePropertyDesigner Collection Editor > TargetProperty SymbolLineStyle
    RulePropertyDesigner Collection Editor > Value Double

    SymbolLineWidth

    To change the SymbolLineWidth target property of the chart, you can add a rule with the following settings.

    Property Value
    RulePropertyDesigner Collection Editor > TargetProperty SymbolLineWidth
    RulePropertyDesigner Collection Editor > Value 4

    The final chart looks as follows.

    Chart Rules Symbol Line Width 

    LabelTemplate

    The LabelTemplate target property allows you to display labels and specify the label format for the chart data that meets the condition of a rule.

    Let's say that you have a chart with a rule to mark data below 110 and you want the chart to display a label for this marked data. To do this, you can add a rule with the following settings.

    Property Value
    RuleDesigner Collection Editor > Condition =Chart!CurrentData<110
    RulePropertyDesigner Collection Editor > TargetProperty LabelTemplate
    RulePropertyDesigner Collection Editor > Value {valueField.value}

    At preview, you will see Sales with the data below 110 marked with the labels. These labels display data values according to the rule you have just set.

    Chart Rules Label Template 

    TooltipTemplate

    The TooltipTemplate target property allows you to display tooltips in the Web Viewer and specify the tooltip format for the chart data that meets the condition of a rule.

    Let's say that you have a chart with a rule to mark data below 110 and you want the chart to display a tooltip for this marked data. To do this, you can add a rule with the following settings.

    Property Value
    RuleDesigner Collection Editor > Condition =Chart!CurrentData<110
    RulePropertyDesigner Collection Editor > TargetProperty TooltipTemplate
    RulePropertyDesigner Collection Editor > Value {valueField.value}

    At preview, you will see Sales with the data below 110 display tooltips. These tooltips display data values according to the rule you have just set.

    Chart Rules ToolTip Template