Customizing the Package

Although IBCS recommend to use gray colors for plotting, tidycharts enables user to define their color palette. The same applies to styles, the default IBCS are implemented, but there is a way to set one’s own styles. In this vignette we will show how to customize the package.



The defaults


Firstly, we need to define a data frame with 6 rows and 2 columns. Column bar_colors contains 6 colors which will be used to draw the bars. Column text_colors contains color of labels that will be drawn on bars. Ideally, text_colors are contrasting to corresponding row of bar_colors. Users with a lack of the sense of aesthetics are encouraged to select color palette with a help of dedicated software :

Then, we use set_colors function from tidycharts package.

Now, we can generate chart using new palette.


The defaults

Styles are used to indicate different type of presented data. actual, previous, plan, forecast styles are implemented out of the box.


When defining styles, one must define stroke and fill parameters as column names. Style names are unrestricted. Use set_styles to bind styles_df to the package environment.

Now, refer to styles through given names and use them in chart functions.

Resetting to defaults

If you want to restore the default styles and colors, just use restore_defaults function.