Learning about sparklines

Sparklines are very small graphics that contain very specific information. Sparklines have few characteristics to configure and are very minimalist. They cannot include axes, labels, descriptions, effects, or numbers. To get a better idea of what sparklines are, here are some examples:

Learning about sparklines

As you can see, they do not contribute any information out of context. That is why their principal role is to accompany the data present in the report, and because of their small size, we can include them in the detail level of our reports!

PRD lets us include sparklines in our reports, granting us the possibility of analyzing the variation of an item's value over time, making specific comparisons, showing what percentage of a total an item's value represents, and so on.

If we compare sparklines with the kinds of charts that we have already seen in PRD, we could erroneously conclude that sparklines display very little information to the end user. But as we saw before, this characteristic is what makes these little charts shine.

In PRD there are three types of sparklines:

  • Bar sparkline (Learning about sparklines) : Lets us add a small bar chart. The characteristics we can modify for this graphic are:
    • Style.high-color: The color the tallest bar will have.
    • Style.lastcolor: The color the last bar with have.
    • Attributes.spacing: The spacing between bars. The default value is 2.
  • Line sparkline (Learning about sparklines) : Lets us add a small line chart. The characteristics we can modify for this graphic are:
    • Style.lastcolor: The color of the point on the line that represents the last value.
    • Attributes.spacing: The spacing between values. The default value is 2.
  • Pie sparkline (Learning about sparklines) : Lets us add a small pie chart. The characteristics we can modify for this graphic are:
    • Style.low-color: The color of each portion of the pie whose value falls in the low range. The default color is green.
    • Style.medium-color: The color of each portion of the pie whose value falls in the medium range. The default color is yellow.
    • Style.high-color: The color of each portion of the pie whose value falls in the high range. The default color is red.
    • Attributes.low-slice: The values between zero and this value will be considered in the low range. The default value is 0.3.
    • Attributes.medium-slice: The values between the low-slice value and this value will be considered in the medium range. The default value is 0.7.
    • Attributes.high-slice: The values between the medium-slice value and this value will be considered in the high range. It is usually left blank. The default value is 1.
    • Attributes.start-angle: The pie's starting angle.
    • Attributes.counter-clockwise: The direction in which the pie will turn.

Note

After adding a sparkline to our report, the characteristics for configuring the graphic are found in Styles and Attributes in the category sparkline.

An array with the values to be displayed must be assigned to the object's bar sparkline and line sparkline. We will see how to do this soon.

All the values for the pie sparkline object must be between 0 and 1, with 0.2 representing 20 percent and 1 representing 100 percent.

Restarting practice

Now we will create a bar sparkline and a line sparkline step-by-step. Both objects will be in the Details section of our report in order to show two small graphics in each row.

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

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