Using bindable colors to control alert coloring from a central location

With the advent of the option to dynamically bind colors to different parts of a component, we can push alerting to another level. For example, we may have a sales chart for a set of regions and may want to signal whether something is critically wrong. Instead of having a bunch of green and red bars that may look like a Christmas tree, we can set the chart background color to red if one of the values has reached a critical point. In this scenario, a user will be drawn to the chart right away, as it will be ringing alarm bells.

Using bindable colors to control alert coloring from a central location

Getting ready

Be sure to have your chart data ready, shown as follows. In this recipe, we will have a set of sales data for each region. You may use the setup from the previous recipe, Adding alerts to a column chart, to help save you time.

Getting ready

How to do it...

  1. Drag a Column Chart from the Charts section of the Components window onto the canvas.
  2. Bind the chart data to the data set up in the Getting ready section.
    How to do it...
  3. Create a section in the worksheet that will contain the critical threshold value. If any region sales go below that value, we want a major alert to show up.

    How to do it...

  4. Bind cell F5, which determines the background color, to the Background Color property of the chart.
    How to do it...

How it works...

Using bindable colors, we can dynamically set color properties for almost any component. In our example, we use a simple COUNTIF statement to determine whether any of the region sales are below the critical threshold. From there, we have another IF statement that determines the coloring of the chart background. The first case (the left-hand side graph in the following screenshot) shows that all our sales are above $200; thus, the chart background is white. The second case (the right-hand side graph in the following screenshot) shows that the sales in the West region are below $200; thus, a major alert is shown and the chart background becomes red.

How it works...

See also

There are many ways to customize alerting for different components. Our example only shows one way to do so. The easiest way can be found in the Adding alerts to a column chart recipe. To learn more about customizing charts to your desired look and feel, read the recipes in Chapter 7, Dashboard Look and Feel.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset