-
Notifications
You must be signed in to change notification settings - Fork 24
Chart Captions
Jaidev Deshpande edited this page Feb 12, 2020
·
4 revisions
-
Example: Sales trends by category on the Sales FDD Dashboard
-
Data:
Order Date Category Sales 0 2015 Furniture 170518 1 2015 Office Supplies 104026 2 2015 Technology 162781 3 2016 Furniture 198901 4 2016 Office Supplies 135095 5 2016 Technology 226364 6 2017 Furniture 215387 7 2017 Office Supplies 179023 8 2017 Technology 271731 -
Caption:
All three categories have seen a steady increase in sales from 2015 to 2017.
-
Template:
{% if df['Sales'].is_monotonic %} {% set trend = 'increase' if is_increasing(df['Sales']) else 'decrease' %} All {{ humanize(df[df.columns[1]].nunique()) }} {{ G.pluralize(df.columns[1]).lower() }} have seen a steady {{ trend }} in sales from {{ df['Order Date'].min() }} to {{ df['Order Date'].max() }}. {% end %}
-
Notes: Arrays may have mathematical properties like monotonicty, which can be linked to semantics like "growth", "increase" or "decline". Non-negativity may be linked to "profitable"-ity. This particular example requires two features:
- making nuggets conditional
- changing a token to it's antonym depending on a given condition (
"increase"
vs"decrease"
)